LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency Counter Output (USB6351) with fixed number of pulses.

Solved!
Go to solution

I want to be able to output X amount of pulses and a particular frequency.  So for a stepper motor control, I would say want 40 pulses sent with a 500hz frequency and 50% duty cycle.  I want to be able to vary the number of pulses and/or frequency as needed on the program.

0 Kudos
Message 1 of 5
(1,081 Views)

Hi cmcandrews,

 

which DAQ hardware do you (intend to) use?

 


@cmcandrews wrote:

I would say want 40 pulses sent with a 500hz frequency and 50% duty cycle.  I want to be able to vary the number of pulses and/or frequency as needed on the program.


There is a signal generation functions palette being able to create such signals. Did you play with those functions?

 

Btw. what have you tried and where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,063 Views)

If I create a channel for Counter Out (Freq), if I write to that channel to start the pulses, I want to be able to say to output only 40 pulse for whatever frequency I change it to. I don't want it to depend on time.

0 Kudos
Message 3 of 5
(1,055 Views)

Hi cmcandrews,

 

you didn't answer any of my questions…

 

Using a hardware-timed DO task it's quite easy to output the desired waveform.

When you want to use a CTR task then I guess you need to use two counters, one to generate the pulse train, the other to gate the output to the desired amount of pulses. (I'm not an expert with counter tasks in DAQmx.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(1,011 Views)
Solution
Accepted by topic author cmcandrews

I found it. The answer is to use the DMQmx Timing in Implicit then use Finite sample and state sample count.

0 Kudos
Message 5 of 5
(995 Views)