LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a new row into an array bases on a1D array

Hello,

I build a FieldPoint application with LabView 7.1 RealTime. I've a measurement loop with 1Hz sample rate. I sample 5 channels and put them into a 1D array. Presently I write directly to a cvs file but this I've to cahnge because my loop slows down to 0.2 Hz.
I want to sample my data the hole day (86400 loops) and save them inside of an array. When the time is over I want write the hole array (table) to the file.

How I can do this or hoow I can add my 1D array to a new row in my 2D array?

Thanks

Thomas
Thomas
0 Kudos
Message 1 of 4
(2,709 Views)
Use the Insert Into Array function found in Functions palette - Array. Wire the 2D array into upper left corner, and new 1D array into lower left corner. There is an index terminal in middle left so you can wire into any row you choose. I think if you leave it unwired, it will append to the end of the array.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(2,687 Views)

@TomDooley wrote:
Hello,

...I write directly to a cvs file ...my loop slows down to 0.2 Hz



Writing a series of 5 values to a file should not take so long. There is probably something wrong in the way you are saving your data. May be you should post a simplified version of your vi, so we could see how to improve your code.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 3 of 4
(2,680 Views)
I agree with CC.
Make sure to use low level File VIs and open and close the file outside the loop. Inside the loop only append the data to the file at the current position while keeping the file open.

If you use the high level file VIs, there is a lot of unecessary overhead because the file gets opened and closed with every single append operation.
0 Kudos
Message 4 of 4
(2,674 Views)