LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control event structure with command

Hello to all...
 
Is there a way that I can trigger an event within an event structure with the use of a command?
 
Thanx N Advance!
FredTest
0 Kudos
Message 1 of 8
(3,590 Views)
What do you mean by "command"?  A button press?  A word typed in a string control?  Something else?
Message 2 of 8
(3,588 Views)

There are 3 ways to trigger an event:

1.  A UI triggered event, when the user does something on the front panel (such as click, move mouse, etc.)

2.  A dynamic event, which is generated programmatically.  You need to register events before you can do this.

3.  If your code writes something to the Value (signalling) property of a control/indicator, the event structure behaves as though case 1. occurred.

 

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
Message 4 of 8
(3,572 Views)

SG (Thanks for the reply)

3.  If your code writes something to the Value (signalling) property of a control/indicator, the event structure behaves as though case 1. occurred.

 
I have already tried doing #3  as you have mentioned and there is no way that the program will jump into that event. It sets the values but doesn't trigger the event to turn on the LEDS. See attached vi.
 
 
ThanksNAdvance
 
FredTest
 
 
0 Kudos
Message 5 of 8
(3,562 Views)
I answered my own question...due to the fact that there was no timeout value tied to the event structure the next event couldn't start. Thank you all for your help.
0 Kudos
Message 6 of 8
(3,557 Views)
Yes, it's important to consider that timeout node.  🙂
0 Kudos
Message 7 of 8
(3,553 Views)
FredFred,

Event structures are almost always used inside a while loop. If no event occurs, the loop does not iterate. The timeout case is not required and can be omitted if you do not need it.

The other issue is dataflow. The controls will most likely be read before the event structure is called and the VI will not do anything until one of the event cases executes. Both cases work, but one one per execution of the VI.

Look at the help for the event structure.

Lynn
0 Kudos
Message 8 of 8
(3,549 Views)