From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global Variable While Loops

Hi, I'm struggling with my global variables, I have a sequenced structure to control the flow of my program, outside of this I have a while loop that runs to get the temperature and put it in a global variable. Then in my sequenced structure I have a while loop that should wurl around until its over a certain level and then end the while loop, and thus continuing to the next part of the sequence structure. You should be able to see this in the attached file, my global variable is called Temperature. Is what I'm doing correct? if not whats wrong with this? Thanks
0 Kudos
Message 1 of 3
(2,403 Views)

what you require would be some sort of synchronizing between the Data Acquisition loop and the temperature check loop. If not, there is no assuring that the global is updated and its updated value is verified in the loop inside sequence structure

Try using semaphores to sync these two loops and you will get a better result

0 Kudos
Message 2 of 3
(2,400 Views)
Also look at the Producer/Consumer state machine examples. A different way of doing what you are trying to do, one that is proven and robust.

Lynn
0 Kudos
Message 3 of 3
(2,378 Views)