LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write multiple arrays to single text file

Hi.

I can't think of how to write 3 arrays out to a text file (tab delimited). 2 of the arrays are doubles, 1 is an array of strings.

Attached is an image of the format I would like to achieve.

Can anyone please help me with this problem?

UniSA, Mawson Lakes, South Australia - LV 8.6.1
0 Kudos
Message 1 of 11
(5,637 Views)

Just one of the possible ways

Omar
Message 2 of 11
(5,610 Views)

The proposed solution has two flaws:

  1. It continuously builds up a string in a loop - this can chop up memory and cause increasing memory usage, especially with large arrays, as LabVIEW needs to allocate more and more memory as the loop progresses.
  2. If the arrays are not the EXACT same dimensions, then one of the loops will run based on the minimum number of rows or columns of the arrays. So, for example, if the numerics had 4 columns, but the string had only 3 columns, the last column of the numeric arrays would never get written out.

See attached for an alternate version that performs the operation using no loops.

Message 3 of 11
(5,598 Views)

Hi.

Thanks to both of you for providing solutions but I can't open them. I am using LV 8.6.1f1

Would it be possible to save your files as older versions so I can open them?

Thanks

UniSA, Mawson Lakes, South Australia - LV 8.6.1
0 Kudos
Message 4 of 11
(5,550 Views)

Please save these two files so I can open them in LV 8.6.1

UniSA, Mawson Lakes, South Australia - LV 8.6.1
Download All
0 Kudos
Message 5 of 11
(5,529 Views)

Attached are the two VIs in 8.6.

Download All
0 Kudos
Message 6 of 11
(5,506 Views)

Thanks for the helps guys. I went with the FOR loops because I know exactly how wide each array is and they are all the same length.

Much appreciated.

UniSA, Mawson Lakes, South Australia - LV 8.6.1
0 Kudos
Message 7 of 11
(5,490 Views)

After getting the program working I now need to change the output file format 😞

I have attached an image file showing the new format.

 

Basically I need to append arrays together, but I can't see how to do that.

The arrays are all the same length.

Can someone please help?

 

UniSA, Mawson Lakes, South Australia - LV 8.6.1
0 Kudos
Message 8 of 11
(5,480 Views)

See this vi.Might be helpful.

 

 

Best of luckSmiley Wink

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 9 of 11
(5,470 Views)

 


@mikie121 wrote:

Thanks for the helps guys. I went with the FOR loops because I know exactly how wide each array is and they are all the same length.

Much appreciated.


This is a poor reason. When you can perform operations on an entire array in-place, then that's the way you should be doing it. Why in the world would you want to create extra work for yourself?!? Smiley Surprised

 

 

 


 

After getting the program working I now need to change the output file format 😞

I have attached an image file showing the new format.

 

Basically I need to append arrays together, but I can't see how to do that.

The arrays are all the same length.

Can someone please help?

 


The VI I had shown you already does that - that's what the Build Array is for. Did you run the VI?

 

0 Kudos
Message 10 of 11
(5,459 Views)