other_message — Other Modbus Messages

Module author: Galen Collins <bashwork@gmail.com>

Section author: Galen Collins <bashwork@gmail.com>

API Documentation

Diagnostic record read/write

Currently not all implemented

class pymodbus.other_message.ReadExceptionStatusRequest

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).

decode(data)

Decodes data part of the message.

Parameters:data – The incoming data
encode()

Encodes the message

execute()

Run a read exeception status request against the store

Returns:The populated response
class pymodbus.other_message.ReadExceptionStatusResponse(status)

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.

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

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).

decode(data)

Decodes data part of the message.

Parameters:data – The incoming data
encode()

Encodes the message

execute()

Run a read exeception status request against the store

Returns:The populated response
class pymodbus.other_message.GetCommEventCounterResponse(count)

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.

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

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

decode(data)

Decodes data part of the message.

Parameters:data – The incoming data
encode()

Encodes the message

execute()

Run a read exeception status request against the store

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

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

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

Table Of Contents

Previous topic

exceptions — Exceptions Used in PyModbus

Next topic

file_message — File Modbus Messages

This Page