08-22-2018 09:10 AM
Dear Community,
I am using LabVIEW 2017 and debugging a program where communication is performed over modbus. I run the program over long periods of time. Often when checking the probe values I notice that the time stamp inside the subvis is lagging in the probe window althought the vis containing them run through instantaneously (checking the ErrorIn and ErrorOut probes outside the vi).
What is wrong?
Thanks in advance for your feedback.
08-22-2018 09:19 AM
@labviewette wrote:
Dear Community,
I am using LabVIEW 2017 and debugging a program where communication is performed over modbus. I run the program over long periods of time. Often when checking the probe values I notice that the time stamp inside the subvis is lagging in the probe window althought the vis containing them run through instantaneously (checking the ErrorIn and ErrorOut probes outside the vi).
What is wrong?
Thanks in advance for your feedback.
One thing that's wrong is that you didn't include any code for us to inspect. Code = VI + subVIs. Simplified version that still shows problem is A-OK. A picture is usually not OK. It's pretty much impossible to offer any meaningful feedback without being able to actually inspect the code, although some forum members have a Magic 8-Ball that works pretty well in some cases.
08-24-2018 02:43 AM
I hope I haven't forgotten anything.
The subvi lagging is "Modbus ACK.vi", although the containg vi "MB Ethernet Slave_Main.vi" runs through smoothly without delays.
08-24-2018 03:10 AM - edited 08-24-2018 03:11 AM
Hi labviewette,
how much "lag" do you notice?
Which "values" do you probe?
On your "Modbus ACK" VI:
- Using a FOR loop running just once is RubeGoldberg.
- Comparing boolean values to boolean constants is always RubeGoldberg!
- The whole loop construct is RubeGoldberg as LabVIEW brings a function which does the same - see image…
- Those long strings of ModBus communication can be made "more clear" using a FOR loop iterating over arrays of ModBus registers and data values…
- You don't handle all possible errors in this VI…
Can you test your VIs again after doing those modifications?
09-03-2018 04:36 AM
Thank you for your effort GerdW,
yes you are definitly right. The code is RudeGoldberg (had to first lookup that word up!). Since I didn't have the time to improve the code I took over (it is not just this vi that needs cleaning up) I decided to measure the time the subvi needed to run and found that it runs through smoothly. So although I did not find out why the probes were lagging I was able to proceed with my work.