LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency sweep with DAQmx

The following is the setup :

LV7.1 + PCI_6229 + WIN_XP

For controlling the drive rpm of a servo motor, I need to generate a range of frequencies from 60 to 2500 at 10 Hz intervals.

With the DAQmx polymorphic VI,  "CO Pulse Freq" , I can generate  a particular frequency. But if I have to change it on the fly how do I do it ? Like ideally if there was a property node for the polymorphic VI (!) , I could easily do it. But it does not have one such node for frequency and hence the query.

Having started the frequency generation at a default value, I would like to alter it programmatically without having to stop the VI and reload the fresh frequency.

Any suggestions welcome.

Thanks

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 7
(4,409 Views)
There is a great tutorial that describes changing the pulse specs of a pulse train "on the fly".  The second example shows how you can change the duty cycle, but you can also change the frequency with the same technique.  Here is the tutorial:
Advanced Data Acquisition Series – Pulse Width Modulation in NI LabVIEW Using NI-DAQmx

-Alan A.
 
0 Kudos
Message 2 of 7
(4,403 Views)
Dear Alan,

That was the exact information that I was looking for. The tutorial was good.

It has helped solve my problem. Thanks.

Regards

Raghunathan



Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 7
(4,396 Views)
Glad I could help 🙂
-Alan A.
0 Kudos
Message 4 of 7
(4,384 Views)
Hi

Can one generate an analog sweep with PWM i.e. generate a sine wave sweep from frequencies of 200Hz - 20 kHz.  My applications are limited to the hearing range of <20lHz. I understand I will probably need a low pass filter.

Goy


0 Kudos
Message 5 of 7
(4,375 Views)
Hello SG_ENGINEER,
So that is possible, but it is a completely different approach than that mentioned above.  You would have to use a continuous analog output program and change the output waveform.  Check out the attached example.  I modified a shipping example to do an analog output and increment the frequency of the output waveform. 
-Alan A.
0 Kudos
Message 6 of 7
(4,358 Views)

Hello AlanArmstead,

 

I have a question about your exmaple VI.

Why do you take the 'Actual Sample Rate' from the property node as a parameter for the Signal Generator? When and why does is differ from the sample you originally specify as an input for the DAQmx Timing VI?

0 Kudos
Message 7 of 7
(2,801 Views)