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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger an event when running another while loop?

Dear All,
         I want to trigger an event when a while loop is running.
         I see that the event case can't be run before the while loop is stopped.
         But how to solve this problem,
        The simple version is the attached file.
        Thank you!
 
 
Hugo
0 Kudos
Message 1 of 5
(2,789 Views)
Hugo,

the issue that you are running into is desired behaviour. Please refer to this link for further information. Take a close look into the caveats please, esp. the issue "placing two event structures into one loop").
In your case, you should either put the eventstructure in an own whileloop or you should contain the algorithm from the 2nd whileloop (the one parallel to the event structure) in the timeoutcase from the eventstructure.

hope this helps,
Norbert B.

Message Edited by Norbert B on 11-20-2006 02:39 AM

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(2,778 Views)
Thank you for your reply.
Your first method can solve my actual problem,but i think the advantage of the event structure is lost.
Do you think so ?Thanks a lot~
0 Kudos
Message 3 of 5
(2,769 Views)
Hugo,

the advantage of the event structure is, that you can program very good in regard to performance and react very fast to an occurrance of a certain "signal" (event).
In the suggested usage, you will "loose" nothing, because you will create events in timeslices you defined by the timeout-time. Therefore, you will time your loop (which is very good) and can react to asynchronuous events as well. The only thing that will change is, that you maybe have different timings than before. If that doesnt suit you, you have to build two seperated while-loops.

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(2,762 Views)
Thank you.
I will try to understand it. your suggestion is very helpful for my work.
Thanks again.
 
 
 
Hugo
0 Kudos
Message 5 of 5
(2,755 Views)