LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues writing varying sample rates to a continuous TDMS

Hi All,

 

I have a VI that uses DAQ.mx to aquire data where I can dynamically change the sampling rate without stopping the program and restarting it.  The aquired data goes to to a queue and then gets written to a TDMS file in a separate VI.  I know the aquisition part of the routine is properly changing the sampling rate, but when I view the TDMS files all of the data has been changed to one sampling rate for the entire file.  Does anyone know what may be causing this and how I might fix it?

 

Thanks in advance!

0 Kudos
Message 1 of 12
(5,297 Views)

Hi amswak,

 

How are you changing the sampling rate without stopping the program and restarting it? Are you using a property node? What sampling rate are you coming from and going to? Thanks

 

Thank you for choosing National Instruments.

 

Aaron

National Instruments

Applications Engineer

http://www.ni.com/support 

0 Kudos
Message 2 of 12
(5,261 Views)
Did you write to the same channel of the same TDMS file?
0 Kudos
Message 3 of 12
(5,256 Views)

"How are you changing the sampling rate without stopping the program and restarting it?"

 

I have tried changing the sampling rate two ways to see how they differed with system resource load.  Both still leave me with the same TDMS file issue.  

 

1) there is a case structure in the aquisition loop and a "low speed"/"high speed" switch.  There is also an "equal to" comparison coming off  and the switch's value from the last loop via shift register.  If I flip the switch true case stops the device, changes the sampling rate through a datamx task property node to high speed or low speed (depending on the boolean, a second case structure inside the first), then starts the tast again at the new rate.  The case then is false until the switch is flipped again.

 

2) the loop always samples at high speed and downsamples the waveforms when "low speed" is clicked.

 

What sampling rate are you coming from and going to? 

High Speed = 50kS/second

Low Speed = 10kS/second

 

 

 

0 Kudos
Message 4 of 12
(5,246 Views)
Yes...I thought I could do that...am I wrong?
0 Kudos
Message 5 of 12
(5,245 Views)

Hi amswak,

 

If you write to the same channel in the TDMS file, and you write as waveform to the channel, then I'm afraid it can only takes one sample rate. Maybe that's the reason why you had such a problem.

 

The workaround is that if you want to write different sample rate, you can consider to write to different channels.

 

Hope it helps.

0 Kudos
Message 6 of 12
(5,243 Views)

That helps a bit in the sense that now I won't waste any more time on something that won't work.  The downside is that requires a pretty significant rework to the backbone of my program.  Thank you for the help though!

 

Would different groups with the same channel names get treated like different channels?

0 Kudos
Message 7 of 12
(5,241 Views)
It also can work if you using different groups but with the same channel name.
0 Kudos
Message 8 of 12
(5,239 Views)
Is the reason for the lower sample rate option strictly in the interest of saving file space during that time? or is there another reason why you provide the option to downsample?
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 9 of 12
(5,211 Views)
Andy: It is purely hard drive space.  We have about 16 high-speed channels recording at 50kS/s and we plan to go into muti-hour tests.  We do not need 50kS/s data for the entire duration, just during key events in the test.
0 Kudos
Message 10 of 12
(5,198 Views)