10-13-2016 01:52 PM
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.
10-13-2016 03:29 PM
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).
10-13-2016 03:35 PM
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.
10-13-2016 03:38 PM
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.
10-13-2016 06:58 PM
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.
10-14-2016 09:20 PM
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?
10-15-2016 02:24 AM