LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine array size on vi scripting

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!  

0 Kudos
Message 1 of 16
(3,220 Views)

For your 1st question, Number of Rows-property. 

For your 2nd, Variant to data.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 16
(3,206 Views)

@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.

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.
0 Kudos
Message 3 of 16
(3,198 Views)

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. 

0 Kudos
Message 4 of 16
(3,191 Views)

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.

0 Kudos
Message 5 of 16
(3,178 Views)

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. 

0 Kudos
Message 6 of 16
(3,165 Views)

You don't need to use scripting to set the number of rows in a control or indicator.

It is a regular property node.

 

Example_VI

 

0 Kudos
Message 7 of 16
(3,158 Views)

If you're looking to find the size of a Block Diagram array constant:

 

Example_VI.png

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.

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 8 of 16
(3,147 Views)

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.

 

0 Kudos
Message 9 of 16
(3,121 Views)

@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.

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.
0 Kudos
Message 10 of 16
(3,112 Views)