LabVIEW

cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

How do I access the increment propery node for an array of Numeric Controls?

I have an array of numeric controls and wish to modify the increment value of each array element.

The increment values are held in a .csv file & loaded on the press of a button.

I had hoped to use a property node to set the increment value when this button is pressed as I had earlier prototypes code for a single numeric control.

 

Note

1) For a single numeric control I select the control, right click then select create/property node/data range & select increment.

This adds a property node to the block diagram and allows me to change the increment value at run time.

 

2) If I select the array, right click then select create/property node there is no 'data range' option.

3) If I select an array element, right click then select create/property node/data range & select increment.

    This adds a property node to the block diagram and allows me to change the increment value of all array elements at run time.

   I want to have different increments for each element of the array.

 

 

Any thoughts?

0 Kudos
Message 1 of 10
(4,543 Views)
All elements of an array have identical properties. Essentially, an array has one element type. Each element can have a different value but other properties will be the same.

What are you trying to accomplish? Tell us that and perhaps someone will have an alternative idea for you.

Lynn
0 Kudos
Message 2 of 10
(4,537 Views)

To do what you want, you might want to look into using a Cluster.

 

0 Kudos
Message 3 of 10
(4,532 Views)
 
0 Kudos
Message 4 of 10
(4,500 Views)
Many thanks for reply’s I am new to LabVIEW and just finding my way. The original requirement was to provide the ability for a user to adjust the level of 80 analogue outputs. It was also required to be able to upload a default setting for each output from a .csv file when the user presses a button. I therefore created an array of Numeric Controls. I selected the array & created a property node for "Value (Signaling)". This property node was also an array. On the user pressing a button I read a column from a .csv file as an array of string, converted this to an array of double and applied this to the property node created above. This appeared to be a tidy solution to the requirement. It is now required to have different increment values for each of the 80 analogue outputs and that these are also uploaded from an extra column in the .csv file. As I found, and as stated above an array does not allow for individual elements with different increment values. It looks like I will have to use individual numeric controls, create a property node for each, extract individual elements from the default array read from the .csv file and connect these to the individual property nodes. Unless someone can suggest a different method? I looked at using clusters, but it appears that I would have to create a property node for each numeric control, so no real advantage.
0 Kudos
Message 5 of 10
(4,494 Views)
One good thing about using a cluster is that you can get an array of references to the controls in it from a property node.  You could then loop through all of the numeric controls with a For loop and one property node that is used to set the increment from an array you read from the .csv file.  This will save you the trouble of making all those property nodes.
0 Kudos
Message 6 of 10
(4,489 Views)
Eighty controls on a panel at one time, especially if they each can have different increment properties, might be rather confusing to an operator. Since the operator can only change one item at a time, why not have a selector and a customizable control? The operator uses the selector to choose an output channel. Using property nodes and a case structure, set the default value and increment value for the customizable numeric control. When the operator presses an "Accept" button, the value is placed into the appropriate element of the array. If the user must be able to see all values simultaneously, display the array or convert the array to a cluster of indicators. The array may be easier to work with internally, while the cluster is more versatile as a user interface.

Lynn
0 Kudos
Message 7 of 10
(4,491 Views)
Again many thanks for the useful information.
1) I had a look at using clusters, but I still can't see the 'increment' property.
I am missing something? I followed the steps below:-
a) Created a cluster and adder a number of numeric controls to it.
b) Selected the cluster on the block diagram, right clicked and created a reference.
c) Added a property node and connected this to the cluster reference.
d) Configured this property node to 'Controls[]'
e) The output of the property node above was connected to a second property node, placed
inside a for loop.
I had expected to see the 'data range / increment' property here but don't.
What am I doing wrong?
2) I used an array so that only say 20 array elements are displayed on the screen at one time.
The operator can use the index control to set the start point in the array. This was Ok until the need to set different increments. Again I am looking at clusters.
0 Kudos
Message 8 of 10
(4,473 Views)
Hi John
 
You need typecast Controls[] reference to a "more specific class" which in this case is Numeric. This will give you access to the specific properties. Like this
 
 
hope this helps
 
David

Message Edited by David Crawford on 02-02-2006 05:01 AM

0 Kudos
Message 9 of 10
(4,464 Views)
Excellent that works fine. I implemented a screen with a cluster and a single numeric control. The Cluster contained 20 numeric controls. The code has an array of 80 elements. I used the front panel single control to set a start index for the cluster so I could scroll through all 80 elements of the array. I then wrote code as suggested to modify the increment and value of controls within the cluster. Many thanks.
0 Kudos
Message 10 of 10
(4,438 Views)