LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure "array type" input using "Spreadsheet String to Array" VI

I'm trying to read in a text file containing two columns of strings into a two-dimensional array. I'm trying to use the VI called "Spreadsheet String to Array". 

Based on probes, I'm apparently reading the text file correctly, but I'm unable to generate the array. I'm most confused by what to wire to the input pin called

"array type (2D dbl)". The "Help" page says that this input is the "data type input" for the array. The default is 2D, double-precision, floating-point numbers. 

 

My array is a 2D array of *strings*. I cannot figure out what I'm supposed to connect to this input to tell the VI that my array is to consist of 2D strings, and

not 2D-dbl. 

 

Suggestions? I've tried to attach a simple version of this VI to illustrate the problem.

0 Kudos
Message 1 of 3
(2,734 Views)
Instead of trying to write your own function, why don't you just use the Read From Spreadsheet File function? Click on the polymorphic selector on the bottom of the function and select String. Then you can open it up and look at the block diagram to see how the Spreadsheet String to Array is supposed to be used.
0 Kudos
Message 2 of 3
(2,730 Views)

Even simpler, right-click on the type input and select "create constant". You'll get the default input for it.

 

Now right-click on the array element (not the array container) of the diagram constant (currently DBL) and select "replace...navigate to the string palette...select string constant". Voila, now you have a 2D array of strings. If you want a 1D array of strings, simply resize the array index.

0 Kudos
Message 3 of 3
(2,724 Views)