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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure

Solved!
Go to solution

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.

 

 

23014i5E55F7528D4D9E9B

0 Kudos
Message 1 of 8
(3,201 Views)

I would read the LegVisible property node from the XYGraph and then do a NOT operation instead of using the index.

Message 2 of 8
(3,193 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 8
(3,192 Views)

 

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.

 

 

Message 4 of 8
(3,190 Views)
Solution
Accepted by topic author ade77

23016i529209B689F64324

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 8
(3,187 Views)

@_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.

Message 6 of 8
(3,152 Views)

 


@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!

Message 7 of 8
(3,143 Views)

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.

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 8
(3,108 Views)