Tech Note 912 - Using Alternate TCP Port Numbers With Modbus Ethernet DAServer
Tech Note 912 - Using Alternate TCP Port Numbers With Modbus Ethernet DAServer
All Tech Notes, Tech Alerts and KBCD documents and software are provided "as is" without warranty of any kind. See the Terms of Use for more information.
Topic#: 002725
Created: January 2013
Introduction
This Tech Note outlines configuring the Wonderware Modbus Ethernet DAServer (DASMBTCP) to use TCP Ports other than the default port
number TCP 502.
Application Version
DASMBTCP 1.5 SP1 or greater
Configuring DASMBTCP
Overview
In order to demonstrate the capability of configuring alternate TCP ports in all of the possible configurations, we will create multiple
device configurations within DASMBTCP via the Wonderware System Management Console (SMC).
The first configuration item within the DASMBTCP structure is the TCPIP_Port object. The editor interface will only allow you to have one
TCPIP_Port object within the DASMBTCP configuration (Figure 1 below).
The TCPIP_Port object is not editable, and is set to TCP Port number 502. This is the default TCP Port for all devices, unless there is a
device-specific TCP Port number defined. Even if you change this directly in the DASMBTCP XML configuration file, there will be no impact
on any devices. You must set a device-specific TCP port if you want the device to use a TCP port other than 502 (Figure 2 below).
These devices do not have a UI configuration setting to allow for an override of the default TCP port number. You need to do this
file:///C|/inetpub/wwwroot/t002725/t002725.htm[1/22/2013 1:29:53 PM]
Using Alternate TCP Port Numbers with Modbus Ethernet DAServer
manually in the DASMBTCP XML configuration file. A device Group called Topic_100 is created for this device.
Next we create the ModbusPLC object (Figure 4 below). Note that the ModbusPLC object has a UI configuration setting to allow
overriding the default TCP port number.
To set the TCP Port number for this device, you simply type the Port Number in the Port number field. It is not shown, but a device
Group called Topic_101 is created for this device.
Next we create the ModbusBridge object with ModbusPLCRS object (Figures 5 and 6 below).
Note that the ModbusBridge object does not have a UI configuration setting to allow us to override the default TCP port number. You
need to do this manually in the DASMBTCP XML configuration file. It is not shown, but a device Group called Topic_102 is created for
this device.
Since the TCP Port setting applies to the ModbusBridge object that contains the IP address, this example configuration also applies when
using the Compact984, ModiconMicro, and TSXMomentumRS sub-objects under the ModbusBridge. This also means that each bridge
can have a different TCP port configured.
Now that we have a few devices configured, we can activate DASMBTCP and use WWClient to attempt to read from the devices (Figure 7
below).
If we run NETSTAT from a Command Prompt, we can see the three connections being attempted, all using TCP port 502 (Figure 8
below). Note that we did not have actual devices to connect to with these IP addresses, so the connection state does not show as
Established in the screen capture.
The easiest and safest way to work directly with the configuration file is to use an XML Editor like Microsoft XML Notepad 2007.
Be sure that DASMBTCP is deactivated and the SMC is closed while you are modifying the configuration file.
I also set the ModbusBridge object to TCP Port 506 using these same steps. Setting the port Number is done within the
DeviceNode section of the configuration file that correlates to the ModbusBridge object's configuration.
4. Change the ModbusPLC object's TCP Port number to 510 using the User Interface and save the changes (Figure 12 below).
5. Activate DASMBTCP, and attempt to read from the devices again using WWClient. Then run NETSTAT from a command prompt.
You can now see that each device is using the ports that we specified (Figure 13 below).
D. Scott
Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc., 26561 Rancho Parkway South, Lake Forest, CA 92630. There is also
technical information on our software products at Wonderware Technical Support.
Back to top
©2013 Invensys Systems, Inc. All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form or by any means, electronic or
mechanical, including photocopying, recording, broadcasting, or by anyinformation storage and retrieval system, without permission in writing from Invensys Systems, Inc.
Terms of Use.