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: 

modbus slave with 32 discrete inputs will lose a byte data

Hello, I download modbus library 121 and add to the usr.lib. I start with the serial master example and serial slave example. And I increase both the master and slave discrete inputs to 32 inputs.

But when the communication is established, the third byte of discrete inputs will lose. And the forth byte of slave will become the third byte in master. 

The vi is attached, and my labview version is 2012 sp1. 

The communication is based on configure virtual serial port driver.

And I use SUDT SerialTrace to track the serial, the result is:

The master write       01 02 00 00 00 20 79 D2

The slave response 01 02 04 0F C7 AA 00 37 AB

which means the fouth data cover the third data and the forth data place become 00.

I wonder if anyone could help me. Thanks very much!

 

 

 

 

0 Kudos
Message 1 of 2
(2,049 Views)

Have a look at all the reviews on the download site...

 

Error in code - Feb 21, 2006

By Jim Gruenbacher, Airgas.

The "MB Modbus Command to Data Unit.vi" has a mistake in it. The "Write Multiple Coils" Function Code will not work properly past 8 bits of data. In case "15", the index to the "Split Array" VI should just be 8. Either that or you could remove the shift register and use an index array instead. The current implementation however corrupts the output data past 8 bits.

 

Kudos are welcome...
0 Kudos
Message 2 of 2
(2,026 Views)