LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure Basics

Creating multiple event specifiers is an OR (if 1, 2, OR 3). Is there a way to make an AND?

 

****************************************************************************************************************************************************

using a boolean button value change, if the mechanical action is latch, it only executes the event once even though the button goes high, then low (2 value changes), whereas if the mechnical action is switch (even switch until released) it executes the even on every value change (can be seen in attached vi - increment only 1 per latched button push). Why is this?

 

****************************************************************************************************************************************************

 

all events are supposed to be captured and queued into a FIFO

my program increments Numeric when Do some work? is pressed and should turn on the Boolean 2 indicator the first time Numeric changes value but never does. Why is this?

cwhw112_3-1729820601820.png

 

 

 

cwhw112_0-1729820500226.png

cwhw112_2-1729820535452.png

 

 

 

cwhw112_1-1729820518178.png

 

0 Kudos
Message 1 of 12
(323 Views)

Events are for controls and your change in the numeric will not trigger any events. (you can write to a signaling property to fire an event, but that should be rare).

 

0 Kudos
Message 2 of 12
(319 Views)

I changed it to a control but the light only comes on if I manually change it with the up arrow on the front panel.

if i press the do some work button, it changes but doesnt turn on the light.

is that correct functionality?

0 Kudos
Message 3 of 12
(309 Views)

(so you dont have to download/open the attachment to see)

cwhw112_0-1729821930637.png

 

0 Kudos
Message 4 of 12
(308 Views)

Also:

 

Why do you have a timeout event if it is not used?

Why is there no event for the stop button?

What ensures that your boolean is false when the program starts?

Counting is typically done with integers.

 

See if the attached can give you some ideas.

 

altenbach_0-1729821974856.png

 

0 Kudos
Message 5 of 12
(306 Views)

@cwhw112 wrote:

I changed it to a control but the light only comes on if I manually change it with the up arrow on the front panel.

if i press the do some work button, it changes but doesnt turn on the light.

is that correct functionality?


 

Don't go even deeper into the swamp!!

 

Writing to a local variable or value property node of a control does NOT fire a value change event for good reason. (There is a "value(sgnl)" property that would, but I recommend to stay away from it at your stage of learning). You need to simplify, not further complicate!

 

 

0 Kudos
Message 6 of 12
(301 Views)

I put a 5 second wait in the do some work event

2 odd things happen

1-the latch mechanical operation seems to have changed to a switch when pressed even though it still shows latch

2-i can push the up arrow of numeric (immediately after / before 5 seconds) and the light comes on (after 5 sec has expired), so the "Lock panel" function i thought wouldnt register the up arrow since the panel was "locked"

0 Kudos
Message 7 of 12
(296 Views)

A latch action boolean resets to the default state (typically false) when its nondefault value (typically TRUE) is read by the code. Your terminal is outside the loop and will thus only get read once at program start and never again.

 

Think dataflow!

 

Have you looked at my example. My terminal is inside the respect event case where it belongs (It does not even need to be wired to anything)

0 Kudos
Message 8 of 12
(289 Views)

your reply is showing me how to accomplish what seems to be my desired effect.

problem is I dont have a problem to solve.

I am just learning so I am poking around with ideas - what if I do this, then what happens, or if I try this then why doesnt it perform like I expect. 

i may be prematurely trying to learn all the ins and outs of this new event structure tool i just found with impractical scenerios (drowning myself in my own swamp)

may be best for me just to accept only the functionality they have taught so far and continue with my learning to see where it goes (maybe my questions will be answered or maybe i will learn they were not good/pracitcal questions)

 

0 Kudos
Message 9 of 12
(287 Views)

thanks for pointing that out. i moved it inside and its mechanical action is back intact.

i guess im not clear on what the "lock panel" does. seems like it locks the view but still allows button pushes

0 Kudos
Message 10 of 12
(278 Views)