07-14-2014 06:08 AM
Is there a problem using more then a single While Loop with an internal Event structure, in a single VI?
In my VI (Attached only a partly printscreen) there is more then 2 while loops with an internal even structure which controls a different devices.
This event structures are being controled by a case structure.
From time to time the VI gets stuck and some local variables reset.
Solved! Go to Solution.
07-14-2014 06:36 AM
Hi,
Using two while loop is not a problem it depends on how you structure the code.
Generally we use two while loop structure for Producure-Consumer, Master -Slave, type of applications. Try to use state machine structure inside the while loops, please refer standard state machine examples in NI find example pallet.
07-14-2014 06:55 AM
07-14-2014 06:56 AM
Hi NivShapira,
Yes you can use two while loops in parallel.Thats how we are achieving multi-threading in LabVIEW.
But in your implementation of V I,every time both the while loops pauses at the event structure for 5 ms or any event.
Is this your expected behavior?
Regards,
SrikrishnaNF
07-14-2014 06:58 AM
Miraz,
Thank you very much for your answer (Kudos).
I will convert the code to a "standard state machine" code in order to see if it works better.
Yet, the concept of my code enables you to operate different actions from the front panel, using the proper case for the event choosen. What advantages the "standard state machine" have compared to the concept in my code?
Thank you very
07-14-2014 07:05 AM
Having no other choice, I have defined a 5milisec avoiding "never time out" of the event structure which stops the whole VI operation.
thank you very much for the comment