LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean control in array of cluster does not bound back

Solved!
Go to solution
  • "Switch until release" will give you two events, one on press and another event on release. Make sure this is handled correctly. The "changed?" code in the FOR loop will also be TRUE on release of the button.
  • Instead of that deep case structure with a string in every case (presumably), I would use the search index to index into an array of strings (given in a string array diagram constant). It is much less tedious than having to flip through N cases. If there is a -1 case, you could do a +1 on the search index and arrange the strings accordingly.
  • It seems your yellow VI in the lower loop does not like DBL. Maybe you should change the value of the control in the cluster to the correct datatype from the beginning.
  • Not sure why you even use a variant. The queue type could just contain a string and the cluster type, but maybe you use other types in other events. Again, it is really hard to say much by looking at a flat picture.
Message 11 of 13
(808 Views)

What I would do is make all the Booleans in the cluster set to "switch when released", in the cluster value changed event, compare new value to old, figure out which button was pressed - you'll have to do this anyway - and set that button back to FALSE.

 

EDIT: By comparing the two clusters directly with an Equals function, you'll get a cluster of Booleans with the same structure that indicates whether or not that particular object in the cluster had changed.

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 12 of 13
(804 Views)

@RavenFans: Thank you for warning me. You are correct, I should not use it.

@Altenbach: Thank you for your help again. What you said is correct.

  • I cannot use index array because I have to reinitialize to default value for the boolean control again. Look like that the only option for me.
  • The input of yellow VI use the enum. That's the reason I convert variance to enum originally .
  • You are correct, I use the variant  for message data. In some case, I don't pass the cluster.

@Bill: Using reinitialize to default value is less complicated for me. But thank you very much for clarifying what I have to do.

0 Kudos
Message 13 of 13
(795 Views)