From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-02-2010 08:21 AM
I have a boolean(show legend) that I want to be 'latch when released'. When the user clicks on the boolean, the legend will show/or disapear, the next time he clicks the boolean it will disappear/show. So it will alternate viisibility for every click.
I have attached what I feel can do the job, unfortunately, the event sturcture has more events, so when I click other events, the count(i), will also increase.
Any subtle way to achieve this goal.
Solved! Go to Solution.
09-02-2010 08:28 AM - edited 09-02-2010 08:30 AM
I would read the LegVisible property node from the XYGraph and then do a NOT operation instead of using the index.
09-02-2010 08:28 AM
Use a shift register to hold a boolean that you toogle every time that event is fired.
Yes you will have to pass the wire through all of your other frames.
Ben
09-02-2010 08:29 AM
As much as I'm unqualified to point out a Rube Goldberg.... all you really need to do is wire the output of your 'show legend' button directly into the property node that shows or hides the legend. No need to mess around with working out if the number is odd or even.
09-02-2010 08:32 AM
Norbert
09-02-2010 09:01 AM
@_Ian_ wrote:
As much as I'm unqualified to point out a Rube Goldberg.... all you really need to do is wire the output of your 'show legend' button directly into the property node that shows or hides the legend. No need to mess around with working out if the number is odd or even.
This is what I'd normally do as well using a switched boolean; however, the OP would like to use a latched boolean, so this wouldn't quite work.
09-02-2010 09:09 AM
@The J wrote:...the OP would like to use a latched boolean, so this wouldn't quite work....
Quite right - sorry, my mistake.
Must read more carefully!
09-02-2010 11:28 AM
Why must the button be a latch type? Why not a switch type with boolean text appropriate to the action. When the button is false and the legend is hidden, the OFF text can be SHOW LEGEND. When clicking on the button, it becomes true, the legend is shown, and the ON text can be HIDE LEGEND. In your code, you just wire the boolean to the property node. This is much more straight forward than forcing the action using a latch type.