08-21-2024 02:26 PM - edited 08-21-2024 02:59 PM
Hi, guys, I'm new at LV. I have an application where I have a consumer loop controlling a dyno while gathering torque & speed info in the consumer loop. I found that I ended up having to exit the consumer while loop when I need to output the torque & speed data to TDMS file. The unforeseen consequence is that I lose control of the dyno at the same time.
I have put together a generic program with random number to generate data. When I click on "Generate," I can see the array gets populated, but the program freezes up. I would like to click on "Generate," and output the data, but, at the same time, continue the consumer loop.
Solved! Go to Solution.
08-21-2024 03:49 PM
Your consumer loop stops when it dequeues generate, but the producer loop doesn't. So the outer while loop doesn't iterate because the producer loop is still executing.
08-21-2024 03:58 PM
Your "producer" loop at the top only ever terminates when you press the "stop 4" button. Because of this, the outer loop that contains almost everything can never iterate, because it only iterates when everything inside it has completed execution.
I would recommend:
Since this is just a "demo" VI, and not your real code, some of this might not apply directly to it, but you'd need to get more specific if that's the case.
Also a general note that you have 2 stacked terminals on your bottom loop, that's not a good thing: