LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recommended way to reset boolean latch cluster in a event structure

Hello,

 

I have a cluster with booleans and an Event Structure

These booleans have the mechanical action "Latch when released"

 

When adding a value change event, the following message is displayed: "Handling a Value Changed event on a Latched Boolean will not automatically trigger its mechanical action. You must read the Boolean's Terminal in order for it to correctly reset"

 

My doubt: Is there any recommended way to reset the state of these booleans?

 

Example: The attached vi have five booleans and one Event Structure

 

  • Boolean 1: value change resets the latch boolean because I have the Terminal inside the event
  • Boolean 2: latch don't reset
  • Boolean 3: reset using the invoke node "Reinit To Default" 
  • Boolean 4: latch don't reset
  • Boolean 5: latch don't reset
0 Kudos
Message 1 of 8
(2,127 Views)

You could set the mechanical property as switch when released instead, and set the value back to false in the associated event.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 8
(2,115 Views)

Instead of one case per control, make one case for the whole cluster. If you register for them dynamically you can then get the CtlRef of the specific one that changed and act accordingly. See this thread:

 

https://forums.ni.com/t5/LabVIEW/How-to-obtain-which-element-changed-in-a-clusters-using-events/m-p/...

 

 

Message 3 of 8
(2,085 Views)

Try this

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 8
(2,046 Views)

@billko
Set back the value using the Invoke Node "Reinit to Default", a "Local Variable" or the Property Node "Value"?

 

 

@BertMcMahan
I need to compare the Property "Label.Text" with the Boolean's name?
And if the boolean label changes, then I have to manually change the name of string in the comparator? Isn't this method too risky?

Boolean cluster (user event).png

 

@paul_cardinale
I think your method works only if all elements in the cluster are booleans, right?

What would you do if the cluster have multiple data type?

0 Kudos
Message 5 of 8
(2,018 Views)

@paul_cardinale
I think your method works only if all elements in the cluster are booleans, right?

What would you do if the cluster have multiple data type?


Works fine.  Try it.

"If you weren't supposed to push it, it wouldn't be a button."
Message 6 of 8
(2,016 Views)

@mthheitor wrote:

 

@BertMcMahan
I need to compare the Property "Label.Text" with the Boolean's name?
And if the boolean label changes, then I have to manually change the name of string in the comparator? Isn't this method too risky?

Boolean cluster (user event).png


You can compare the label text or you could just create refnums for each element individually and compare the CtlRef from the event node with the refnum constants for each element. You'd end up with something similar to Paul's solution where you are searching an array. It just depends on whatever fits your needs the best.

Message 7 of 8
(1,970 Views)

@mthheitor wrote:

When adding a value change event, the following message is displayed: "Handling a Value Changed event on a Latched Boolean will not automatically trigger its mechanical action. You must read the Boolean's Terminal in order for it to correctly reset"


Make sure you read the control, just like it says. E.g. place the control inside the Value change event, then it'll bounce back after being read.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 8
(1,951 Views)