Node for connecting devices via Modbus |
|||||||||||||||||||||||||||||||||||||||||||||||||
IntroductionModbus allows data to be read out and modified on the device connected to it. The Modbus protocol distinguishes here between (switching) states that can be read or written in discrete bits, and 16-bit registers that are used to read or write values. To do this, the Modbus protocol uses the different access methods listed below and their function codes. The description of the device to be addressed should show which functions the device supports, as well as the meaning of the individual data to be operated via Modbus. A device manufacturer might want to use values that do not fit in a 16-bit register and therefore use two 16-bit registers for large values that require 32-bit operation. This access method is not specified by the Modbus protocol, but is supported by the logic node.
Modbus distinguishes between the following object types:
The following functions allow access to the individual bits and registers in the various address ranges:
Using the nodeThe logic node uses the Modbus TCP protocol for communication, which usually operates on port 502. The node is designed so that only one of the functions listed above is used at a time. This means that depending on the application, the node may be required multiple times in order to fully operate the device. The connection to the device is not constantly maintained, but instead established briefly for each access and terminated again after the data has been exchanged. |
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
Inputs
|
|||||||||||||||||||||||||||||||||||||||||||||||||
Outputs
ExamplesA temperature value of a heating system is to be read cyclically. According to the description of the heating system's Modbus connection, the supply temperature is on register number 17 and can be read with function FC4. The temperature is output to one decimal place; the value is entered in the register with a factor of 10 and must be converted accordingly after reading. According to the manufacturer's description, the index starts at 1, so the start input of the Modbus node in this example must be 18. |
|||||||||||||||||||||||||||||||||||||||||||||||||
|