Communicating to Remote PLCs via Telephone Modems
LookoutDirect includes several features to allow you to easily connect to remote PLCs via Telephone Modems. This technote will walk you through configuring your serial port and modem and demonstrate how to successfully dial, poll, then hang-up to multiple remote PLCs from one LookoutDirect PC. This example uses a Modbus Driver Object and the modem connected to the PCs COM 2 port.
Connect your modem to the PCs COM 2 port and configure its driver settings within Windows. We encourage using an external modems because internal modems which do not have status lights are more difficult to troubleshoot when they don't work correctly.
Open LookoutDirect and set your Serial Port Settings by selecting Options>>Serial Ports... from the menu bar.
Create a switch that will be used to activate dialing of your modem to your PLC.
Create a Pulse Timer object that will be used to control the Polling frequency of the driver object we will create next. Fill in the parameters as shown below. This configuration will enable our driver object to poll the PLCs every 500ms for a duration of 250ms. If you are unfamiliar with the Pulse object please see the LookoutDirect reference manual and/or Online Help for additional information.
Create a driver object (Modbus for this example) and configure the port settings to match the PLCs port the remote modem is connected to. Most modems only communicate Parity None so you may have to change your PLC port settings to this in order for the modem to connect properly. Increase the Receive timout to 2000msecs to give the modem enough time to initially connect. Additionally, add the phone number of the remote modem and remove any time reference from the PollRate= field. Now create a Logical If expression (LIF) that will utilize our pulse timer and switch to control the actual pollrate. The expression will read
LIF(SwitchDialModem, TimerPulsePoll, FALSE).
From the Object menu click on Edit Connections and select the driver object Modbus1. Select the OffHook Writable Member and connect it to the Switch Dial Modem.
Comments: You can use the OffHook data member to enhance communications when using the Modbus object class with dial-up modems. When OffHook is TRUE and the serial port is connected to a dial-up modem, the Modbus object does not hang up the modem when the poll is complete. Rather, it keeps the phone off the hook, retaining exclusive use of the serial port. As long as OffHook is TRUE, the Modbus object continues to poll the same PLC without hanging up the modem.