Wiesemann & Theis GmbH

Networking, sensors and interface technology for industry, office and IT

Application page

Windows COM Port Redirector:

Operation of a Modbus/RTU master in virtual environments

Model diagram for the application

The modernization of computer in building management systems, for example, is often associated with virtualization of the environment. In these cases, Windows COM Port Redirector provides serial COM ports that are fully integrated as virtual hardware in the respective guest system with the RTU master application. The Modbus/RTU data traffic is then tunneled bidirectionally and transparently through the network to a Com-Server and the RTU slaves connected there.

Quick Startup

  • Configure the RS485 2-wire mode via the internal DIP switches: 1,2,5 = ON, rest = OFF. Activation of the termination (switches 6 and 7) depends on the existing RS485 bus structure. A physical RS485 segment may contain a maximum of two termination networks.

  • Provide the power supply and the connection of the serial RTU device to the Com-Server, e.g. with the RS485 screw-in adapter.

    Product photo of screw-in adapter

  • Assign the IP parameters (IP address, subnet mask, gateway) to the Com-Server using WuTility.

    Screenshot: Setup using WuTility

  • Activate the packeting option Interpacket delay = 3ms. This ensures that Modbus datagrams are transmitted in a closed network packet.

    Screenshot

  • Check the option Packet options for TCP-Server mode

    Screenshot

  • Important: The settings made must be saved via the logout page.

    Screenshot: ’Save’

  • Install the W&T COM Port Redirector in the guest system. Due to the more modern architecture, we recommend the "COM Port Redirector Plug & Play" version on current Windows systems.

  • Start the configuration tool and insert a new virtual COM port.

    Screenshot: ’Save’

  • Enter the destination IP address of the COM-Server and - if assigned - the system password set up on the Com-Server. The accessibility of the Com-Server and the password can be checked using "Test input".

    Screenshot: ’Save’

  • Apply the changes and finalize installation of the virtual COM port with "OK" or "Apply".

    Screenshot: ’Save’

  • The newly created virtual COM port must then be configured as the interface to be used in the Modbus/RTU master application.

Possible problems

In order to diagnose any problems, it is helpful to first understand the general functioning of the COM Port Redirector in conjunction with the Com-Server:

  • Virtual COM ports are initially only passive resources of the respective Windows PC and do not allow any direct conclusions to be drawn about the accessibility of the Com-Server or its IP address.

  • Only when the COM port is opened by an application does network-side communication to the Com-Server take place and two TCP connections are established there: one for the transmission of serial user data (factory default 8000), the second for the exchange of control and status information (factory default 9094).

  • Only when both connections have been successfully established is the opening of the COM positively acknowledged with respect to the application.

  • When the COM port is closed, both TCP connections to the Com-Server are also closed again.

  • The serial transmission parameters are determined solely by the Modbus/RTU master. When the COM port is opened, the settings are transferred to the Com-Server via the network and applied. The parameters stored in the Com-Server setup are irrelevant and are overwritten by the COM redirection.

  • The Com-Server handles both network connections exclusively. If there is already a connection to one of the ports, the simultaneous attempt by a competing client is rejected (Connection refused).

If an error message appears when starting the Modbus/RTU master and opening the COM port, it is advisable to do first check the correct installation and function of the virtual COM port using the portmap tool.

Portmap tool

Start the COM Port Redirector configuration tool and click the Portmap tool button. An overview of all available or reserved COM ports in the system is generated.

Screenshot: Portmap tool

  • The columns Registry-DeviceMap, Symbolic Link and Service must be filled in. If not, check whether the installation of the port has been successfully completed in the Config Tool. If necessary, delete the COM port and create it again.

  • If the RTU master application is started and it has successfully opened the COM port, the column Opened by... shows the program name or the Process ID.

  • If all the columns are filled in AND there is no entry under Opened by..., availability of the COM port can be tested by right-clicking and option Open Com-Port. If this results in error messages, check:

    • Is a system password set in the Com-Server and is the same password stored in the COM Port Redirector?

    • Do any security or firewall applications on the computer or in the infrastructure guarantee unimpeded serial and network-side communication?

Connection State

A successful connection of the COM Port Redirector to the Com-Server can be seen on the page Setup Port x → Port State. The page is not self-updating and must therefore be updated manually via F5.

Screenshot

If the virtual COM port is opened by the Modbus/RTU master, this connection is displayed in the line Connection State. The IP address specified there corresponds to the address of the computer with the COM Port Redirector.

Byte Count (Serial Trans. And Serial Rec.)

Regardless of the operating mode, all characters received (= Serial Rec) and sent (= Serial Trans) by the respective Com-Server are counted here. The website is not self-updating, so the current values must be reloaded manually (F5).

Incrementing the counter Serial Trans. corresponds to the polling of the Modbus/RTU master to the RTU slave. Its responses are displayed in the counter Serial Rec. Following are some examples:

The Modbus/RTU reports timeouts and Serial Trans. increments Serial Rec. remains unchanged

The requests sent by the Modbus/RTU master are not recognized or understood by the RTU slave and are therefore not answered. Possible causes:

  • The serial transmission parameters selected by the Modbus/RTU master do not match the settings of the RTU slave

  • The bus polarity of the RS485 cable is incorrect. Swap A/B or +/- as a test

  • The pin assignment of the RS485 cable is incorrect, the cable is defective or not connected at all

  • The Modbus address used by the Modbus/RTU master does not match the setting of the slave

The Modbus/RTU master reports timeouts or incorrect or incomplete responses. Serial Trans. and Serial Rec. both increment

The responses generated by the RTU slave are not understood by the Modbus/RTU master or are only interpreted incompletely. Possible causes:

  • Using the factory setting, the Com-Server attempts to transmit serially received characters to the COM port as quickly as possible. As a result, RTU responses from the slave are distributed across several network packets, which leads to misinterpretations on the master side. Configure the packetization option in the Com-Server Interpacket Delay e.g. to 3ms and activate this for the Modbus/TCP server. This ensures that Modbus datagrams are transmitted in a closed network packet.

Screenshot Screenshot

Products

  • #58665

    Product photo: Com-Server PoE 3x Isolated
    Com-Server ++

    1x RS232/422/485

  • #58662

    Product photo: Com-Server ++
    Com-Server ++

    1x RS232/422/485

  • Support

    Person with headset
    Could you use some assistance?
    We’re here for you!

    You can reach our applications engineers at +49 202-2680-110

Related pages

  • Application

    Schematic representation of the application
    Box-to-Box:

    Connection of remote RTU slaves to an RTU master via network

  • Application

    Schematic representation of the application
    Modbus/TCP Gateway:

    Connecting serial Modbus/RTU slaves to a Modbus/TCP master

^