From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-16-2021 10:43 AM
I've encountered a situation with an embedded while loop not functioning as expected once it is placed inside an event case. The Stop and Exit buttons seem disabled. I've tried adding those buttons to the same event case; "Start", but that had no effect.
Solved! Go to Solution.
06-16-2021 10:47 AM
06-16-2021 10:53 AM
So, the while loop is there to allow an operation reading incoming data from an instrument under test.
The while loop is waiting for settling of the reading with a threshold level of standard deviation.
A timeout or user input of "Stop" are alternate ways out of this loop.
This method is not possible within an event case? Why not?
06-16-2021 10:55 AM
You have the "Lock panel until the event case completes" turned on. Which means, you press the Start button and you cannot interact with the front panel until the case is done, including the inner loop.
Generally speaking, you should not have "long" things happen inside of an Event Structure, such as loops. Use another loop or a state machine (the state machine is to include the Event Structure, not inside of the event case) to handle the reactions.
06-16-2021 10:57 AM
How do I unlock the front panel?
06-16-2021 11:03 AM
I found it, I went to "Edit Events Handled by this Case" and unchecked the "Lock panel" box.
Thank you Gerd!
06-16-2021 11:33 AM
@MikeMack747 wrote:
I found it, I went to "Edit Events Handled by this Case" and unchecked the "Lock panel" box.
Thank you Gerd!
FYI - generally speaking, a well-written LV application doesn't care if the front panel is locked or not because nothing in the event structure will take so long that locking the front panel matters.
06-16-2021 11:56 AM
I agree, this event should trigger and data producing, and a consuming loop operating in parallel to the event.
This is not my code, it came from my coworker who now shall lose a bet 🤑