LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with changing frequency

Solved!
Go to solution

Hi,

 

I'm attempting to read data from a CSV file to generate a waveform and output current. I'm using the Build Waveform function for this purpose, with the number of samples and the time between two samples known (0.305 ms). However, I'm facing difficulty in adjusting the frequency of the waveform independently of the sampling frequency. Modifying the time step (dt) alone doesn't seem to influence the frequency of the waveform. How can I adjust the waveform's frequency without affecting the sampling frequency? Could you please review the VI attached for further assistance?

0 Kudos
Message 1 of 7
(523 Views)
I'm facing difficulty in adjusting the frequency of the waveform independently of the sampling frequency. 

Well, that's because they are not independent! 

 

You have a file with a bunch of sample values representing your waveform, apparently acquired with a 0.305 msec time spacing.  The only way to set the waveform frequency as you output them is by defining the dt between samples, i.e., the sample rate.  The generated waveform frequency is entirely dependent on the output sample rate.  So if you want to change the waveform frequency, just generate your samples at a different rate than their nominal 0.305 msec spacing.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 2 of 7
(507 Views)

Thank you for the reply. If I wish to adjust the frequency while the VI is running, I cannot dynamically alter the sampling rate during operation. Is there any other option for that?

0 Kudos
Message 3 of 7
(495 Views)
Solution
Accepted by topic author gok010

What DAQ device are you using?   I've known of many NI devices that DO allow you to change the AO sample rate on the fly during a continuous run.

 

Another option might be to generate a pulse train with a counter (whose frequency you can change on the fly) and then configure AO to use that signal as its sample clock.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 4 of 7
(472 Views)

Hello,

I am using PXI- PXI 6345 I/O module

0 Kudos
Message 5 of 7
(455 Views)

I think your device should allow you to change the AO sample rate on the fly.  Have you tried it?  In LabVIEW, you'd need to use a DAQmx Timing property node to change the sample rate of a running task.

 

(Note: my experience with this is somewhat old.  It may be the case that you're only allowed to change the rate on the fly if you deliver data as an array of samples and not if you deliver data as a waveform.  I doubt I ever experimented with it using waveform AO.)

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 6 of 7
(409 Views)

I generated a Digital pulse train on the fly using counter output and then used it as a source for my AO sample clock. I could change the AO sampling rate by changing the the pulse frequency.

0 Kudos
Message 7 of 7
(397 Views)