Support Forums
Connecting to a Modbus server (over TCP)

Hi all,

I'm trying to connect to a TCP modbus server running on the same machine as the instance of VTSLite. I've confirmed the server is operating (with a different client), but I can't seem to get my VTS application to write or read any addresses.

I've followed the process here to make my tags, using "localhost" as the IP address and the same port as my server (standard 502) https://www.youtube.com/watch?v=Clt2uEIuL-E

I've tried different modbus addresses, but it doesn't seem like it's actually hitting the server at all. Opening up the trace viewer and attaching it to my application... I see absolutely nothing. Is there an obvious configuration step I might have missed? My tag configuration is shown below.

5c59f0d18bd61
5c59f0d18958d
5c59f0d1952ed

If there's not anything obviously wrong, can someone point me in the direction of some instructions for using the trace viewer? It seems straight forward but maybe I'm not using that correctly either.

Thanks

Hi all, I'm trying to connect to a TCP modbus server running on the same machine as the instance of VTSLite. I've confirmed the server is operating (with a different client), but I can't seem to get my VTS application to write or read any addresses. I've followed the process here to make my tags, using "localhost" as the IP address and the same port as my server (standard 502) https://www.youtube.com/watch?v=Clt2uEIuL-E I've tried different modbus addresses, but it doesn't seem like it's actually hitting the server at all. Opening up the trace viewer and attaching it to my application... I see absolutely nothing. Is there an obvious configuration step I might have missed? My tag configuration is shown below. ![5c59f0d18bd61](serve/attachment&path=5c59f0d18bd61) ![5c59f0d18958d](serve/attachment&path=5c59f0d18958d) ![5c59f0d1952ed](serve/attachment&path=5c59f0d1952ed) If there's not anything obviously wrong, can someone point me in the direction of some instructions for using the trace viewer? It seems straight forward but maybe I'm not using that correctly either. Thanks

I'd suggest you try changing the IP address to 127.0.0.1 which is another way of saying localhost but forces use of an IPv4 connection.

I'd suggest you try changing the IP address to 127.0.0.1 which is another way of saying localhost but forces use of an IPv4 connection.

Trihedral Engineering Ltd.

edited Feb 12 at 11:48 am

It was indeed a problem with interpreting the localhost string. Silly mistake in a new environment. Thanks Dave!

It was indeed a problem with interpreting the localhost string. Silly mistake in a new environment. Thanks Dave!
edited Feb 6 at 1:51 pm

To ensure this wasn't a VTScada bug; I had our development group look into this a little further and they came back with the suggestion that your computer, like mine, is probably using the IPv6 address '::1' rather than the IPv4 '127.0.0.1' when you enter localhost. If you are not connecting, it is likely that your Modbus server is not able to handle IPv6 addresses.

You can check your localhost resolution by running the following in Windows PowerShell:

resolve-dnsname localhost

If the return looks like the following, you are probably passing the IPv6 address by default:

Name                                           Type   TTL   Section    IPAddress
----                                           ----   ---   -------    ---------
localhost                                      AAAA   1200  Question   ::1
localhost                                      A      1200  Question   127.0.0.1
To ensure this wasn't a VTScada bug; I had our development group look into this a little further and they came back with the suggestion that your computer, like mine, is probably using the IPv6 address '::1' rather than the IPv4 '127.0.0.1' when you enter localhost. If you are not connecting, it is likely that your Modbus server is not able to handle IPv6 addresses. You can check your localhost resolution by running the following in Windows PowerShell: ```` resolve-dnsname localhost ```` If the return looks like the following, you are probably passing the IPv6 address by default: ```` Name Type TTL Section IPAddress ---- ---- --- ------- --------- localhost AAAA 1200 Question ::1 localhost A 1200 Question 127.0.0.1 ````

Trihedral Engineering Ltd.

As a follow up, there was an issue with the "Modbus Simulator" application, which created a Modbus slave tag for each new incoming connection, not handling an IPv6 connection.

The workaround was to force an IPv4 connection, e.g. by using 127.0.0.1.

As a follow up, there was an issue with the "Modbus Simulator" application, which created a Modbus slave tag for each new incoming connection, not handling an IPv6 connection. The workaround was to force an IPv4 connection, e.g. by using 127.0.0.1.

Software Developer with Trihedral

97
4
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft