02-20-2008 09:29 AM
02-20-2008 10:09 AM
02-20-2008
11:19 AM
- last edited on
04-21-2025
02:38 PM
by
Content Cleaner
Would it be a solution for you to use a NI Motion Controller ? These boards are designed for this type of task ! You have then only to set some parameters like start velocity, aceleration, deceleration, end velocity, number of steps... and the board will generate the pulse train.
The solution with a buffer of digital states will give you more control over the ramp but the programming will be much more difficult than with a motion controller. A new pattern must be computed if you change the microstepping of the driver. Much work that the motion controller can do for you !
02-21-2008 02:08 AM
03-18-2008 06:46 AM
A motion controller *may* work, but I'm not sure if it can generate a sinusoidally-varying frequency. I don't know NI's well at all, but most of them tend to produce a ramp region that can be either linear or cubic (possibly a couple other choices) followed by a constant speed slew region.
Now to answer your question:
A. No, there is no possibility of performing a buffered pulse train output using a *counter* on the 6221. I've been wanting buffered counter output support from NI for almost 10 years, but none of their boards provide it.
B. You *can* perform buffered output using your DIO. The method I described is kinda complicated, but it can get you there.
C. What do you mean about "writing into a running task?" If you're wondering about changing a buffered digital pattern output on-the-fly, well, yes it can be done, but it'll be an additional significant complication to make it work seamlessly. Why might you need to do this?
-Kevin P.
03-18-2008 07:20 AM - edited 03-18-2008 07:21 AM
03-18-2008 10:39 AM - edited 03-18-2008 10:44 AM
Oliver,
The good news is that I think your approach is probably about the best you can hope for using the onboard counter. It likely produces a somewhat cruder approximation to a sine wave, but as long as the results are good enough for your needs, you've got simpler code to develop and maintain.
Quite a while back I threw together an example using a similar idea with a Timed Loop using the counter output as a timing source. All it did was to (try to) generate a linear ramp though. Your needs are more difficult. Still, in case it helps to look it over and compare, here's a link to the thread.
-Kevin P.
P.S. Editing this message -- just realized I had a couple threads confused. Ignore my comments about sinusoids here, they were left over in my head from a different thread about running a stepper with a sinusoidally-varying freq. Sorry for the confusion.
03-19-2008 02:47 AM
04-09-2010 02:59 PM
Oliver,
Would you mind posting the source code for your solution to the forum?
Jonathan
04-09-2010
06:05 PM
- last edited on
04-21-2025
02:38 PM
by
Content Cleaner
Hi Jonathan,
The thread is over 2 years old, we'll see if Oliver is still around and has the code handy to post.
Just in case, here's some code in LabVIEW that can be used to get around the fixed rate of a Finite Counter Output; this might be a good starting point if you need to generate a fixed number of pulses and keep SW-timed control of the frequency and/or duty cycle:
Reconfigurable Finite Counter Output Using DAQmx on E or M Series
X Series boards were released last year and do have buffered Counter Outputs--this is the ideal solution which gives HW-timed control of Counter Outputs.
I don't have much else to say for now, but if you provide more details about your application and what HW you are using we might be able to give more advice. I hope this helps for now!
Best Regards,