Modbus slave device search methodology – Comtrol Modbus TCP User Guide User Manual

Page 30

Advertising
background image

30 - Chapter 2. Programming Interface

DeviceMaster UP Modbus/TCP User Guide: 2000447 Rev. I

Modbus Slave Device Search Methodology

5.

In the PLC program, address messages to the Modbus slave device using the IP Address of the
DeviceMaster UP and the Unit Identifier of the slave device(s).

2.4.2. Modbus Slave Device Search Methodology

Locating a Modbus slave device on a DeviceMaster UP 1-port is relatively simple. Either the Modbus slave
device is connected to the port or it is not. However, if more than one port is configured for Modbus slave on a
DeviceMaster UP 2- or 4-port, the device must be found. The following is an explanation of how the search
algorithm works on a DeviceMaster UP 2- or 4-port.

Locating a Modbus slave device after a reboot or port reset:

When the DeviceMaster UP receives a message for a Modbus slave device for the first time since reboot or
port initialization, it will transmit the Modbus slave message out all Modbus slave serial ports and wait for a
response to be returned. Once the response is returned, the device port is known and all messages sent to the
device will be routed through the serial port.

Lost Devices:

Lost devices, or devices that time out, are a special case. The DeviceMaster UP provides two methods for
handling lost devices via the Lost Device Search Enable option on the web page.

Disabling this option on a Modbus slave port:

-

Prevents the DeviceMaster UP from searching for a lost device on other Modbus slave ports.

-

Prevents lost devices known to have been on other ports from being searched for on this port.

Note: This is the recommended setting whenever it is desired to prevent timeout delays on other Modbus

slave ports in the event that a device times out.

Enabling this option on a Modbus slave port:

-

Allows the DeviceMaster UP to search for lost devices on all Modbus slave ports with the Lost Device
Search Enable
option turned on.

Note: This can be useful for locating devices if a device has been moved onto another port by moving

the serial cable or, perhaps, by moving the device onto a different Modbus slave serial loop.

-

This will cause timeout delays on all Modbus slave ports with the Device Search Enable option turned
on until the device is found.

Advertising