From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-16-2015 02:36 PM
Daniel,
Thanks for all the hard work on this. I finally had time to implement this for my slave side functions, I was using the IOServer. The results went quite smoothly with a not earth shattering reduction in CPU total utilization of about 10-5% (I think you mentioned this way back in the thread). But I also gained a big boost in flexibility.
I have not yet converted my master stuff from the old library. If it aint broke... etc.
again, thanks much.
07-16-2015 05:38 PM
Glad to hear everything is working well for you. Yeah, you definitely won't see a huge benefit on the slave side for serial, but the tcp version will have much better latency than the I/O server...I've seen it drop from ~20 ms per request to <1 ms.
08-14-2015 07:13 PM
Hey guys!
Thanks for this wonderful library!
I'm testing it out on the Modbus Simulator provided by NI. I'm a bit confused on how to read 32 bit floating point numbers.
1) When I read the holding registers it appears as if I'm getting a rounded number of the Analog Input I'm trying to read. The first analog input register is at 0 (the actual value is 49.3), and it returns 49 in the first element of the array. I also looked through this thread and tried to use the join numbers VI and swap the bytes, but I can't get the 49.3.
2) Looking through this thread, I've tried to use the VI - Read Input Registers, but I don't get any values through it
I'd appreciate if someone could test this out and get back to me...thanks!
08-17-2015 11:07 AM
Is it safe to assume you're talking about the demo box?
http://digital.ni.com/public.nsf/allkb/A9C037C838B203FA86256A180078BE15
If so (2) is because I don't think the demo box supports input registers, just holding registers and coils.
For (1), thats going to depend on the device. I've never used the demo box. Typically I've seen it one of two ways:
-Values are encoded as a single-precision float across two registers
-Values are truncated and then manipulated into integer form. For example you might see 49.3249 converted into 4932. Since this is just a demo box I'm guessing its truncating it to 49.
In either case I wouldn't worry about what the simulator does too much because its going to change. Every modbus device is a little bit different.
08-17-2015 11:17 AM
Hey smithd!
No that's a hardware component I believe. If you go into LabVIEW -> Find Examples -> Modbus Simulator it's present in software.
But yes I understand what your saying completely...it's best to try it on the device. I'll give it a go!
Thanks, Shivam
Date: Mon, 17 Aug 2015 11:07:32 -0500
From: web.community@ni.com
To: saxenashivam@hotmail.com
Subject: - Re: NI LabVIEW Modbus API Discussion
Community
Re: NI LabVIEW Modbus API Discussion
created by smithd in NI Labs - View the full discussion
Is it safe to assume you're talking about the demo box?
http://digital.ni.com/public.nsf/allkb/A9C037C838B203FA86256A180078BE15
If so (2) is because I don't think the demo box supports input registers, just holding registers and coils.
For (1), thats going to depend on the device. I've never used the demo box. Typically I've seen it one of two ways:
-Values are encoded as a single-precision float across two registers
-Values are truncated and then manipulated into integer form. For example you might see 49.3249 converted into 4932. Since this is just a demo box I'm guessing its truncating it to 49.
In either case I wouldn't worry about what the simulator does too much because its going to change. Every modbus device is a little bit different.
Reply to this message by replying to this email -or- go to the message on Community
Start a new discussion in NI Labs by email or at Community
08-17-2015 11:27 AM
ah ok, I don't seem to have that example but yeah, you're better off talking to your hw directly.
09-10-2015 04:46 AM
Hi Smithd, Hi everybody (sorry for my English)
First, thanks for all your work for this API.
I have used it successfully to create a Modbus RTU Master or Modbus IP Master or Modus IP Master with a gateway (with unit ID).
My new goal is to create a Modbus RTU over TCP master : an RTU protocol but an TCP transport.
My question is : if I modify an Instance of the Modbus Master RTU (Create RTU Master.vi) with the TCP network protocol to replace the Serial transport, will this work to communicate with my slave device?
I can't debug my code, because I’m waiting to have my device in few weeks.
Many Thanks
Luc
Luc Desruelle | Mon profil | Mon blog LabVIEW | Auteur livre LabVIEW : Programmation et applications - G Web
Certified LabVIEW Architect (CLA) & Certified TestStand Developper (CTD) | LabVIEW Champion
MESULOG - LinkedIn site | NERYS - NERYS Group
| directeur CEO MESULOG
| CODIR - NERYS group
09-10-2015 11:02 AM
It should do. I believe I tested it with the API talking to itself and it worked, so that might be something for you to verify. However, like you I never had the chance to test with a real device.
You may find it to have more timeouts than you are expecting, as RTU is not a very good protocol design. Basically it looks for a pause in data and that is the end of the packet. Because this is nonsensical over TCP, if you run RTU over TCP it looks for a CRC match in the incoming data. This is technically unreliable, as there may be other points within the stream where the CRC check is valid. If you encounter a timeout, I'd recommend just retrying.
09-10-2015 02:42 PM
thank you for the answer. I will test when I have the device.
I will keep you informed. Thank you a lot.
Luc
Luc Desruelle | Mon profil | Mon blog LabVIEW | Auteur livre LabVIEW : Programmation et applications - G Web
Certified LabVIEW Architect (CLA) & Certified TestStand Developper (CTD) | LabVIEW Champion
MESULOG - LinkedIn site | NERYS - NERYS Group
| directeur CEO MESULOG
| CODIR - NERYS group
09-14-2015 10:11 AM
Finally I found a “Modbus RTU over tcp” device.
So I have tested the code...... and.... It works!!
It’s really a great API.
A+ luc Desruelle (MESULOG)
Luc Desruelle | Mon profil | Mon blog LabVIEW | Auteur livre LabVIEW : Programmation et applications - G Web
Certified LabVIEW Architect (CLA) & Certified TestStand Developper (CTD) | LabVIEW Champion
MESULOG - LinkedIn site | NERYS - NERYS Group
| directeur CEO MESULOG
| CODIR - NERYS group