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: 

What to use event structure or sequence structure?

I know it is almost taboo to mention let alone use sequence structures in labview. However I'm faced with a predicament where I believe it could be used appropriately.

 

I have a VI that I built using Labile 9 that communicates using a serial port and must go through 4 sequential values of "Power Levels" at certain time increments (in minutes).

 

100%, then 80%, then 60% and finally switching "off" at 0%.

 

I want to control for the times that each case is executed. For example 100% for 20 minutes followed by 80% for 20 minutes followed by 60% for 20 minutes and finally 0% for 5 minutes.

 

What should I do here?

 

Any suggestions would be extremely appreciated. Perhaps an example VI would be most helpful.

 

Thanks in advance

 

mhaque

0 Kudos
Message 1 of 3
(1,973 Views)

No one said you cant use sequence structures, its just that they are often misused when users misunderstand the concept of dataflow.

You could use a sequence structure, but I would recommend in your case a State Machine.

Search the forums for that term, there are a ton of examples.

Cory K
0 Kudos
Message 2 of 3
(1,969 Views)

The native timing functions that don't have an error in/out to 'sequence' them using data-flow are one of the situations where a sequence structure is useful. However, I recommend using the OpenG timing funtions that have an error in/out and sequence them using the error wire.

 

The big advantage is in the case of an error, they don't wait so your program finishes and displays the error message immediatly, instead of you waiting for 1 hour and then just recieving an error indicating that your device wasn't powered on or the communication cable wasn't plugged in...

 

A second scenario you might want to consider is the user wanting to abort the test. Maybe something was wrong or another device has a higher priority. So be so gentle and supply them an abort button and not have them resort to using the ÖV Abort or windows task manager for this (which also gives your software the time to shut down the power supply).

You will notice that the OpenG Wait gives you an optional input for this (occurance).

 

Felix

Message 3 of 3
(1,954 Views)