eberaud Posted September 18, 2014 Report Share Posted September 18, 2014 So either I really don't understand how TDMS VIs work, or there is an issue with the examples shipped with LabVIEW. If you open TDMS Advanced - Finite Asynchronously Read.vi you'll see that it asks to run TDMS Advanced - Asunchronously Write.vi first. I ran it and understood that channel 1 was being given the following values: 0,2,4,6,... which is confirmed when the Viewer opens. (and channel 2 takes 1,3,5,7,...) However when I then ran the Read example, the values for channel 1 became 0,1,2,3,4,... so it fetched samples from channel 1 and from channel 2. So is there a bug, or did I misunderstand how the Set Next Read Position works? I thought the channel name in input allows me to specify what channel I want to read samples from... Your insights would be much appreciated! 1 Quote Link to comment
Shirley Posted September 22, 2014 Report Share Posted September 22, 2014 Actually, TDMS Advanced Asynchronous Read function will read the data out in the same sequence as the data was written to the TDMS file, without regarding to the channel information. It behaves more like Read From Binary File rather than TDMS Read. TDMS Set Next Read Position function configures the offset where the read function starts to read data, but not specifies the channel to read. For example, if you set the channel name to “channel 1†and offset to “0â€, the data you read will start from the first element of channel 1. (that is 0, 1, 2,…) If you set the channel name to “channel 2†and offset to “0â€, the data you read will start from the first element of channel 2. (that is 1, 2, 3,…) If you are still confused, please contact me. Quote Link to comment
eberaud Posted September 22, 2014 Author Report Share Posted September 22, 2014 Thank you Shirley for confirming what I've been guessing these past few days. My application writes data "by bloc", writing N samples for each channel in one write operation. I have successfully written a Read function that will iterate through several blocs one by one by re-positioning the pointer (Set Next Read Position) and adjusting the number of samples to read in each bloc (Count input of Advanced Read). Then this function just needs to concatenate the samples read from each bloc... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.