01-31-2011 06:13 PM
Hello,
I believe what you are trying to do is output a frequency for step and another signal at half that frequency for direction. For example, creating two counter tasks that use implicit timing (on board timebase) with one counter output going at X frequency and another counter output going at X/2 frequency should give you expected resuts. The X/2 frequency output will be your direction that happens every two step rising edges. Is this what you are trying to achieve?
Another thing you might need to consider is changing the duty cycle on the X frequency counter to 25% so that your step signal will correspond 1 to 1 with your direction signal as far as pulse width goes. You can step once while direction is low and step again while direction is high in sync.
01-31-2011 06:58 PM - edited 01-31-2011 07:01 PM
Just to chime in, here's a software-timed approach to this:
http://decibel.ni.com/content/docs/DOC-6385
Using the counters would be a better option if you want to have a deterministic step rate. Do you need to control direction on-the-fly or do you have a pre-determined amount of steps you want to make forward and backwards? If the former, you should use static DO for direction, if the latter you should use the 2nd counter. Particularly, if you are alternating between forward and reverse continuously, you could run two continuous counter output tasks to generate the signals like Kyle mentioned.
Best Regards,
12-18-2013 06:18 AM
Hi All,
I found this discussion very useful and hope that anybody is still following. I am new to this topic. I have a USB 6211 and I want to generate an analog output (sinusoidal) and a digital output (square, 1 and 0 sequentially). Is this possible with 6211?
Also I couldn't understand why counters are mentioned in this discussion. Can we do what I want with counters?
Any advice is appreciated.
Ozan
12-18-2013 11:22 AM
The digital I/O on the 6211 is software-timed only. Assuming you want your digital output to be synchronized with the analog output or that you want the digital output to be hardware-timed, you would need to either use a counter output or use the 2nd AO channel.
The sinusoid analog output is no problem (using the AO subsystem obviously).
Best Regards,