LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 56 (Timeout) on Modbus RTU read

Solved!
Go to solution

Hello,

 

Our program has been running on a cRIO for a while, reading data using Modbus RTU (Modbus VIs from DSC Module / Real-Time Module).

Suddenly all modbus instruments stopped giving data. I'm getting a timeout on all read calls.

 

Tried restarting, etc., reading only from one instrument, but nothing helps.

Open MAX and try "Open Visa test panel" on the device, but this gives a message:

 

Error opening resource:
visa://123.234.345.123/ASRL3::INSTR

VISA:  (Hex 0xBFFF00A7) The remote machine does not exist or is not accepting any connections. 
If the NI-VISA server is installed and running on the remote machine,
it might have an incompatible version or might be listening on a different port.

This tells me it's probably not the code, or the physical instruments (since none of them are working now), but something with VISA in general ?

 

LabVIEW 16, with corresponding VISA 16. Note that this worked well until recently.

 

Any advice how to proceed with solving this VISA problem?

0 Kudos
Message 1 of 17
(8,058 Views)

If the software has not changed it is most likely hardware.  Did you do any updates or program changes lately?

 

Do you have a program from the manufacturer that you could use to try and communicate with the devices without using LabVIEW or MAX?  Of course, more information would be very helpful.  But if you can connect directly to the instrument with the manufacturers program and it works, then you need to find the issue between there and the cRIO causing the issue.  It could be a broken wire or a loose connection, but since we know nothing about your setup it is hard to say.

0 Kudos
Message 2 of 17
(8,040 Views)

The last time I saw that problem it was the port number.

 

Another process had grabbed the port and since it was not running Modbus, it refused the connection.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 17
(8,035 Views)

Hello Oksavik,

Try reinstalling NI-VISA server on remote device (cRIO)


CLD Using LabVIEW since 2013
Message 4 of 17
(8,015 Views)

@Ben@Ben wrote:

The last time I saw that problem it was the port number.

 

Another process had grabbed the port and since it was not running Modbus, it refused the connection.

 

Ben


 

Hello, and thank you for the reply.

 

Do you mean the serial port? With Modbus RTU I connect to the instruments "Unit ID" on the "VISA resource" (ASRL3). When you say port it makes me think of an TCP port being occupied.

 

I can restart the cRIO and have the same issue. Could something occupy ASRL3 on startup, and not be released?

 

Also it's during the first "Read" I'm getting the error. The "Create Master Instance" is not giving an error. I would assume that opening the connection to the serial device would give an error if it was already in use?

0 Kudos
Message 5 of 17
(8,003 Views)

@_Bryan wrote:

If the software has not changed it is most likely hardware.  Did you do any updates or program changes lately?

 

Do you have a program from the manufacturer that you could use to try and communicate with the devices without using LabVIEW or MAX?  Of course, more information would be very helpful.  But if you can connect directly to the instrument with the manufacturers program and it works, then you need to find the issue between there and the cRIO causing the issue.  It could be a broken wire or a loose connection, but since we know nothing about your setup it is hard to say.


Thank you for your reply.

 

This is a good idea, if I'm not able to make any progress I will see if we can communicate with them using a manufacturers program. Not sure what exists.

 

Not certain about any changes, there are many parties working on different parts of the system, and I'm not always up to date. 🙂

0 Kudos
Message 6 of 17
(8,000 Views)

@kartiknattar wrote:

Hello Oksavik,

Try reinstalling NI-VISA server on remote device (cRIO)


Thank you. This will be my last resort, and I expect it would fix the issue.

Still, I would like to know why it occurred, and if it could be avoided in the future.

0 Kudos
Message 7 of 17
(7,999 Views)

Hello again,

 

I'm not making any progress on this problem.

In the end I decided to stop wasting time, formatted the cRIO and installed software again.

To my surprise the problem remains.

 

I will have to investigate the different instruments, to determine if one of them is causing problems.

These are multiple instruments connected using RS485, and I guess if one is malfunctioning maybe it affects the others.

0 Kudos
Message 8 of 17
(7,959 Views)

If multiple instruments are connected then make sure that each instrument have a unique slave id. First start with just one instrument and then try to increase the device. Make sure the polarity is of the device is properly assigned to the terminals.


CLD Using LabVIEW since 2013
0 Kudos
Message 9 of 17
(7,956 Views)

@Oksavik wrote:
Error opening resource:
visa://123.234.345.123/ASRL3::INSTR

 


Just to be sure: You changed the host address shown here to a random IP, right?


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 10 of 17
(7,942 Views)