キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/4
3,580件の閲覧回数
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 件の賞賛
メッセージ2/4
3,576件の閲覧回数

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 件の賞賛
メッセージ3/4
3,569件の閲覧回数
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 件の賞賛
メッセージ4/4
3,551件の閲覧回数