LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Abort already running Timers in a Case?

Hey everyone 🙂

 

I am working on a small "simple" automated Plant for my Study Project with a NI myDAQ. So basically i have a manual mode and a Automatic mode.

 

Both work fine as i want, but now i have the following Problem:

I can't switch to manual mode if the Cases with the timer are already running until they're done. Both Timers are marked in the Pictures below. Is there a Option wich allows me to abort the timer when he is still in process, when I press the Button "Handbetrieb"? Or even a more simple solution ?

 

I hope you guys get what i mean, and I'm looking forward for your Answers 🙂 Have a nice Weekend!

 

Download All
0 Kudos
Message 1 of 5
(1,511 Views)

No.  You can't.

 

What you can do is turn those timers into while loops with much shorter waits and use the Elapsed Time Express VI.  Stop the loops once the time has elapsed OR when an abort condition that you are monitoring within the loop becomes true.

0 Kudos
Message 2 of 5
(1,481 Views)

Don't call them "timers", these are "waits"! As you figured out, they stall the dataflow until they are completed. Waits are only useful if they are short. Longer waits have no business in any serious program.

 

You need to turn your program into a proper state machine. One state would be one that checks elapsed time and compares it with a threshold. One simple way to do poll elapsed times can be found in this example

 

Some of the rest of your code could be simplified dramatically. For example you could use arrays of LEDs instead of all these individual LEDs and comparisons. Have a look at this example, 90% less code!. (Since you want multiple colors, you could use a cluster of LEDs and convert the array to a cluster before display. You could also use an array of colorboxes.)

 

 

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 3 of 5
(1,474 Views)

@altenbach wrote:

Since you want multiple colors, you could use a cluster of LEDs and convert the array to a cluster before display. 


Here is a simple example for that. Also used the advanced format of a simple numeric indicator. No need for strings!

 

LEDMeter.png


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 4 of 5
(1,465 Views)

Hey RavensFan and Altenbach

 

Thank you for your Replies. Perfect, i will implement your Solution in my Project, wich safes so much space 🙂 I really appreciate your help!

 

Have a nice evening

 

Greetings

0 Kudos
Message 5 of 5
(1,408 Views)