From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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 do I exit the while loop with wait function?

 

Hello I am building a VI that measures temperature using a digital thermometer.

 

Temperature measurement time can be set to 1 second, 1 minute, 5 minutes or 1 hour.

However, if the interval is longer than 1 minute, the execution of the WHILE loop does not finish and the SAVE does not work.

 

Is it not possible to cause the WHILE loop to stop when the VI hits START while running?

Thank you!

 

1.JPG

 

2.JPG

0 Kudos
Message 1 of 4
(1,843 Views)

Can you please attach LabVIEW code, not a picture of the code?  [Think if I sent you a screenshot of a four-page C++ program and asked you for help -- you'd say "Send me the code!"].  Attach the VI so we can see it clearly, see all the Cases, even try to run it.

 

Bob Schor

0 Kudos
Message 2 of 4
(1,841 Views)

I have attached VI now.

 

All VIs are in Korean.


"초" means second, "분" means minutes, and "시간" means hours.

After selecting "1분 마다," press Start, then press Stop immediately.


Then click Save and you'll know what I'm talking about.

0 Kudos
Message 3 of 4
(1,826 Views)

Use a State Machine.  One of your states should be "Wait".  Use short waits (like 100ms) inside of that state and repeat the state until you reach your desired time.  And with each iteration of the loop, you can check your stop condition.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(1,823 Views)