How do I make switches at a remote location turn on relays locally using Modbus TCP?
The first step is to identify what registers are associated with the hardware. This applies to whatever the hardware is, Control Solutions product or otherwise. We are using an AddMe III in this example.
Our switches are going to be connected to the analog/universal inputs configured for dry contact. This means the switches simply need to make a closure to ground to be recognized. These inputs are associated with integer register numbers 1 through 16 on AddMe III. (They are mirrored in floating point registers 1001 and up, but we don't need floating point for a simple switch.)

We will use the AddMe III relay outputs locally. These are found at registers 25 through 32 on AddMe III. If you are using a different web enabled product from Control Solutions, the register numbers should be listed on a web page associated with the I/O points of interest. When configuring BAS-700 I/O, the register numbers will be allocated based on board position in the track.
Next we need to tell our local device where to find the remote device. We are going to have the local device read the remote device in this example. You could turn this around and have the remote device write to the local device.
We are assuming in this example that the remote device whose inputs have switches connected is at IP address 10.0.0.2.
The real action starts here. We proceed to populate the list of read maps. Each map entry causes the local device to read a register in the remote device at the pollling rate we have given. When the mappings are in contiguous order, they are automatically combined into a single communication (thereby reducing network traffic).

Click on the map number to expand out the details of that mapping. The items of most interest are shown in tabular form on the top level page. To get the list to grow, click on any map number link, and change the number of read maps enabled. This number is shown at the bottom of the frame of data that appears in that page.
The above example will turn on relay #1 locally when remote input #1 sees a switch closure, and likewise for input-output pairs 2 and 3. The response time will be determined largely by the polling rate you have set. It can be very short, but will generate a lot of network traffic if the polling time is short. You will need to find a compromise between response time desired and network loading.
|