Setting Up TLServer's Serial Communication Port


serialsetup1.gif (10690 bytes)

This dialog box allows you to configure the serial port of the host computer to match the setting on the PLC for proper communication. Most of the items here are self-explanatory. If you have more than one PLC connected to the host computer via RS485, all the PLCs must have the same serial port settings as the TLServer. The serialsetup2.gif (303 bytes) button allows you to test whether the communication port is available to TLServer. You can also click the serialsetup3.gif (336 bytes) button to temporily relinquish the port to other applications (such as TRiLOGI Version 3 or 4). Note that you will need to close an opened port before you can change its parameter.

The (Command String) text entry field allows you to test communication with the PLC using its native or MODBUS ASCII protocols. If you enter a string here and press <Enter>, the ASCII string will be sent to the PLC connected to the serial port and the response string will be displayed in the bottom text box. If the comm port is not yet opened this command will automatically open it.

Note that only multi-point host link commands are accepted here. The only point-to-point command acceptable here is the "IR*" command which queries the ID address of the PLC.

If you have only one PLC connected to your TLServer computer, then you can test the communication now using the following command string:  

Command String : IR*
Response String: IR01*

The response string tells you that the ID address of this single PLC is 01. You can then try other host link commands using this ID address. (e.g.   @01RI0000*  to query the states of inputs #1 to #8)  If you have more than one PLC connected you should not use the "IR*" since all connected PLCs will try to respond simultaneously, thus resulting in a garbage return string.

To change the ID of a PLC, e.g., from 01 to 05, you can send the command string "@01IW0500*" to the PLC. In TLServer 2.0 there is also a new "Change PLCID" button which does this for you automatically. You can click on the "Detect ID" button to check the current ID and then the "Change ID" button to write the new ID to the PLC.


Changing Communication Settings

Most likely you may want to leave the comm port settings at their default values:  38,400 bps,  8 data bits, 1 stop bit,  no parity.  Some reasons for changing the comm port settings may be due to the need to change the PLC's serial port to lower values (e.g. for communication via radio using 9600 bps).  Changes to the comm settings are saved to the TLServer configuration file:  "tlserver1.cfg" when you quit TLServer.

One other scenario is when you need to power cycle an M-series PLC with DIP switch #4 turned ON (to halt the CPU to disable the "1st.Scan" pulse). Since the PLC's serial port is set to 9600 bps when power ON with DIP Switch #4 set, you will need to change the baud rate  temporarily  in order to communicate with the PLC (e.g to blank out a program that causes trouble).

However, do remember to change the baud rate setting back to 38400bps after you have reset the PLC with the DIP switch OFF, otherwise you may have problems communicating with the PLC later on since changes to comm settings are automatically saved.

Modem Support

1. Dial Modem: TLServer 2.0 incorporates support for dialing a modem connected to the PC's com port. This is useful if the PLC has to be located at a remote location yet still has access to the public telephone line or to a cellular phone. You can then connect the PLC to a standard analog modem such as the US Robotic 33.6Kbps or Hayes Acura smart modem. The TLServer can then dial the phone number of the remote modem and make a connection. Once a connection is established, the remote PLC is immediately accessible to  client applications such as Internet TRiLOGI or TRi-ExcelLink, etc over the Internet, Intranet or localhost as if it were connected to the TLServer via the serial port directly

Notes:

To setup TLServer  to dial a modem, first close the active COM port by clicking on the "Close Port" button. Select the COM port where the modem is connected to. (you can find out the which COM the modem is connected to by checking the "Control Panel -> Modems -> Properties")  Click to select the  "Modem" checkbox.  You will then be able to enter a telephone number to dial. The 3 buttons: "Connect", "Hang Up" and "Special" become enabled when you select the "Modem" mode.  Note that the "Baud Rate" field now becomes the "DTE speed" which specify the line rate between the PC and the modem (this has nothing to do with the actual baud rate between the modems which will be automatically negotiated based on the quality of connection). Normally you should leave the DTE speed set to the highest value (115200) unless your modem manufacturer specifies otherwise. The PLC can be operating at a different baud rate from the PC to modem-line-rate because of the modulation/domoduation action of the modem. 

* Important: The PLC-to-modem connection must be properly prepared before you can use TLServer to connect to the PLC's modem. Click here to read more details about the PLC-to-Modem Communication Setup.

Once you have entered a proper phone number, click on the "Connect" button to start dialing the modem (make sure that the "Auto Answer" check box is not checked). If the remote modem is busy or does not answer the call you will see the corresponding error messages in the response box. Click on the "Hang Up" button anytime to abort the dialing operation. 

If you click on the "Special" button a special dialog box will appear as follow:

tlserver5.gif (4766 bytes)
  • You can change the DTE speed by selecting a new value from the choice menu.
  • You can specify a special AT command to be sent to the modem during modem initialization. Normally you can leave this field to its default value which is AT&K0.
  • You can also specify a special "Call-in Password" which is only used if the TLServer puts itself in auto-answer mode (see description later). Any incoming connection made by a remote modem must give the correct password upon connection, otherwise the connection will be immediately dropped. The Call-In password feature is disabled if the corresponding textbox is empty.

2. Auto Answer: If you select the "Auto Answer" checkbox and click on the "Connect" button, the TLServer will setup the modem to automatically answer the incoming call on the first ring. There are many uses of this capability:

Some sample ".PC5" programs that enable a PLC to dial in to the TLServer and request for file or email services are provided in the following folder:

"C:\TRiLOGI\TL5\usr\samples\File Services and Modem"

To prevent unauthorized incoming call, you can specify a "Call-In Password" string as described above. If the "Call-In Password" contains any text other than an empty string, then the incoming caller, upon connection, must immediately send a CR-terminated string that matches the "Call-In Password" string in order to maintain the connection.  If the password is incorrect the TLServer will disconnect the remote modem to prevent unauthorized access. If the call-in password is validated the TLServer will acknowledge this by sending the a CR-terminated string "<OK>" to the remote PLC via the modem. It is the duty of the incoming caller to check the acknowledgement string to ensure that the connection is not dropped by the TLServer.