LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scheduling tasks

Hi all,

I have a set of radio buttons namely "charge,Discharge and wait". Each button perfoms a task and after the task of charge or discharge is complete it moves to "wait". Now, i would like to know how to schedule these tasks in advance. for example, i want to run a cycle which does "Charge>Charged>wait for 5 mins>discharge>discharged" and repeat this cycle n times.

Any help will be greatly appreciated.

Thanks & Regards,

Parth

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

Any code that you upload will be greatly appreciated.  Then we can begin to help you.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 5
(2,687 Views)

 


"Charge>Charged>wait for 5 mins>discharge>discharged" and repeat this cycle n times.

 

 

This screams "State Machine". 

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(2,684 Views)

Hi,

i created a small example to show my problem. now what i want is a window where i can assign a cycle of tasks and when i run the vi it keeps repeating them for previously declared times.

hope this makes more sense

thanks.

0 Kudos
Message 4 of 5
(2,674 Views)

Hello hbeelan,

 

I would recommend using a state machine design pattern for this application. There are plenty of resources online explaining state machines if you are unfamiliar with them.  This architecture is pretty similar to the code you provided.

 

It sounds like you want the user to configure which states run. You could have an array of enumerators on the front panel representing the states and their order. Then you would feed this array into the state machine. The while loop would index out each state from the array and the case structure would execute that state.

 

Once you get that working, you could get fancy and have a configuration menu on a subVI front panel. The configuration menu could appear when the VI first starts or when the user clicks a button. Then you could send the information from subVI to main VI using Functional Global Variables (FGVs) or some other data transfer mechanism.

0 Kudos
Message 5 of 5
(2,651 Views)