LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write Spreadsheet String

Please help. I am very new and need to figure this out.

 

I have a 2-D Array of DBL data coming into a case structure which has 6 channels of DAQ voltages. I want to write that data to a file with timestamps before each row. I posted my attempt below. This is what I want the excel file to look like when opened:

 

Timestamp1, dataA1, dataB1, dataC1, dataD1, dataE1, dataF1

Timestamp2, dataA2, dataB2, dataC2, dataD2, dataE2, dataF2

Timestamp3, dataA3, dataB3, dataC3, dataD3, dataE3, dataF3

etc. etc.

 

WriteToExcel.JPG

 

I can't figure this out so any advice would help. I am open to throwing this out completely if you have a way of doing this.

 

Thanks,

~Chris

0 Kudos
Message 1 of 22
(3,224 Views)

Why not use Write to Spreadsheet File?

 

What you need to do is create your array of times as a string, and convert your array of double day to a 2-D array of strings.  Build those arrays together (or possibly insert the 1-D array of time strings into the first column of your 2-D array of data strings.)  Then write the 2-D array of strings out using Write to Spreadsheet File.

0 Kudos
Message 2 of 22
(3,212 Views)

How do I create an array of times as a string with different times?

0 Kudos
Message 3 of 22
(3,206 Views)

You actually have a 1-D array of strings coming out of that inner For Loop now.  But feeding it to that concatenate string is immediately flattening it to a single string.  But you could also change that shift register to an auto-indexing tunnel.

 

One problem with that inner For Loop.  You are running that as fast as it can.  So in all likelihood, every element of that string array is going to have pretty much the same time in it.  Is tha twhat you want?

0 Kudos
Message 4 of 22
(3,202 Views)

I am trying to timestamp each colunm of the 2d array of data. I guess I could send the 2d array of data into the loop and index the timestamp into each column. It makes sense in my head but I am not sure how to do that. Do you have an example?

0 Kudos
Message 5 of 22
(3,199 Views)

What do you want the time stamp to be?  You have a 2-D array of data.  How was that acquired?  Is there any inherent data acquisition rate to that?  Is the data 1 second apart, 1 millisecond apart, 1 day apart?  That should all be defined when you acquired the data.  Why not put the timestamp with the data when you collect the data?

0 Kudos
Message 6 of 22
(3,197 Views)

I am acquiring 24 differential signals in the producer loop. Then, in the consumer loop I split the data into 4 parts to manipulate/display/save the data into four seperate files. I have no idea how to add the timestamp and carry it through the splits and data manipulation. See attached code for a reference. Remember I am new. This is not a deliverable software, it is just a program to acquire data and then it will be discarded. I want to learn though so any suggestions are appreciated.

 

Thanks,

~Chris

0 Kudos
Message 7 of 22
(3,193 Views)

You can do it by the following way. just write the output array to a spread sheet file.

 

Data and time stamp.png

 

Data and time stamp_FP.PNG

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 22
(3,189 Views)

Does this take into consideration the timing of my acuired data? Where do you get 100ms from?

0 Kudos
Message 9 of 22
(3,186 Views)

It doesn't correlate to your timestamps.  The first timestamp is going to be after the last sample you've acquired has already come through.  He made up the 100 msec because you haven't said what the timing is.

 

Instead of asking us to give you something that is going to lead you down the wrong path.  Why don't you show us the code you have and we can show you how to implement the timestamp with?

0 Kudos
Message 10 of 22
(3,184 Views)