How can I use Modbus VIs in LabVIEW Real-Time Module?

Updated Aug 27, 2019

Reported In

Software

  • LabVIEW
  • LabVIEW Real-Time Module

Issue Details

I am not sure how to use Modbus VIs installed with LabVIEW Real-Time Module. 
I want to control the Modbus RTU device.  One of the commands I want to send is "010300000002C40B."
 

Solution

Applying the Modbus RTU message frame to the command of "010300000002C40B", it can be split as follows:

Code: 010300000002C40B
Address: 01
Function:  03
Data: 00000002 
CRC: C40B
 
STARTADDRESSFUNCTIONDATACRC CHECKEND
 at least 3.5 character times8 bits8 bitsn x 8 bits16 bitsat least 3.5 character times

You should consult with the device user manual how to interpret Data 00000002. Now, let's assume 0000 is the starting address and 0002 is the number of holding registers. 

According to the Modbus standard, Function "03" means  "Read Holding Registers." The corresponding LabVIEW function is "Read Holding Registers VI ".
Enter 0000 to the input terminal of "starting address" and 0002 to that of "number of holding registers" of the function.



 

 

WAS THIS ARTICLE HELPFUL?

Not Helpful