Event command control blocks send Modbus TCP/IP commands directly from the ladder logic to one of the clients on the module. The following table describes the format of these blocks.The IP Address for the node to reach on the network is entered in four registers (1 to 4). Each digit of the IP address is entered in the appropriate register. For example, to interface with node 192.168.0.100, enter the values 192, 168, 0 and 100 in registers 1 to 4. The Service Port field selects the TCP service port on the server to connect. If the parameter is set to 502, a standard MBAP message will be generated. All other service port values will generate a Modbus command message encapsulated in a TCP/IP packet.
The Internal DB Address parameter
specifies the module’s database location to associate with the command. The Point Count parameter defines the number of points or registers for the command. The Swap Code is used with Modbus functions 3 and 4 requests to change the word or byte order. The Modbus Function Code has one of the following values 1, 2, 3, 4, 5, 6, 15 or 16. The Device Database Address is the Modbus register or point in the remote slave device to be associated with the command. When the module receives the block, it will process it and place it in the command queue. A detailed description of the block is presented in the following table.
These words contain the IP address
for the server the message is intended. Each digit (0 to 255) of the IP address is placed in one of the four registers. For example, to reach IP address 192.168.0.100, enter the following values in words 1 to 4 → 192, 168, 0 and 100. The module will construct the normal dotted IP address from the values entered. The values entered will be anded with the mask 0x00ff to insure the values are in the range of 0 to 255.This word contains the TCP service port the message will be interfaced. For example, to interface with a MBAP device, the word should contain a value of 502. To interface with a MNET device, a value of 2000 should be utilized. Any value from 0 to 65535 is permitted. A value of 502 will cause a MBAP formatted message to be generated. All other values will generate an encapsulated Modbus message.