LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to build an array based on inputs from a text file

I made some changes, it somehow works but I have 2D array instead of 1D array. Could you please take a look at my code 

0 Kudos
Message 11 of 16
(895 Views)

The attachment is missing.

 

Without seeing it, my first guess is that you have a tunnel set for auto-indexing when it should have been a shift register.

Message 12 of 16
(885 Views)

 

It looks like RavensFan's guess is correct- you probably need to use a shift register rather than an auto-indexed output tunnel.  You've not provided any sample data or a test file, however, so the code doesn't currently do anything.  When you upload demonstrative code to the forums, try and make sure that it can be run as-is.  Providing default data in a front panel control rather than reading from a file we don't have is a good idea.

 

Regards,

 

Tom L.
0 Kudos
Message 13 of 16
(877 Views)

If you change that output tunnel to concatenating it will append each new array to the previous one.

 

http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/autocat_arraysnloops/

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 14 of 16
(873 Views)

I tried concatenating  but I faced the same problem.

I have attached my new vi and the text file into this email. I found a way to make 1 array out of n arrays but I am sure there should be an easier way to do this. I would greatly appreciate your advice

Download All
0 Kudos
Message 15 of 16
(859 Views)

That VI is a mess.  It doesn't look like you've tried to incorporate any of the instructions that were given to you by others.

 

Also, the text file you attached doesn't look anything like the way you described the problem in message 1.  In that message, you gave an example where each row that 3 elements in it.  But the text file you have attached shows 5 items in each row.  You should at least try to detail problem in a way that matches what you are trying to do.

 

For someone who has 120+ posts on the forums, I'm really surprised you are having a difficult time to some basic array manipulations in LabVIEW.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

Message 16 of 16
(852 Views)