06-18-2012 08:09 PM
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!
Solved! Go to Solution.
06-18-2012 08:22 PM
rjmartinator, could you provide a VI to reproduce your issue?
06-18-2012 10:46 PM
@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.
06-19-2012 12:14 AM
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.