LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto-index only shows 9 values instead of 91

Solved!
Go to solution

I'm pretty new to LabVIEW and am trying to show a cluster of 91 values pulled from a text file.  Just for a test run without using actual values passed, I created a text file with the numbers ranging from 1-91 (1 number per line up to 91).  When I let it auto index and try to unbundle it after transforming it from an array to a cluster, it only shows 9 values instead of 91.  Do you happen to know how I can overcome this issue?

 

I have attached the basic files.

Download All
0 Kudos
Message 1 of 9
(3,788 Views)
Solution
Accepted by topic author STigmata08

you need to right-click your 'array to cluster' and select 'cluster size...' from the menu. Set it to 91. It's currently set to 9.

 

 

 

Sebster. 

Message 2 of 9
(3,779 Views)

Hello,

 

Not sure why you want to convert the array to a cluster... but you need to right click on the array to cluster and select cluster size, whereby you chnage that value to 91 instead of the 9 that is there by default.

 

 

Message 3 of 9
(3,776 Views)

Thank you very much, I had no idea that you could select a cluster size from the transformation.  I am converting it to a cluster because I thought that it would be the best form to insert the data into different parts of a word template.  I am trying to build an auto reporting tool for a test sequence.

0 Kudos
Message 4 of 9
(3,770 Views)

To extract a fixed number of elements from an array you can use a single Index Array node and enlarge it vertically until you expose the correct number of outputs. By wiring indexes from the left you may also select a specific extraction order; if you don't wire values as indexes, elements are extracted sequentially.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 9
(3,762 Views)

 


@STigmata08 wrote:

Thank you very much, I had no idea that you could select a cluster size from the transformation.  I am converting it to a cluster because I thought that it would be the best form to insert the data into different parts of a word template.  I am trying to build an auto reporting tool for a test sequence.


You need to set thee cluster size, because clusters are static structures and the size needs to be known at compile time. This also makes them useless for your problem.

To extract all lines from a file, you could use Spreadsheed string to array with a 1D string array as type and linefeet as delimiter. No need for FOR loops and complicated code. Also your sequence structure has no purpose because execution order is fully determined by dataflow anyway. Why is it there? Don't clutter the diagram with useless constructs!

 

Here's what you could do. You can get any element, array subsets, etc. using array tools. These are scalable and you don't need to know beforehand how many line are in the file.

 

Here's a quick draft (LV8.6)... 

 

 

Download All
0 Kudos
Message 6 of 9
(3,748 Views)

Using clusters as a means of indexing an array is putting yourself into Rube Goldberg territory.

 

http://forums.ni.com/t5/BreakPoint/Rube-Goldberg-Code/m-p/772709#M6492

0 Kudos
Message 7 of 9
(3,745 Views)

The reason why I am doing it this way is because I am writing the 90+ values to a .dotx for reporting.  After building the template, I will have the values writen from the tests to a .txt file since passing so many random variables would be a pain to pass.  Then, after reading the .txt I will have each line passed into the various bookmarks that I created in the template.  I know it sounds like a lot of work but with me being new to all of this, it seems easier to do since I can manipulate each step to do what I want.

 

Edit:

The reason that I am using the For Loop is for it to use the iteration terminal to pass the line that I need, in the order that it is loaded.  Maybe I did do it a more complicated way and should modify it by making a cluster in my main program and just passing that cluster on.

0 Kudos
Message 8 of 9
(3,737 Views)

None of what you are saying points to the use of a cluster.

0 Kudos
Message 9 of 9
(3,732 Views)