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: 

Scrollable cluster arrays as control, writing programmatically at the same time?

I would like to have a cluster array (just an example, you may suggest better solution), where each row (cluster-element) contains signal selection from combobox, and its value and unit.

I would like to have a signal list, where in each row, I can select which signal I want to show e.g. "motor speed", "motor torque", "motor power". And when signals are selected, the value of the

signals are automatically updated elsewhere. So basicly, I want to select which signals I monitor, and then watch them change over time. I use single cluster array because I want it to be scrollable. The problem is:

* let's say I have one row in the array. Then I add a row by editing the control in the GUI (now the array control has size 2).

* I have property node (write: array control -> value) to update the values and units in my software.

* I use array control output as the input in the subVI where I read my selections and write updated signal values.

* It can happen that I use that array control output when it still has size 1, and while I have added the second element, the software updates the control, and overwrites my new element addition.

 

So, I run into writing conflict. Only single user, just this problem. How should I avoid this?

(e.g. how can I know that user is not interacting with the control, so that I can update its value and unit fields)

 

 

0 Kudos
Message 1 of 3
(2,396 Views)

First suggestion is to post the code you have.

 

But that being said what you want to do can be done.  I think the problem you are having is a race condition between the user and the software.  Where the user chagnes the value and the software changes it back.  I suggest reading the value of the control and replacing its value but keep the signal names the user entered, then write that back to the control.

 

Another suggestion is to have two separate arrays, one that is signal selection, and one is values.  Then you only need to update the values table with the new data and the signal names never get overwritten.  You'll likely want to couple the two arrays so when one index value changes the other changes with it.  This can be done with an independent scrollbar control.

Message 2 of 3
(2,379 Views)

Thanks, I ended up making two different arrays and using common vertical scrollbar control to avoid race conditions. Feels less of a rubber'n'glue-solution.

0 Kudos
Message 3 of 3
(2,357 Views)