How can we help?
Modbus TCP Source
Overview
The Modbus TCP source is used to receive data from a device compatible with the Modbus protocol.
Modbus TCP does not have any built-in source variables. All variables are custom variables, which must be created under the DataXchange Tab → Variable → Modbus TCP. All of these variables are licensed at the Bronze level.
For bit values read via coil or discrete input values, select an Input Type of Digital. For any variable reading either a holding register or input register, select an Input Type of Analog.
To use these variables, the Modbus TCP Communication Source must be configured for an equipment.
Modbus TCP has two built-in target variables, both of which are licensed at the Gold level:
[ModbusTCP.send_coil] {Address,Value}
and
[ModbusTCP.send_register] {Address,Value}
These will change values on the Modbus device for coils or registers of the address provided. To use these variables, an equipment must have a Modbus TCP Communication Target configured.
NOTE: All values sent to Modbus TCP registers are sent as unsigned 1-word integers.
Modbus TCP Configuration
To use Modbus TCP variables in expression, a Modbus TCP Communication Source or Target must be configured.
Modbus TCP Communication Source
From the DataXchange tab, select a machine and click Communication. Select a Communication Role of Source, a Communication Type of Modbus TCP and click Enter.
Enter the Host and Port information for the Modbus device. Under the Custom Variable headings are the custom variables created earlier. For each variable that will be used, enter the Modbus TCP Address. These addresses are limited to 5 digits, so for 6 digit addresses remove the first digit and use that 5 digit value.
For Digital Inputs, select a function of Read Coils or Read Discrete Inputs. The data type for a digital input will always be a Bit value.
For Analog Inputs, select a function of Read Holding Registers or Read Input Registers. Select the data type corresponding to the data that will be provided at that address. For Float values, optionally enter the Input Range: Min and Max, which are the range of incoming values for the analog input. The Scaled Range: Min and Max are the ranges DataXchange will interpret from the input and use in expressions. If no ranges are provided, the data will be used exactly as it is received from the device.
NOTE: 1-word Integer values are read as their unsigned values with a range of 0 to 65,535. 2-word Integer values are read as signed with a range of -2,147,483,648 to 2,147,483,647.
Modbus TCP Communication Target
The Modbus TCP Communication Target is required to send information from DataXchange to a Modbus device in an expression. This data is sent via the [ModbusTCP.send_coil]
and [ModbusTCP.send_register]
result variables when Modbus TCP is selected as the Expression Target.
From the DataXchange tab, select a machine and click Communication. Select a Communication Role of Target and a Communication Type of Modbus TCP then click Enter.
Enter the Host IP or Name of the Modbus device, along with the Port. No further information is required to use Modbus TCP as a Target. Data to be sent and the addresses to which they will be sent are defined within the expressions.