LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I use an Event Structure to detect a button push.

I've done this a couple of ways.  First, I place the button icon inside the Event Structure (in the appropriate case) and read it directly.  The other way, I use the "New Value" property(?) of the Event Structure.  I still place the button icon inside the Event Structure, but it is not connected to anything.  The latter way produces a warning.

 

Is there any different between the two approaches?

 

DH

0 Kudos
Message 1 of 10
(4,347 Views)

Your are getting the warning based on the mechanical operation mode of the button. You may want to check its action.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 10
(4,346 Views)

 


@Dark Hollow wrote:

I've done this a couple of ways.  First, I place the button icon inside the Event Structure (in the appropriate case) and read it directly.  Ok no problem

 

The other way, I use the "New Value" property(?) of the Event Structure.  I still place the button icon inside the Event Structure, but it is not connected to anything.  The latter way produces a warning.  You get the warning that the terminal is not connected to anything because - its not connected to anything.   This really is not an issue OTHER than LabVIEW is a dataflow language, Event structures break dataflow, be warned.

 

Is there any different between the two approaches?  Either approach is valid

 

Nice question

 

DH


 


"Should be" isn't "Is" -Jay
Message 3 of 10
(4,318 Views)

To add to Jeff's answer, here are some general additional comments:

 

It is not necessary to place the terminal inside it's event case, unless the boolean is latch action. Still it is often a good habit to place controls inside their event to keep the diagram logically organized.

 

If the control is inside the case, you might as well read it directly. It also keeps the code more expandable, for example if you later add a numeric valaue change event to the same event case, the event terminal is no longer easily possible anyway. 

 

 

Message 4 of 10
(4,308 Views)

@altenbach wrote:

To add to Jeff's answer, here are some general additional comments:

 

It is not necessary to place the terminal inside it's event case, unless the boolean is latch action. Still it is often a good habit to place controls inside their event to keep the diagram logically organized.

 

If the control is inside the case, you might as well read it directly. It also keeps the code more expandable, for example if you later add a numeric valaue change event to the same event case, the event terminal is no longer easily possible anyway. 

 

 


 

If I have an event in the diagram for a control, I will put the control in that event so that a double-click on the control shows you the associated event. Finding an event for the control otherwise means I have to go looking if there is an event for that control.

 

The double-click answer both Qs.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 10
(4,293 Views)

That's why it is a good habit. 😄

0 Kudos
Message 6 of 10
(4,283 Views)

 


@altenbach wrote:

That's why it is a good habit. 😄


Style And functionality-  You gotta love it when they work together!

 


"Should be" isn't "Is" -Jay
Message 7 of 10
(4,267 Views)

Do you know of any material I can read about the LabVIEW dataflow programming approach?

0 Kudos
Message 8 of 10
(4,249 Views)

There are lots of good tutorials right here on the ni site. Here is one to start with.

 

http://www.ni.com/gettingstarted/labviewbasics/dataflow.htm

 

=====================
LabVIEW 2012


Message 9 of 10
(4,241 Views)

Thanks!

0 Kudos
Message 10 of 10
(4,229 Views)