LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set sample rate of dynamic data

Hi,

I acquire data (4 channels) with a high sampling rate and then do some data manipulation and reduction. So chunks of 1000 acquired values gives me 1 value for each channel. I then use the Convert to Dynamic Data with input data type "1D array of scalars - multiple channels" and the Collector subVI to create a Dynamic Data Signal. How can I set the sample rate of that signal? It is set to 1 per default but I need to set it to 1/1000 of my original sample rate to get the correct frequency information for my new signal in further calculations.

Thanks

Andreas

0 Kudos
Message 1 of 8
(4,688 Views)

Makes no sense to me. How can a single sample have any sort of rate. Need at least two samples to define a time interval between them. How can you calculate a frequency from a single sample?

 

That's the evil of dynamic data. It allows you to wire signals to anything, even data that makes no sense. Even the 1D data would not yield anything meaningful since all four channels are acquired at the same time.

 

edit - saw that you were using the collector. In that case, your sample rate is how fast your loop iterates. Again no relationship to the actual original sample rate.

0 Kudos
Message 2 of 8
(4,683 Views)

it definitely makes sense what I am doing. Think of it as offline data processing. So the loop rate doesn't matter.

0 Kudos
Message 3 of 8
(4,640 Views)

Every time your loop iterates, you get 1 sample per channel, correct? Then it does not matter what the original DAQ sampling was. It only matters what the loop rate is - how often you get that single sample. Effectively, you are doing the same thing as NChan 1Samp. Say you acquire 100 samples at 1000 Samples/sec and reduce it to 1. Then you change it to 100000 samples at 100000 Samples/sec and reduce it to 1. With both you are acquiring a single sample every 100 msec.

 

If the way you are actually acquiring and reducing is something different than what I understand from your explanation, post your code so no one has to do any guessing.

0 Kudos
Message 4 of 8
(4,629 Views)

Alright, let's say I have one sample every 100msec. My question now is: How do I set this sampling rate for my new dynamic data?

0 Kudos
Message 5 of 8
(4,622 Views)

With 2009, you can use the Set Dynamic Data Attributes but pay attention to this bug. In earlier versions or to avoid dynamic data, use a waveform data type and the Build Waveform function.

0 Kudos
Message 6 of 8
(4,615 Views)

and what is the attribute called that I have to set?

0 Kudos
Message 7 of 8
(4,604 Views)

Sorry, never really used the Express VI and with a brief look, thought the x unit would work. Appears this does not allow you to set a dt value. Have to use the Build Waveform to set dt.

0 Kudos
Message 8 of 8
(4,600 Views)