08-30-2023 07:03 AM
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.
Solved! Go to Solution.
08-30-2023 07:12 AM
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…
08-30-2023 07:24 AM
@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
08-30-2023 02:03 PM
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.
08-30-2023 02:08 PM
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.
08-31-2023 01:34 AM - edited 08-31-2023 01:35 AM
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.
08-31-2023 01:53 AM
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)…
10-03-2023 02:11 AM
The best with USB-6001 is the size. It can be builtin, in a small box.
10-03-2023 10:38 AM
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.)