06-02-2011 11:05 AM
Hi,
I am trying to establish a communication with my LabVIEW program and MODBUS to read the speed and torque off of a servo motor application. What is the easiest way to do this using LabVIEW? I am pretty much new to communication process/coding. Would really appreciate a few examples.
Thanks.
ksurdi
06-02-2011
11:10 AM
- last edited on
03-03-2025
11:10 AM
by
Content Cleaner
06-03-2011 09:52 AM
For Modbus examples, try checking in the LabVIEW Example Finder. In LabVIEW, click Help » Find Examples... When the Example Finder window pops up, search for "Modbus". I'd recommend taking a look at the examples called Modbus Simulator.lvproj and Modbus Fundamentals.lvproj.
06-03-2011 05:49 PM
If you use the modbus library check the comments, there's a bug (that can show up intermittently) in the MB CRC-16.vi. It's easy to fix you need to change the representation of CRC-16 from a U8 to a U16 in MB CRC-16.vi within NI-Modbus.llb. I wish NI would upload a fixed version but considering the modbus library is "not an official NI Product" and the bug is approaching 2 years old, that doesn't seem too likely.
06-04-2011 01:37 PM
That's the first I heard about a bug. Can you post a link to a thread that brings this issue up and discusses it?
06-04-2011
08:50 PM
- last edited on
03-03-2025
11:11 AM
by
Content Cleaner
The only place I know the bug being reported is in the reader comments for the download.
http://sine.ni.com/devzone/cda/epd/p/id/4756
08-12-2011 10:18 AM
Hi Rory R,
I could not find the examples.. when I type in Modbus in the 'Find examples' window in LabVIEW, nothing shows up.. can you please attach those two examples with this thread.. I would really appreciate it. Thank you.
ksurdi
08-15-2011
07:33 PM
- last edited on
03-03-2025
11:11 AM
by
Content Cleaner
Hi ksurdi,
The examples that Rory pointed you to are included in the Datalogging and Supervisory Control (DSC) Module. It is very likely that you are not able to find these examples, and likely will not be able to run them, because LabVIEW DSC is not installed on your machine.
More information and the evaluation download of DSC can be found on the NI LabVIEW Datalogging and Supervisory Control Module page.
08-16-2011 01:19 AM
Hi Ksurdi,
To work on ModBUS DSC module is not required, only you need one ModBUS library.
This is simple as a serial communication. First you have to Initialize the MB. In this you have to define the device ID, baud rate, parity, stop bit, data bit and time out settings. Second for read the register values you have to define the register range and your device identification setting. As a output you will get the register values. So you can use the register values and an output or that value holding by that register.
I have attached a sample VI for your reference. Just go through this and if some more clarification is required please let me know.
To access modBUS, one modBUS library(LabVIEW 8.6) also attached with this post copy and past this in LabVIEW user library and restart LabVIEW.
Thanks and Regards
Himanshu Goyal
03-07-2012 08:39 PM
Hi Himanshu,
I'm trying to gain knowledge of how to implement a simple MODBUS read/write VI in LabView through your post...
In your post you say: "This is simple as a serial communication. First you have to Initialize the MB. In this you have to define the device ID, baud rate, parity, stop bit..."
Where are can you set the stop bits? I have a device that uses two stop bits. I'm able to talk to it using software called "Modbus Poll" but I can't get anywhere with LabView. I noticed that in LabView the "Init MB" VI doesn't have a stop bit setting. Is there another way to handle two stop bits?
Thanks in advance,
Chris