LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initial Event Case

I am using an event structure to handle all my front panel controls.  I would like to have an INIT event case which will initialize all the front panel controls to a specific state.  I can't find an event to trigger on.  There are events for close, but I am surprised to not see a "start event".  Any suggestions on how to create a "start event".  Thanks in advance.
 
Jim@BMC
0 Kudos
Message 1 of 4
(3,370 Views)
One common way to do this is to have your Timeout event case do the initialization. What you do is set the initial timeout to be zero, so that it fires immediately when the event structure becomes active. Then set every subsequent timeout value to -1, so you don't run the init code again. This is just one suggestion.




Message Edited by Jarrod S. on 04-20-2008 11:31 PM
Jarrod S.
National Instruments
0 Kudos
Message 2 of 4
(3,366 Views)

Use time out event with shift register.Initialize the shift register with some time delay and give -1 in the next state.

See attachment

-Kumar.B

0 Kudos
Message 3 of 4
(3,359 Views)
The best solution depends a little bit od the details if your program.
  • If the initialization should set the controls to a defined state only at the start of the program, the initialization does not belong inside the loop, but should happen before the loop.
  • If initial calculations should run so the indicators are also updated from calculations with the new control values, you could use the timeout case solution mentioned above. It is somewhat limited, because the timeout case might be needed for other stuff and you might actually want to fire other cases (see below).
  • Sometimes you actually want to run a specific, non-timeout case. In this case you could fire some events via a signaling value property, you could even line up several of those to execute several event cases in a specific order at first run. (see e.g. the image below). You can the use the same event to reinitialze things at any later time if needed.



Message Edited by altenbach on 04-20-2008 11:37 PM
0 Kudos
Message 4 of 4
(3,341 Views)