LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you save time data to a file with continuous analog data acquisition?

Hi,
 
   I picked up a program from the NI site that works great for continuous analog data acquisition.  The file is opened and closed outside of a loop and data is written in the loop.  The data is transformed into a spreadsheet string by the array to spreadsheet vi, but the time data is lost when doing this.  I would like to keep or recover the temporal data and write that to the file as well so it will be ready to graph right away.  Attached is the VI i'm using.  Thanks in advance!
0 Kudos
Message 1 of 11
(6,149 Views)
Hi LabVIEW apprentice,
 
I think the best way to do this would be to change your data type for the DAQmx Acquire vi to Analog 1D Waveform N Channel N Sample. You can then plot this data to your waveform graph. Use the Export Waveforms to Spreadsheet.vi to save your data. You can find this vi in Functions»Programming»Waveform»Waveform I/O palette.
Regards,

Hillary E
National Instruments
0 Kudos
Message 2 of 11
(6,129 Views)

Hi,

I am after an easy and basic way of attaching timestamp to acquired data, in a way, so that I can extract it later for time difference calculations.

Unfortunately, I am not finding enough basic conversion VIs between timestamp and numerical data types.

Could you please advice, if there is a basic and established method for all above.

do not hesitate to attach the relevant VI file if there is any. I have Labview 8.0



Message Edited by Siamak on 06-10-2008 01:51 PM
Message 3 of 11
(5,896 Views)

If you are acquiring dynamic data, you can use the Write to Measurement File and it will save the timestamps. If you have waveform data types, you can use Export Waveforms to Spreadsheet File. If you have DBL data, you can easily create waveform data with the Build Waveform function. Wire in a Y array, the timestamp as t0, and your sample rate as dt and use either of the above two functions. If you are using Write to Spreadsheet File right now, you would have to convert your timestamp and data to strings, and then create an array. There are instructions on the block diagram of Write to Spreadsheet File on how to quickly modify it to accept strings as inputs. You could also just use the Spreadsheet String to Array and a Write Text File.

It would be better for you to attach your VI so that someone can see what you have right now.

0 Kudos
Message 4 of 11
(5,890 Views)

Thanks for the advice. I should have added I need to work on the acquired data and their timestamps in real-time. That pushes me to resist writing data in to a file and reading back from it. 

As for conversion functions, for example for speed calculations, I need to deal with the time difference like a normal numerical value.

I have a rather large file of TCP, Serial and Parallel port commuinication VIs, which I use for data acquisition. I may send it next time if it really helps. At the moment I need to attach timestamp to each acquired data, which may travel around the VIs for real-time data processings.

Regards,

Siamak

 

Message 5 of 11
(5,868 Views)
Silly me. Since the old thread you posted to had saving to a file in the subject, I thought you were talking about that.
 
I don't understand your problem now. A timestamp is a numeric data type and you don't have to convert to anything to add/subtract/multiple/divide/etc.
0 Kudos
Message 6 of 11
(5,851 Views)

I've tried, and realized sometimes I can not have a piece of numeric data combined with it.

On the same file, my current challenge is finding a basic way of memorizing the last value of data for comparing with the next value sampled from serial port. any advice?

0 Kudos
Message 7 of 11
(5,827 Views)

If you are having a problem with numerically manipulating a timestamp, you need to post your code instead of just saying you have a problem with it.

To keep the last value acquired and comparing it with the next, you just have to use a shift register.

0 Kudos
Message 8 of 11
(5,819 Views)

Hi,

As you may see in the attached snapshot, I am having problem with generating a rather simple pulse. it is supposed to generate three time intervals, and enqueue two numbers between them. so that the whole sequence would look like: Start, Wait, Output 4, Wait, Output 8, Wait, End.

It is simpler than using state machine. I am expecting to have it working using a flat sequence structure.

There must be an added functionality: the whole pulse must be generated upon a true condition which may stay true for a while, but the pulse must be generated only once, when the condition turned true. I have tried to implement this by detecting the rising edge (the top While Loop and Case).

Problem is that piece of code (in the snapshot) does not do the mentioned logic for me. where am I wrongly setting this VI? how should it be configured? Please help.



Message Edited by Siamak on 06-19-2008 02:15 PM

Message Edited by Siamak on 06-19-2008 02:18 PM

Message Edited by Siamak on 06-19-2008 02:20 PM
Message 9 of 11
(5,769 Views)
This appears to have nothing to do with your original question and you really should start a new thread. Also, the image does not help much because of your design - too much is hidden. Post the actual VI in the new thread you start.
0 Kudos
Message 10 of 11
(5,742 Views)