06-28-2010 03:29 PM
The for loop will automatically index your 2D array. You have to place the build waveform function inside.
Yes, the timestamp is t0 and the sample rate gives you dt.
06-28-2010 03:45 PM
@Dac83 wrote:
Hi Dennis,
Not sure I see what you mean when you say "place this in a for loop to add the t0 and dt". Are you saying the for loop will automatically add these somehow? The 2-D array is a collection of 5 seconds worth of data while the time stamp (as it is now) is the time at the start of the collection time. So should I be using the time stamp as the t0 and using the sampling rate to find the dt? This seems to make sense to me but I'm sure if I'm misunderstanding.
(Answering for Dennis) Here is a picture of what Dennis is saying. However, I tried using the Write to Spreadsheet File and it didn't come out right. First column of data array was missing. I never have written a 1D array of waveforms using any File Write function. You can't use the standard File Write because it only accepts string input. Perhaps Dennis can enlighten us.
06-28-2010 03:50 PM
Yeah this is what I'm working on at this moment. Hopefully it will agree well with everything else that is going on in this program...
06-28-2010 04:01 PM
Unfortunately this doesn't fix the problem. I'm pretty sure the reason it doesn't is because of something I neglected to mention. The 2-D array contains data from 11 channels. The other thing is that I still don't get the time stamp rather a column of data starting a zero and incrementing by dt. Because the output file must agree with an already existing program that will used when this is delivered we are very limited to the file format.
The first line must be in the format:
Sequential Count Time Stamp Channel1 CH2 CH3....... CH11
All other lines are the same but without the time stamp.
This is what I currently have as an output file but the time stamp is cut off.
06-28-2010 04:04 PM
tbob,
Thanks for providing the example. The empty column was because you had selected 'Empty Time Column'.
06-28-2010 04:07 PM - edited 06-28-2010 04:11 PM
@Dennis Knutson wrote:
tbob,
Thanks for providing the example. The empty column was because you had selected 'Empty Time Column'.
Did I ever mention that I hate Express VIs?
If you have to fit a certain format, you will just have to brute force the timestamp and data to the proper position and format.
So you still have a problem with lost seconds? Don't use the Express VI. Use Write to Spreadsheet and set the format to %d. This will write out the complete integer.