modbus_tcp_server v1.0.2 Modbus

This module implements the read and write functions of a Modbus Server.

Read

This module checks for valid quantities in read requests and will return a Modbus exception if they are out of bounds.

If the quantity value in the read request is valid, the appropriate ModbusDatabase is read and the results are returned. The appropriate ModbusDatabase is determined based on the function code in the request.

Write

This module checks for valid quantities in write requests and will return a Modbus exception if they are out of bounds.

If the quantity value in the write request is valid, the appropriate ModbusDatabase is written to and the results are returned. The appropriate ModbusDatabase is determined based on the function code in the request.

Summary

Functions

This function simply returns the integer corresponding to the Modbus Exception code atom passed in

The read function is responsible for verifying the register quantity is valid, and if so, performs the read from the ModbusDatabase

The write function is responsible for verifying the register quantity is valid, and if so, performs the write to the ModbusDatabase

Functions

exception_value(exception)

This function simply returns the integer corresponding to the Modbus Exception code atom passed in.

read(function_code, starting_address, count)

The read function is responsible for verifying the register quantity is valid, and if so, performs the read from the ModbusDatabase.

If the register quantity is not valid, an Illegal Data Value Modbus Exception is returned.

write(function_code, message)

The write function is responsible for verifying the register quantity is valid, and if so, performs the write to the ModbusDatabase.

If the register quantity is not valid, an Illegal Data Value Modbus Exception is returned.