other_message — Other Modbus Messages

API Documentation

Diagnostic record read/write

Currently not all implemented

class pymodbus.other_message.ReadExceptionStatusRequest(**kwargs)

This function code is used to read the contents of eight Exception Status outputs in a remote device. The function provides a simple method for accessing this information, because the Exception Output references are known (no output reference is needed in the function).

__init__(**kwargs)

Initializes a new instance

__str__()

Builds a representation of the request

Returns:The string representation of the request
decode(data)

Decodes data part of the message.

Parameters:data – The incoming data
encode()

Encodes the message

execute(context=None)

Run a read exeception status request against the store

Returns:The populated response
class pymodbus.other_message.ReadExceptionStatusResponse(status=0, **kwargs)

The normal response contains the status of the eight Exception Status outputs. The outputs are packed into one data byte, with one bit per output. The status of the lowest output reference is contained in the least significant bit of the byte. The contents of the eight Exception Status outputs are device specific.

__init__(status=0, **kwargs)

Initializes a new instance

Parameters:status – The status response to report
__str__()

Builds a representation of the response

Returns:The string representation of the response
decode(data)

Decodes a the response

Parameters:data – The packet data to decode
encode()

Encodes the response

Returns:The byte encoded message
class pymodbus.other_message.GetCommEventCounterRequest(**kwargs)

This function code is used to get a status word and an event count from the remote device’s communication event counter.

By fetching the current count before and after a series of messages, a client can determine whether the messages were handled normally by the remote device.

The device’s event counter is incremented once for each successful message completion. It is not incremented for exception responses, poll commands, or fetch event counter commands.

The event counter can be reset by means of the Diagnostics function (code 08), with a subfunction of Restart Communications Option (code 00 01) or Clear Counters and Diagnostic Register (code 00 0A).

__init__(**kwargs)

Initializes a new instance

__str__()

Builds a representation of the request

Returns:The string representation of the request
decode(data)

Decodes data part of the message.

Parameters:data – The incoming data
encode()

Encodes the message

execute(context=None)

Run a read exeception status request against the store

Returns:The populated response
class pymodbus.other_message.GetCommEventCounterResponse(count=0, **kwargs)

The normal response contains a two-byte status word, and a two-byte event count. The status word will be all ones (FF FF hex) if a previously-issued program command is still being processed by the remote device (a busy condition exists). Otherwise, the status word will be all zeros.

__init__(count=0, **kwargs)

Initializes a new instance

Parameters:count – The current event counter value
__str__()

Builds a representation of the response

Returns:The string representation of the response
decode(data)

Decodes a the response

Parameters:data – The packet data to decode
encode()

Encodes the response

Returns:The byte encoded message
class pymodbus.other_message.ReportSlaveIdRequest(**kwargs)

This function code is used to read the description of the type, the current status, and other information specific to a remote device.

__init__(**kwargs)

Initializes a new instance

__str__()

Builds a representation of the request

Returns:The string representation of the request
decode(data)

Decodes data part of the message.

Parameters:data – The incoming data
encode()

Encodes the message

execute(context=None)

Run a read exeception status request against the store

Returns:The populated response
class pymodbus.other_message.ReportSlaveIdResponse(identifier='x00', status=True, **kwargs)

The format of a normal response is shown in the following example. The data contents are specific to each type of device.

__init__(identifier='\x00', status=True, **kwargs)

Initializes a new instance

Parameters:
  • identifier – The identifier of the slave
  • status – The status response to report
__str__()

Builds a representation of the response

Returns:The string representation of the response
decode(data)

Decodes a the response

Since the identifier is device dependent, we just return the raw value that a user can decode to whatever it should be.

Parameters:data – The packet data to decode
encode()

Encodes the response

Returns:The byte encoded message