01-11-2011 10:33 AM
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
01-11-2011 10:36 AM
Your are getting the warning based on the mechanical operation mode of the button. You may want to check its action.
01-11-2011 12:42 PM
@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
01-11-2011 01:13 PM
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.
01-11-2011 02:08 PM
@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
01-11-2011 02:18 PM
That's why it is a good habit. 😄
01-11-2011 02:38 PM
@altenbach wrote:
That's why it is a good habit. 😄
Style And functionality- You gotta love it when they work together!
01-11-2011 03:11 PM
Do you know of any material I can read about the LabVIEW dataflow programming approach?
01-11-2011 03:15 PM
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
01-11-2011 03:27 PM
Thanks!