I'm working on a project that involves using LabVIEW 2018, NXG 4.0 Web Module, and the SystemLink Cloud Server. The Web Module side of things is working fine but I'm having a hard time with my LabVIEW VI loop iteration. As an overview, I'm trying to use the Web Module to remotely test from a different computer that is running the VI on LabVIEW 2018. I'm using the tags to communicate back and forth between LabVIEW, the server, and the Web Module.
Unfortunately, I have to run two data acq systems since I don't have a pressure module on my NI 9174. Here's the hardware I got.
DATAQ 718B with TC, current, and pressure modules.
NI 9174 with NI 9263 and 9201 modules.
I'm not too experienced with LabVIEW especially with communicating between a server and NXG. My loop speed wants to remain around 400ms. If I lower the wait constant any lower it really starts to bounce out of control.
I know there's alot more experienced ppl out there who may be able to look at my code and see exactly where I'm having slowdowns. I've tried timed loops, reducing sub vi (as much as I can), and different overall configurations. I'm currently trying to utilize the producer/consumer architecture since that seems to be the most beneficial structure for loop speed. I'm sure the two data acquisition systems are not helping as well as potentially my computer specs. Right now I have 16 GB RAM and a i7-6650U CPU @ 2.2 GHz (4 CPUs).
Any recommendations to speed up the loop time would be greatly appreciated.
Solved! Go to Solution.
Sorry, I cannot really troubleshoot, because I don't have your hardware, but there are some glaring dataflow problems, for example the following is a typical beginner mistake:
The lower while loop cannot start until the upper while loop has completed, at which point the boolean is guaranteed to be true and the lower loop will stop after one iteration (the lower loop basically acts as a glorified sequence structure)
This also means that your queue will grow forever because nothing will ever get dequeued as long as the upper loop runs.
Then you have silly NOOPs such as the two circled fragments. If you would delete the select nodes, nothing would change! (that's just the tip of the iceberg). (See also)
Thanks for your reply. I adjusted my vi on your recommendations. That redundancy is quite obvious once pointed out. I also made adjustments to how much data I was writing. Anything that I could code on my web module side I did. All this greatly helped my speed and maybe I'm expecting too much for a web module. I also have some hardware troubleshooting to do that seems to be slowing my loops down but that'll have to come at another time.