From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement of frequency ramp over fixed time

Hello,

 

firs, my setup:

LabVIEW 2013 + Sound & Vibration Suite

cDaq 9172

NI 9423 DI (frequency via Keyence LED Light sensor)

Ni 9215 AI (vibration vie 3-axis force sensor)

 

With this hardware, i want to measure the vibration of a fan-motor at different speeds. The rotation speed is measured with a light sensor looking through the fan blades (23 blades in total). I can control the motor speed with LV and will let it run from 500 rpm to 4500 rpm in a linear ramp in ~ 10 to 20 seconds.

What i need to know is the best method to geht the most exact values of frequency and analog input values. I need to be sure, which analog values go with which frequency values, because I will do a spectral analysis later on.

I can live with getting all values at the same time after the ramp has finished.

 

Do i put both channels inside one Task in MAX to get the same timing? Doing so would mean the slowest card would set my maximum sample rate?

Are there better ways? Is it best to use finite sample mode?

 

Thanks for your help guys!

 

Greetings from germany

0 Kudos
Message 1 of 11
(5,943 Views)

Hi spalter,

 

to be sure that the samples match each other you have to use an HW clock for the sample rates of both channels. That is the only way you can be sure that they match. Of course here you have the limitation of the slower module.

You cannot put both channels in one task as you can only create tasks for each device seperatley.

 

There are some examples on how to use HW timed Acquisition with DAQmx in the LabVIEW Example Finder.

 

Hope that helps.

 

Best regards,

 

Anna

Anna Vogl
Certified LabVIEW Developer
0 Kudos
Message 2 of 11
(5,921 Views)

I thought this mode is not possible with an USB cDaq?!

 

Greetings

0 Kudos
Message 3 of 11
(5,917 Views)

You have no cDAQ Sync, but you can connect an external timing clock to both modules. See the examples for that.

Anna Vogl
Certified LabVIEW Developer
0 Kudos
Message 4 of 11
(5,914 Views)

Hello,

 

i tried this example: Voltage - HW-Timed Single Point Input.vi

but get this error immediately after starting the VI:

 

Error -200077 occurred at Property Node DAQmx Timing (arg 2) in DAQmx Timing (Sample Clock).vi:4730001->Voltage - HW-Timed Single Point Input.vi
Possible reason(s):

Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.

Property: SampQuant.SampMode
Requested Value: Hardware Timed Single Point
You Can Select: Finite Samples, Continuous Samples

Task Name: _unnamedTask<1>

 

i have not found any other examples for hw-timed input.

 

Are you sure this is the way to go?

0 Kudos
Message 5 of 11
(5,912 Views)

Oh you are right, your DI module doesn't support this.

 

I don't know another way to be absolutley sure that the datas match. Because you need a time refernece for both....

 

You can try to start the tasks at the same time and set the same sample rates and aqurie the data at the same time in one loop. But there you are SW dependent.

 

 

Anna Vogl
Certified LabVIEW Developer
0 Kudos
Message 6 of 11
(5,910 Views)

Hello,

 

the problem with setting the same sample rate is that wit hfrequency measurements, the smaple rate is not constant. With grwoing speed i get more samples in the same amount of time.

0 Kudos
Message 7 of 11
(5,908 Views)
how do you want to realize that programmatically? (that the sample rate changes if you have no external timing source?)

 

Anna Vogl
Certified LabVIEW Developer
0 Kudos
Message 8 of 11
(5,906 Views)

My problem is, that i don't want it to be this way. I would prefer a constant flow of frequency measurement with a constant sample rate.

Let's say i want to measure a frequency of 10 Hz. It doesn't matter if i set my DI card to a sample rate of 1 Mhz, because it will only see 10 samples per second.

Now if the frequency that i want to measure is not constant, the amaount of samples the card sees is directly dependant on the frequency.

With this behaviour i can not set my sampling mode to finite samples, as there is no way for me to know how many samples i will have to set. In continous mode i am limited by my non-real-time OS.

I am starting to think that with my current hardware, i will not get satisfying results 😞

0 Kudos
Message 9 of 11
(5,904 Views)

I think so, too. Unfortunately.

Anna Vogl
Certified LabVIEW Developer
0 Kudos
Message 10 of 11
(5,901 Views)