Configuring a TCP/IP Client connection to another project

The TCP/IP Client task/worksheet is used to communicate with another IWS project server.

The TCP/IP Client Runtime and TCP/IP Server Runtime tasks enable two or more projects to keep their databases synchronized. These tasks use the TCP/IP protocol to provide communication between projects. Before using the tasks, you must make sure that TCP/IP (Ethernet) communication is properly configured and running on both servers.
  • To configure the server: You do not have to configure anything on the server itself. You just have to run the TCP/IP Server Runtime task. You can choose to run it automatically on start up, or run the task manually by clicking Tasks (either local or remote) on the Home tab of the ribbon. After you start the task, a small icon displays in your system tray.
  • To stop the TCP/IP Server Runtime task: Right-click the TCP/IP Server icon in the system tray, and then click Exit on the shortcut menu.
  • To configure the client: You must use the TCP/IP Client worksheet to specify the server IP address and the tags you want to share with the server.
    The TCP/IP Client worksheet is located on the Comm tab of the Project Explorer, and it uses the same commands as the Driver worksheet.
    Figure 1. TCP/IP Client worksheet
    Web Studio Help worksheet comm tcpip TCP/IP

Use the following parameters to complete the TCP/IP Client configuration:
  • Description box: Type a description of the TCP/IP Client worksheet, for documentation purposes only. The TCP/IP Client task ignores this information.
  • Connection Status box: Type a tag name and the TCP/IP Client Configuration task will update this tag according to its connection status. A tag value of zero indicates the connection is okay. Any other tag value indicates an error code returned by the Windows Socket library.
  • Disable box: Type a tag name in this field. When this tag has any value other than 0, this TCP/IP worksheet will be disabled. Using this field, you can enable/disable the TCP/IP Client worksheet during runtime.
  • Server IP Address box: Type the IP address and Port (optional) of the target server — for example, The Port should be the same on both the Client and Server stations.

    You can also specify a String tag enclosed in curly brackets (e.g., {tagname}) if you want to dynamically change this address during runtime.

  • Send Fields option: When this option is selected, the tag properties/fields (i.e., Min, Max, Ack, Unit, LoLoLimit, LoLimit, HiLimit, HiHiLimit, RateLimit, DevSetPoint, DevPLimit, and DevMLimit) are sent with the tag values to the specified server. When this option is cleared, only the tag values (including TimeStamp and Quality, which are required) are sent.
    Note: It is possible to add or remove fields in the list of fields sent. For more information, contact Support.
  • Read Only option: When this option is selected, all communication is one-way and no tag values are written back to the specified server. This is useful when you only need to use the TCP/IP Client to retrieve data from other projects, and it can improve runtime safety and stability.
  • Send Values On Connection box: When this option is selected and the project is run, the client will ignore the first tag values that it receives from the specified server and instead send its own tag values to the server.
  • Tag Name field: Type the tags you want to share with the server.

    If the tag is an array or a class (or both), the project automatically enables every array position and class member for TCP/IP communication by default.

    To configure a specific array position and/or a specific class member, type the array position and/or class member in square brackets following the tag name. For example,level[3].member.

  • Remote Tag field (optional): Type the name of a tag to be linked with the tag you specified in the Tag Name field. If you leave this field blank, the project uses the same tag name used in the client and in the server.
Note: If you need to share an array, the tag in the server should contain the same number of elements as the tag in the client. If the tag is a class, the class definition should be the same in both server and client programs. If you do not follow these rules, unpredictable results can occur.

Only the Client task uses the ConnectionRetryTimeout parameter.