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: 

Switch Power Levels at certain time Increments

Hello fellow LabVIEw users

 

Please look at attached code. I have used an event structure to communicate with our electronic apparatus.

 

The "manual" part of the code has been done. The code is very simple. When I press "Ballast ON" a hex code is sent to the VISA write with the corresponding "Power Level %". When I press "Ballast OFF" the power to 0% and the whole program stops.

 

The "Automatic" part of the code will send the exact same codes as the manual part but it should do it automatically in certain time increments.

I want to do the following

  1. When I press "Start" I want the hex code to execute as per "TIme in minutes" going from values of 100% to 80% to 60% and finally to 0% (not shown) and shutting down the program thereof.
  2. I want the "time left" to be a countdown of the "time in minutes" in hours, min and seconds.
  3. When the user clicks on the "default" boolean I want the "time in minutes" to automatically go to 30 mins for 100% power, 15 mins for 80% power and 15 mins for 60% power.
  4. Time to finish indicator should show when the test is going to end at the time of the day.

Your help and guidance is much appreciated.

 

thank you

 

mhaque

0 Kudos
Message 1 of 2
(1,902 Views)

It sounds to me like what you want to do would be best suited for a state machine. 

 

The initial state could be the manual state, then once you select automatic it would cylce through your states.  Then if you press stop during any of the states it would return to the manual mode.  

You can get the state machine template open by going to File >  New > Vi > From Template > Frameworks > Design Patterns > Standard State Machine

 

state machine example.png

National Instruments
FlexRIO & R-Series Product Support Engineer
0 Kudos
Message 2 of 2
(1,878 Views)