LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Better Understanding Modbus

I am working on a project where I would need Modbus to communicate with a PLC, a VFD and an ac induction servo motor and have it run through labview (VFD will drive the motor, PLC will provide feedback). I am new to Modbus, and I am currently waiting on the PLC and VFD to arrive, so I was wondering how I could go about creating a program that will get the motor operating for labview to run when the PLC and VDF arrive.

0 Kudos
Message 1 of 7
(3,741 Views)

Start reading the manuals of your Modbus hardware to learn what its specific commands are.  Then get the NI Modbus Library to handle the actual communication protocol.  It's available in the JKI VI Package Manager (VIPM).  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 2 of 7
(3,704 Views)

Check here for documents and specifications on how modbus works. The Modbus Organization

 

I have used this library quite a bit for Modbus communication. MODBUS Library for LabVIEW  It is a bit older, but still works.

A newer library is available here.  https://decibel.ni.com/content/docs/DOC-30140

 

If you have the DSC module, then you can set up modbus libraries in your project where you give the address and register parameters for the device you are communicating with, and can access those values like they are network shared variables in your project.

0 Kudos
Message 3 of 7
(3,702 Views)

MODbus itself is pretty straight forward. It is a method to directly read or write to the registers of a device. Often the hardest part of using it is determining what you want to write to which registers. Once you have that figured out you just need to go through the correct protocols.

I've usually used this site to go through the determination of the proper syntax. Mostly straight forward conversion of numbers to hex format, other then that determining the correct CRC format.

 

In terms of getting the motor started, it might be useful to see if you can get it running using the MODbus commands through just a serial command window first. Once you have the commands down you can move onto building a simple VI that will send the commands on a button press from you.

0 Kudos
Message 4 of 7
(3,700 Views)

One thing that I didn't see mentioned yet was that the LabVIEW APIs linked should let you create a Modbus master as well as a slave. If you have the device manual you can probably create a slave which has the same coils/registers that you want to talk to which may make it easier to transition to the real hardware later on.

Matt J | National Instruments | CLA
Message 5 of 7
(3,685 Views)

I currently have the student edition on my laptop, which I don't think comes with the DSC modules, but the computers in one of my school's engineering labs does. Would that necessarily be a problem if I were to try and create some sort of prelimary modbus program on my laptop?

0 Kudos
Message 6 of 7
(3,641 Views)
Hi , No need to install DSC modules simply you can download modbus library or If you need DSC module you can download an evaluation version check this link http://www.ni.com/example/29756/en/ Ni modbus library http://www.ni.com/gate/gb/GB_EVALTLKTINDCTRL/US DSC evaluation
Venugopal
0 Kudos
Message 7 of 7
(3,634 Views)