Jump to content

Buggy TDMS example shipped with LabVIEW?


Recommended Posts

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!

  • Like 1
Link to comment

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.

Link to comment

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...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.