LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Values out of loop and avoid race condition

Dear All,

 

I am using a while loop to fetch some values from devices and log these values. I want to use these values in another while loop (inside which is a state machine- for different states). one possible thing is to double demand of these values from devices in 2nd while loop, but it also create errors and cause values to be mismatch sometimes. Using global variable for these values also results in a race condition (As for one device, get temperature value and set temperature value distinguish by one string command). I also wanted to avoid any race condition.

I have marked the values which i needed for further use. Kindly help in this case.

2.JPG

1.JPG

Khan.

Download All
0 Kudos
Message 1 of 3
(2,404 Views)

That is THE use-case for producer/consumer VI architecture.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3
(2,394 Views)

Queue, Notifier, User Event...All of these are good options depending on your exact requirements.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(2,387 Views)