06-12-2014 03:47 PM
A time loop does one processes at a time. While a while loop do more than one process simultaneously (depending on if machine has multiple core processor)?
Would it be possible to put a time loop inside a while loop on RT machine (specifically NI cRio-9076)? I want to do a state machine with event based timing (see attachment) or state with periodic timing (see attachment).
The state that contains the time loop will be used to acquire data. Thus it will be deterministic.
Can someone tell me if this is doable?
-Would I have to change the priority on the while loop to 100?
Thanks alot.
*Also i am using the RIO Scan Interface
06-13-2014 01:19 PM
Hi sticyfinger
I might recommend you to have the acquisition loop separated from the event based timing, using for example a producer/consumer structure. In this case the producer could manage the events and the second loop a timed loop.
Timed Loop - LabVIEW 2012 Help
Application Design Patterns: Producer/Consumer
Keep in mind that if we are communicating a deterministic loop with a non deterministic loop we might have to use a RT FIFO instead of a queue and that we might need to set a timed out to dequeue elements from the RT FIFO.
It is not recommended to use nested while loops or timed loops
Regards
Esteban Rivel