Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

CAn any one tell me how to use RS485 modbus communication to communicate with power meter & PC

CAn any one tell me how to use RS485 modbus communication to communicate between Rishab

power meter & PC

0 Kudos
Message 1 of 6
(4,281 Views)

Dear Kamaljit,

 

You will have to use VISA to communicate between the two devices using RS485 modbus communication.

You can find various examples about the same in the NI example finder. You can also go to www.ni.com/code and search for various examples about the same.

 

Regards,

Hardik

0 Kudos
Message 2 of 6
(4,251 Views)

Kamaljit,

 

NI has a downloadable ModBUS library at https://forums.ni.com/t5/Reference-Design-Content/LabVIEW-Modbus-API/ta-p/3524019

 

This is basically a wrapper for the VISA commands that  Hardik mentioned.  Support for this operation is limited...as we provide the tools and it is up to you to develop the low level functions that this enables.

 

An easier method would be to use the ModBUS IO server provided with LabVIEW DSC Module.  This is a much easier to implement method than the low level calls, as we have developed a high-level interface using shared variables to communicate with both serial and ethernet modbus devices.  You will need the LabVIEW Datalogging and Supervisory Control module to use this method, however.

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 3 of 6
(4,235 Views)

I have used the NI Modbus library on several occasions and have had problems with it not generating properly formatted Modbus messages.  But replacing it with VISA serial writes/reads is straightforward.  One utility that I feel is indespensible is Simply Modbus. I use this tool to make sure that all the serial parameters are correct, the RS232 to RS485 converter is properly configured and the wiring is correct. This tool also shows you the ASCII string that is being sent so you can verify your code quickly.

 

If you have any issues getting it working, please give me a shout and I'll help you out.

 

Matt

0 Kudos
Message 4 of 6
(4,195 Views)

Per my earlier mention of issues with the Modbus library, these problems may have been fixed in the latest version (1.2).  Will try it out to see.


Matt

0 Kudos
Message 5 of 6
(4,194 Views)

One thing to remember if trying to read floating point values, double word,... The modbus commands read byte values. It is up to the labview program to properly format the data after it isreceived.

0 Kudos
Message 6 of 6
(4,097 Views)