12-06-2017 08:11 AM
I would like to know if it is possible to find out array size on vi scripting.
What I ultimately want to do with that value is to define the number of rows visible on the front panel.
I guess I will have to use the built in array size function, but I do not know which property node I need to use to wire to the function.
Also, for value property node, is there any way I can convert that from variant to array format?
I do not have basic knowledge in variant, so I will also appreciate it if anyone can provide me with any help or documents I can read on it.
Thank you in advance!
12-06-2017 08:36 AM
For your 1st question, Number of Rows-property.
For your 2nd, Variant to data.
/Y
12-06-2017 08:46 AM - edited 12-06-2017 08:47 AM
@janed0714 wrote:
I would like to know if it is possible to find out array size on vi scripting.
What I ultimately want to do with that value is to define the number of rows visible on the front panel.
I guess I will have to use the built in array size function, but I do not know which property node I need to use to wire to the function.Also, for value property node, is there any way I can convert that from variant to array format?
I do not have basic knowledge in variant, so I will also appreciate it if anyone can provide me with any help or documents I can read on it.
Thank you in advance!
Oops, I really don't know what you want to do with this, so ignore this post.
12-06-2017 09:02 AM - edited 12-06-2017 09:03 AM
So I used "Number of Rows" property, but it only returned the number of rows set to visible on front panel that is different from number of elements in the array.
For variant to data, do you know where I can find that function? I use labview 2012 version.
Thank you.
12-06-2017 09:56 AM
The array size function tells you the number of elements in the array.
Neither array size, nor number of rows, requires VI scripting. One is a LabVIEW primitive, the other is a regular property node.
12-06-2017 11:15 AM
I am configuring things on vi scripting.
I converted an array constant to control via scripting.
The constant originally had 4 elements and the control only showing 3 rows on the front panel (the control does include all 4 elements, but displays 3 rows on fp).
I know I can simply set number or rows to 4 on scripting vi, but I would like to know if I can figure out the array size and wire that just in case the number of elements in the constant changes.
12-06-2017 12:04 PM - edited 12-06-2017 12:04 PM
You don't need to use scripting to set the number of rows in a control or indicator.
It is a regular property node.
12-06-2017 01:47 PM - edited 12-06-2017 01:52 PM
If you're looking to find the size of a Block Diagram array constant:
I only added the Case Structure to show how to discriminate among BD constants. If you're scripting the change from a constant to a control, you don't need anything to the left of the Property node.
12-06-2017 09:47 PM
What would be the point of trying to find the size of an array constant on the BD?
I don't think that is what the OP is looking for since he explicitly said in the first message "What I ultimately want to do with that value is to define the number of rows visible on the front panel. " A BD constant doesn't entity related to it on the FP.
12-06-2017 11:59 PM
@RavensFan wrote:
What would be the point of trying to find the size of an array constant on the BD?
I don't think that is what the OP is looking for since he explicitly said in the first message "What I ultimately want to do with that value is to define the number of rows visible on the front panel. " A BD constant doesn't entity related to it on the FP.
But if not from the front panel, where else would you get the size of an array? In my first post, I mentioned I don't really know what the OP wants to do, and I still don't. I fail to see an instance where you would need to use scripting to determine how many elements to display on a front panel.