Modbus/TCP Server - FAQ

Do I need a license for using the Modbus server?

Yes, you need the “modbus_srv” license.

I want the Modbus server to accept all clients, no matter from which host they are. How can I configure this?

Open the SysMgm -> Driver -> MODBUS Server panel. Select the right Modbus server entry in the combo box and press the “Connection configuration” button and create a new connection. Configure the Host to “*” and set the connection active and press the OK button. Now assign the created connection to the Modbus server.

I want the Modbus client on host1 to see another data than the Modbus client on host2. How can I configure this?

You have to create a new Modbus server and create an own CNS view for this server. You also have to assign the connection from host2 to the created server. Then you have to change the port of the server and configure the client on host2 with this port.

My Modbus client cannot connect to the Modbus server. How can I solve the problem?

There are different possibilities for this behavior:

  1. The LogViewer shows a warning like this: “client <IP> / <connection name> wants to connect (connection is set inactive) – closing connection” How to solve: Open the SysMgm -> Driver -> MODBUS Server panel. Select the right Modbus server entry in the combo box and double click the <connection name> entry. Now set the connection active and apply your settings.

  2. The LogViewer shows a warning like this: “unknown client <IP> wants to connect – closing connection” How to solve: Open the SysMgm -> Driver -> MODBUS Server panel. Select the right Modbus server entry in the combo box and press the “Connection configuration” button and create a new connection. Configure the IP address and set the connection active and press the OK button. Now assign the created connection to the Modbus server.

  3. The LogViewer entry shows a warning like this: “client <IP> wants to connect – all connections are inactive due to *-connection” How to solve: Open the SysMgm -> Driver -> MODBUS Server panel. Select the right Modbus server entry in the combo box and find the connection with the “*” in the Host text field. Now set the connection active and apply your settings.

Does the Modbus server run on Linux?

Yes, the Modbus server is available for all delivered WinCC OA platforms.

Can I change the address space at runtime?

Yes, address space changes at runtime are supported.

Can I change the connection configuration at runtime?

Yes, connection configuration changes at runtime are supported.

Can I change port of the Modbus server at runtime?

No, you have to restart the server after a port change.

Can I assign another CNS view to the Modbus server at runtime?

No, you have to restart the server after you have assigned another CNS view.

Does the Modbus server support WinCC OA redundancy?

Yes, WinCC OA redundancy is supported.

What happened if a Modbus client wants to read data from the passive Modbus server?

The Modbus server will send the current data to the client.

What happened if a Modbus client wants to write data to the passive Modbus server?

The Modbus server will not accept this write request and send an error response with the error code 1 (function code not supported) to the client.

What is the byte order in a Modbus register?

The byte order in a Modbus register is big endian.

I want to map an integer value 0x11223344 to the Modbus register 0 and 1. How is the data provided to a client?

The integer value 0x11223344 is split into 16 bit parts and these 16 bit parts are written shown as follows (register order is little endian): Register 0: 0x3344 Register 1: 0x1122

I want to map a blob value 0x11223344 to the Modbus register 0 and 1. How is the data provided to a client?

The blob value 0x11223344 is split into 16 bit parts and these 16 bit parts are written shown as follows (register order is big endian, so the data of the blob is in its original structure): Register 0: 0x1122 Register 1: 0x3344

I linked a blob/string DPE to a Modbus CNS node. The LogViewer shows a message like this: “No item length defined. Ignoring item <CNS path>". What does this mean?

If you link a blob/string DPE you have to define the number of registers the blob/string uses. Open the Plantmodel Editor an select the node <CNS path> and go to the “Modbus” tab. Then configure the number of registers and apply your setting. You can also do it in CTRL with the cnsSetProperty(“<CNS path>”, “OA:MOD”, (uint) registers) function call.

I linked a blob/string DPE to a Modbus CNS node. The LogViewer shows a message like this: “No dynlength defined. Ignoring item <CNS path>". What does this mean?

If you link a blob/string DPE you have to define the number of registers the blob/string uses. Open the Plantmodel Editor an select the node <CNS path> and go to the “Modbus” tab. Then configure the number of elements and apply your setting. You can also do it in CTRL with the cnsSetProperty(“<CNS path>”, “OA:DMOD”, (uint) elements) function call.

I get the following message in the LogViewer: “Userdata <key> has wrong type for <CNS path>”. What does this mean?

You have defined the “OA:MOD” or the “OA:DMOD” CNS property with another variable type than an uint. Use cnsSetProperty(“<CNS path>”, “<key>”, (uint) value) to assign the right datatype to your CNS property.

I get the following message in the LogViewer: “Item wants to write to used bit/register (element linked at offset <offset> needs <len> bits. Ignoring item <CNS path>”. What does this mean?

This warning occurs because an the item linked at <offset> of the same area as the <CNS path> uses the actual <CNS path> field for its data. Correct the length of the <offset> element or move the <CNS path> element to the next free one. (e.g. . offset is 0.2.0, len is 5, CNS path is 0.2.4: correct the len of the 0.2.0 element to 4 or move the 0.2.4 element to 0.2.5).