LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure to detect value change of a control within a cluster in an array

I have 1D array that contains a cluster. The cluster contains a numeric and a boolean control.

If the user starts to edit the numeric control value i would like to call one subVI, and if the boolean control value is changed, call a different subVI.

The array control on the front panel allows the user to edit a number of the array elements. 

 

I would like to use an event structure to detect a value change in the cluster. When editing the Events, in the Event Sources panel i get the option to select only the array, not the cluster within the array or the controls within the cluster. Can the Event structure be opened up to show controls within clusters and arrays?

 

The solution i am using is to detect a mouse up event on the array and then use property nodes to  determine if the key focus is on the numeric, and  a case structure to determine which subVI to call. This works, but is there a better (simpler) way?

 

Thanks, Blue.

 

 

0 Kudos
Message 1 of 8
(8,988 Views)

You could decouple the array data from the user interaction by making a douplicate control to match the cluster type in the array and add an index control.  when the index is changed show the user the value of the arrays index in the cluster control and when the user changes the cluster the event would update the array behind the scenes.  This is just one possibility.

  

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 8
(8,974 Views)

You could compare the cluster old value to the new value and use a loop to index out the array elements for comparison to find the element that has changed.

 

 

 

The attached example is in 8.5.1 so I am using the conditional abort functionality of the for-loop. Its not available in earlier versions.

 

David

Message Edited by David Crawford on 01-14-2009 06:37 PM
Message 3 of 8
(8,943 Views)

Here's another simple possibility (assuming the outer array size is constant):

 

 

 

Message Edited by altenbach on 01-14-2009 11:42 AM
Message 4 of 8
(8,931 Views)
(Sorry, I misread that the cluster elements of the array contain a boolean and an numeric array. Seems you have a boolean and a numeric, even simpler. My solution above is still good, just the labeling is different. ;))
0 Kudos
Message 5 of 8
(8,926 Views)

Thanks for the responses guys.

The tricky bit was that i wanted the numeric control values to flag they were going to be edited, so i could call a subVI, before their values were changed by the user. This is done by using the key focus property node, - i need to detect changes on the fly rather than post the event.  Probably didn't make this clear enough in my original post.Smiley Surprised 

 

The array is of variable size depending on if the user decides to insert or delete elements. The user also has the option to click and edit the array without having to do to much scrolling through the array index, as the FP shows several elements at a time. The Event Structure does a good job of automatically determining which element in the array is being edited, and returning those values to the property nodes. Turned out simpler than i thought it might be at one point!

 

 

 

Cheers, Blue. 

 

Message Edited by BlueTwo on 01-15-2009 06:52 AM
0 Kudos
Message 6 of 8
(8,896 Views)

I like also this solution, which takes a table of Start- & End-Addresses in a configuration Subpanel, and change the End-Address @ a change of Start-Adress by the UI.

 

PS "Domain" is the name of the control on the UI, which displays [FieldAddresses] in app.ini

 

Best Greatings to all of you

0 Kudos
Message 7 of 8
(5,277 Views)

FieldStart_End.png


@makoubaa wrote:

@I like also this solution, which takes a table of Start- & End-Addresses in a configuration Subpanel, and change the End-Address @ a change of Start-Adress by the UI.

 

PS "Domain" is the name of the control on the UI, which displays [FieldAddresses] in app.ini

 

Best Greatings to all of you


🙂

0 Kudos
Message 8 of 8
(5,274 Views)