LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fast puls output on a DigOut (USB6001)

Solved!
Go to solution

I need a higher frequency on one of the digital outputs.  It is used to control a stepper motor driver.

Hardware: USB-6001

 

I create a Digital Channel and I wire that task to a DAQmx write. Digital Bool 1Line 1Point. Gets a bool input.

1) Digital Write Bool = high

2) Digital Write Bool = Low

3) repeat from 1) nn times.

4) gets out of the for-loop and Clear Task.

 

Can this be done in another way so the freq gets higher?

 

Happy for any input on this.

 

 

0 Kudos
Message 1 of 9
(1,798 Views)
Solution
Accepted by topic author TakeANap

Hi Nap,

 

the USB6001 is considered "cheap" - and so it only offers limited options…

 


@TakeANap wrote:

Can this be done in another way so the freq gets higher?


As the USB6001 only supports "static" DO you could use the AO channels (as they offer hardware-timed 5kS/s samplerate) to output pulse waveforms…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(1,789 Views)

@TakeANap wrote:

I need a higher frequency on one of the digital outputs.  It is used to control a stepper motor driver.

Hardware: USB-6001


To make a digital pulse train, you need something called a "Counter-timer", which is present on some of the higher-end multifunction USB devices (such as the USB-6212).  "Growing up" (i.e. in my first 5-8 years of learning and using LabVIEW), I'd never tried to produce digital Pulse Trains, but about 5 years ago, I started collaborating with a group who needed to do this.  Fortunately, there was another LabVIEW guy in the group who knew about Counter-Timers, and introduced me to this functionality.

 

I'm currently working on a Project that involves using a Stepper Motor to present a stimulus (for a behavioral study), and also wanting to create several sound cues (for example, a 400 Hz tone for 300 ms or a 500 Hz tone for 150 ms).  But there was only a single Counter-timer on the 6212 I was using (and it was dedicated to the Stepper), so I generated two Waveforms with an offset of 2.5 V and an amplitude of 2.5 V (so they went from 0 to 5 V) and used it to produce an Analog Output that drives the speaker.  Worked fine.  Give @GerdW's suggestion a try.

 

Bob Schor

0 Kudos
Message 3 of 9
(1,783 Views)

I thought of the AO too. I tested it. With DO I got roughly 1 ms period. With AO I got about 0.33 ms. Much better but.I have a little problem to get the  exact amount of pulses but that is a detail. I looked into the Express-vi A-out and saw some interesting solutions.

0 Kudos
Message 4 of 9
(1,748 Views)

Yeah. Better hardware has more technical margins but it's more fun to reach the goals with cheap hardware that is fully utilized. The customer likes it.  😊 Sometimes I regret not suggesting and buying more powerful hardware.  

0 Kudos
Message 5 of 9
(1,745 Views)

It may satisfy the geek factor in you but unless your labor costs nothing you can buy several higher end cards for the money it costs you to tinker with the cheap hardware to get something done (often unreliably).

 

Saving in hardware cost only makes sense if:

- your development time costs nothing (hobby project)

- you plan on building a few dozen to a few 100 of the devices/setups.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 9
(1,706 Views)

Hi Nap,

 


@TakeANap wrote:

With AO I got about 0.33 ms.


With an AO task you should get 0.4 ms pulses according to the specs (5 kS/s per AO channel, resulting in 2.5kHz pulse trains)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(1,699 Views)

The best with USB-6001 is the size. It can be builtin, in a small box.

0 Kudos
Message 8 of 9
(1,510 Views)

Hi Nap,

 


@TakeANap wrote:

The best with USB-6001 is the size. It can be builtin, in a small box.


There used to be also OEM variants of those USB600x devices so they would be even smaller…

(An Arduino is still much smaller, depending on your requirements.)

Best regards,
GerdW


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