LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS buffer does not clear

Solved!
Go to solution

I use TDMS writes and TDMS flush functions in a state machine application. I write to TDMS in two of the states, and flush after each write.

The trouble I am having is that the TDMS flush does take the time to write data to disk, but does not seem to clear the buffer, such that data is duplicated the next flush. Interestingly, this only happens for one state.

The first state, which has no problems, writes 30 elements to each of 16 channels, writing one element to each channel during each iteration of a loop, and a I flush after I exit the loop.

 

The second state's loop is more time critical, so the TDMS write is only after the loop exit, and I store the data in between in a shift register to be written. I create a new group name each time I write to TDMS, and data is duplicated in each new group corresponding to the second state, but not the first state. The second state writes a variable number of elements to each of 7 channels, but an equal number to each channel.

 

The states run in a 1, 2, 1, 2, 1, 2 pattern, so I am confused why one is flushed and the other is not. 

 

Any ideas? Thank you!

0 Kudos
Message 1 of 4
(2,374 Views)

rjmartinator, could you provide a VI to reproduce your issue?

0 Kudos
Message 2 of 4
(2,371 Views)
Solution
Accepted by topic author rjmartinator

@rjmartinator wrote:

I use TDMS writes and TDMS flush functions in a state machine application. I write to TDMS in two of the states, and flush after each write.

The trouble I am having is that the TDMS flush does take the time to write data to disk, but does not seem to clear the buffer, such that data is duplicated the next flush. Interestingly, this only happens for one state.

The first state, which has no problems, writes 30 elements to each of 16 channels, writing one element to each channel during each iteration of a loop, and a I flush after I exit the loop.

 

The second state's loop is more time critical, so the TDMS write is only after the loop exit, and I store the data in between in a shift register to be written. I create a new group name each time I write to TDMS, and data is duplicated in each new group corresponding to the second state, but not the first state. The second state writes a variable number of elements to each of 7 channels, but an equal number to each channel.

 

The states run in a 1, 2, 1, 2, 1, 2 pattern, so I am confused why one is flushed and the other is not. 

 

Any ideas? Thank you!


I guess the shift register you are using makes these mess are you clearing/Overwriting the shift registers?. Any how if you can post the code then it would be east to find the problem.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 4
(2,358 Views)

I didn't realize that shift registers held data after the loop stopped! I looked up and learned about USRs. Thank you! I'll post code if I have more questions.

0 Kudos
Message 4 of 4
(2,349 Views)