08-16-2018 07:16 PM
Hi,
I would like to log from a DAQmx task over long periods (hours) of time to a TDMS file. I will be acquiring the data from a PXIe-6538 module, among other modules. Ideally, each channel would continuously acquire to one waveform per channel, and the data would be periodically flushing to the TDMS file.
I have tried using the direct to TDMS logging of a task, which works but saves different acquisitions as waveforms but in different groups. I can do continuous logging with a large number of samples, but then the data is not being continuously written to disk, which we would like to occur.
Using TDMS write in labVIEW can append new data to existing channels, but cannot create a waveform due to time delay between different calls of the DAQmx read and TDMS write functions, as I understand.
I'm not that familiar with the timing/triggering/buffering aspects of the PXI system. It seems like it should be possible to use the hardware clock to write samples to a buffer that are equally spaced in time, and then the computer can periodically pull from that buffer and append to the waveform already in the TDMS file. Is this possible? We can accept relatively slow sampling rates (1S/s) for this purpose.
Solved! Go to Solution.
08-17-2018 07:39 AM
I think you need to share your code. Are you retriggering your acquisition or do you want continuous acquisition? To get what you seem to be describing, you need to use Continuous Acquisition.
08-20-2018 03:03 PM
I want continuous acquisition without retriggering.
I have setup a task in NIMAX which simply pulls all the inputs from a PXI current card.
I then want to start this task and have it continuously write to one individual tdms waveform per DAQ channel. When I do this with the following code:
I indeed achieve one waveform per DAQ channel with different acquisitions stitched together:
However, this data only shows up once I stop the task. Is there a way to 'flush' the data from a buffer to disk? Where is all of this data being stored before stopping the task? Because these measurements are being taken over hours, we are concerned with some system crash and then losing all of the data that the task has acquired.
We would also like to have some indicators of the data being acquired. Right now, the tdms file only appears to be logged properly when the task is set to 'log only' mode, and not 'log and read' mode. If the data could be flushed to a TDMS file then I could just open that in read only mode to create my indicators of the data coming in.
08-20-2018 04:03 PM - edited 08-20-2018 04:06 PM
It turns out tdms has some built in function that allows it to create a buffer before writing to disk. (Flush2.png).
I just threw it into the while loop and it wrote the buffer each time it cycled through the loop. I of course had to open and close the file (I dont create or overwrite to avoid interfering with any procedures the task might do, but this may not be necessary or you may have a better approach.)
08-20-2018 05:21 PM
Ah, I thought that the TDMS flush only worked after writing data with the TDMS write VI. This solves the problem.