Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69018

any examples of vi scripting an array??

$
0
0

I am trying to use VI scripting to build an array.  I cannot find any examples at all :(

 

In my VI, I read data from a text file into an array.  But the data is raw, and I need to repackage it into a 2d array to use in another VI (this other VI expects the data to be in a 2D array of string format).

 

The way I would do this if scripting wasn't required, would be to use the build array function and simply connect up the wires.  Since I can create a Build Array object and get access to its terminals, I figured the easiest way to script would be to just loop and connect the wires.

 

So to continue scripting, I need to be able to create a new VI Object of type array, and assign it's value to be the known value I am extracting from the text file.  This is where my problem comes in.  I cannot determine how to do this.  I am experiencing 2 problems:

 

array.png1. I first assumed that I need to specify the size/dimensions of the array I'm trying to create.  So I used the Number Of Columns/Dimensions/Rows property to do so.  However, Labview had a problem with each of those.  I simply wired a constant number to the property and it said, "The Specified Object Was not found.  Property Name: Number of Columns"

 

2. Even without doing that, I thought, maybe if I just wire up the data, it will automatically recognize the dimensions, etc.  But the 'value' property is of type Variant, and no matter what I do I get an error 91.  I first tried wiring up the value called Array (you can see the indicator) to it, but that didn't work.  You can see in the pic below that I took a simple case of just doing To Variant on a constant 0, but it still gives me error 91.

 

I cannot find examples anywhere.  Can someone point me to one or make some suggestions?

 

Thanks...


Viewing all articles
Browse latest Browse all 69018

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>