LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine array size on vi scripting


@RavensFan wrote:

What would be the point of trying to find the size of an array constant on the BD?

 

Well, my first thought was that he was trying to use scripting to get the size of an array on a wire.  Then I thought that he was trying to do something trivial.  Then, reading his latest response made me think he was trying to use scripting to convert BD constants to FP controls with the appropriate number of elements visible.

 


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

And...


@janed0714 wrote:

I am configuring things on vi scripting. 

I converted an array constant to control via scripting.


I don't know why OP wants to find the size of an array constant, but I think that's what's been asked for.

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 11 of 16
(549 Views)

Searching for array size is just a part of vi scripting. I am not using vi scripting just to look for array size. 

I will try one of the solutions right now.

Thanks! 

0 Kudos
Message 12 of 16
(540 Views)

@janed0714 wrote:

Searching for array size is just a part of vi scripting. I am not using vi scripting just to look for array size. 

 


I didn't think that you were. Smiley Happy  What's your overall objective?  Was I on the right path?

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 13 of 16
(536 Views)

I am trying to use "variant to data" function right now and came across one question. 

I know I can just wire an array to "type" input in the function, but is there any code or name that I can simply wire to define the "type"? 

I would like to know that for cases I need to use that function for some other data types than an array. 

Thanks! 🙂 

0 Kudos
Message 14 of 16
(526 Views)

All I can suggest is a Case structure explicitly converting each type you expect to receive.  You can use the "Get Type Information.vi" for the selector.

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 15 of 16
(521 Views)

@janed0714 wrote:

I am trying to use "variant to data" function right now and came across one question. 

I know I can just wire an array to "type" input in the function, but is there any code or name that I can simply wire to define the "type"? 

I would like to know that for cases I need to use that function for some other data types than an array. 

Thanks! 🙂 


No, you can't "name" the datatype, you'll need to give an example (wire in the correct data type). If you want to go the other route you have some work with Unflatten from string ahead of you. 🙂

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 16 of 16
(511 Views)