From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in password protected Modbus VI

Good Morning All

The attached VI, which very simply writes a Modbus RTU command out on a master serial port, to set a coil value. I'm using the Modbus library supplied by NI

The VI does work on my hardware setup....no problem there....but when the command is finished an error is thrown (error 56). The error is coming from a sub vi, which it turns out is password locked.

Anybody have an idea about how to fix this?

 

Thanks

0 Kudos
Message 1 of 4
(3,161 Views)

an update on this error.....if I change the serial type input of the "create master instance" vi from a constant to a control....the error doesn't occur....any thoughts?

The vi functions well now, but it would be nice to have an answer

0 Kudos
Message 2 of 4
(3,132 Views)

It appears that error 56 generally occurs due to a timeout. There's a chance that the constant wasn't providing the 0 or 1 that the serial type input expected, or wasn't setting it up correctly. If you want to read a little more information about error 56, you can find it in the following link:

 

http://digital.ni.com/public.nsf/allkb/D90C4F99C1EF3F6A86256E4A0080A120

 

Alex C.

National Instruments

Applications Engineer

Alex C.
Applications Engineering
National Instruments
0 Kudos
Message 3 of 4
(3,087 Views)

Thanks Alex

From what I've read about the error 56, this applies if you are using a network.

I'm using a computer usb port to RS485 converter which is connected to a non NI daq. The comms protocol is Modbus RTU

The error is emanating from a Modbus locked vi, which has no input for a user defined timeout.

The particular modbus vi throwing the error is involved with doing a read of the ADU packet from the device, which I can probably assume is not responding within the timeout set within the vi, and this causes the problem.

Error 56 is then a "generic" error in this instance

 

It's interesting that my vi works fine now that I've replaced the serial type input of the Create Master Instance vi with a control instead of a constant....even though the constant was set to RTU.......maybe just a coincidence

Regardless, the vi is working fine now....knowing why the error occured would only be academic now.

 

Thanks agian for your interest

Ray

0 Kudos
Message 4 of 4
(3,074 Views)