LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS streaming problems

Hi forum,

 

i have problems streaming a lot of data to a file. I am using  write to measurment file with tdms in the while loop but my pc is to slow to do this streaming (100Ks/s for 10s). 

For optimizing i was thinking to open a tdms file outside the while loop stream it to file in the recording state and then read it to another file in the logging state, clear it and i could stream again.

But can i delate data from the tdms format, or is there something easier to do?

Thanks and best

Martin

0 Kudos
Message 1 of 12
(3,863 Views)

Where is the data coming from?

 

You definately should be opening the file before your loop and closing it after your loop.  You can then write as much as you want inside of the loop.  Nothing extra should be needed.

 

But if this data is coming from a DAQmx task, use the DAQmx Configure Logging and it will stream the data to disk for you.  You just have to tell it where to put the file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 12
(3,857 Views)

Hi crossruiz,

 

  thanks for your answer i am using a USB cDaq 9171, the problem is i want to have new tdms file every time it gets in the recording state for 5s. The programm will be normal never go out of the while loop so how i could do this? thanks and best,

Martin

0 Kudos
Message 3 of 12
(3,840 Views)

Martin88 wrote: the problem is i want to have new tdms file every time it gets in the recording state for 5s.

Use the DAQmx Start New File VI.

 

If you don't want to record everything, then you will need to read the data and then use the TDMS File API or stop and restart your task.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 12
(3,808 Views)

HI

thanks for ur answer, is there no other way to use a file reference stream the data to tdms read it from there in another file, and then set the tdms file to 0, so i could stream again?

 

 Best, 

Martin

0 Kudos
Message 5 of 12
(3,768 Views)

There is an option called "create or replace" in TDMS Open, you can use it to replace your original TDMS file when you are done with it.

0 Kudos
Message 6 of 12
(3,742 Views)

Hi deppSu,

 

thanks for your answer but is till have to leave the while loop to replace the tdms file no? I was thinking about to open a temp tdms file outside the while loop write the data to file in another state i read the data to a new file and then delate the data from the temp tdms file. 

May i am wrong?

Best 
Martin

0 Kudos
Message 7 of 12
(3,689 Views)

Run your while loop to collect data continuous. You can put the data in a Que in that loop by using the enqueue element.  Use another while loop to dequeue the waveform data and write to the tdms file. The dequeue loop will wait until element is in the Que or time out occurs. You can then write to the tdms file. The file write loop will not effect the data collection loop timing if you have a slow hard drive. You can also open and close the tdms file in the dequeue loop when you want to change the tdms file name as required without loosing waveform data.

0 Kudos
Message 8 of 12
(3,676 Views)

You might not need to leave the while loop. The TDMS Close has a "file path out" output terminal, you can put it in the while loop when you want to delete the file and followed by a TDMS Open with "create or replace" option.

0 Kudos
Message 9 of 12
(3,661 Views)

deppSu 

thansk for your answer is there an example how to do this i have not get it working i open the tdms file outside the loop write it to file, then delete it in another case but i always get invalide tdms reference.

best 
Martin

0 Kudos
Message 10 of 12
(3,647 Views)