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: 

NI Modbus CRC creation

I have used Ni modbus library. I want to send wrong TCP/IP modbus "CRC" to a device from LabVIEW, for testing some functionality of the device.

 

Could you please guide me?

How can i change the CRC value in the modbus library?

0 Kudos
Message 1 of 9
(1,316 Views)

There are at least three Modbus libraries available. Only one of them (the old NI Modbus.llb) could be modified by the user, the other are password protected. Which one are you using? (hint: post one vi of yours or a picture of the BD showing the Modbus functions).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 9
(1,310 Views)

Is this library support NI Labview 2019?

Could you please share me the library file?

I have attached picture of block diagram.

0 Kudos
Message 3 of 9
(1,277 Views)

That purple library is supported in LabVIEW 2019, but its subVI's are locked once you get to a certain level, the level you'd need to play with in order to fake another CRC.

 

Here is a link to a library I've used and is fully open.  You can dig all the way down the subVI hierarchy, find the subVI where the CRC is calculated, make a copy and apply some code to allow you to fake a bad CRC.

 

https://www.ni.com/example/29756/en/

0 Kudos
Message 4 of 9
(1,274 Views)

Consider that the interface of the library RavensFan suggested is different from the one you are using now.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 9
(1,270 Views)

If this is for testing purposes only another way to accomplish this would be to capture the data that gets sent to the device and simply use a raw TCP or serial connectiuon to the device and send the raw data. Using that you can manipulate any field within the packet.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 6 of 9
(1,265 Views)

Okay will check.

thank you

0 Kudos
Message 7 of 9
(1,234 Views)

Hi,

 

Normal ModBus/TCP does not use the ModBus CRC. The data is transmitted without the CRC.

If the receiver is a converter from TCP to serial than that device will add the CRC

 

Kees

0 Kudos
Message 8 of 9
(1,212 Views)

Yes, Thank you .

0 Kudos
Message 9 of 9
(1,196 Views)