LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus connection fails

I need to make a modbus connection with my pc as master. I can make the connection and read registers with programs such as ModSim64. But when using Labview 2017 + various versions of Modbus it does not work. I have tried to work with NI Modbus v1.2.1.42, v1.1.5.39 and plasmonic modbus master 1.3.5.3. I always get error 63 when trying to make the connection. Any ideas?

0 Kudos
Message 1 of 5
(214 Views)

Not sure if this is important: I am working with two Ethernet cards, one for connection to the outside world and one with a fixed IP to connect to the modbus slave (PLC).

0 Kudos
Message 2 of 5
(202 Views)

 

Are you sure that your device (the slave) is waiting for connection at this port? Error 63 means that host is reacheable (IP exists) but there is no listener at this port.

0 Kudos
Message 3 of 5
(183 Views)

Yes it does wait. With the program ModSim64 I can make the connection and read the holding registers. 

0 Kudos
Message 4 of 5
(177 Views)

Some comments:

  1. As suggested, it's helpful to check if there is actually a slave there. Since 502 is the default Modbus port and you say you did check with other programs, I'll assume that part works correctly.
  2. 192.168.0.1 is an address which is not reserved, as far as I know, but it is commonly used as the gateway device for the network. It's certainly possible there would be another device with that IP address in your network. I would suggest giving the slave another address.
  3. Having two network cards can definitely be an issue. When you have more than one card, the OS decides where to send your request based on things like the IP address, subnet mask, etc. If there is enough similarity between the settings for the two cards, it could decide to send through the wrong card (although I would expect that would also happen with the other programs). You could run the Route command in Windows to see how your routing table is defined. You can also try disconnecting the other card to see whether that changes things.

___________________
Try to take over the world!
0 Kudos
Message 5 of 5
(162 Views)