02-06-2012 05:33 PM
i have a 6211 daq and i want to change the anlog outputs to digital outputs, its for pulse and directions of bi-polar stepper motors
02-09-2012 08:18 AM
Hello Polarmess,
I am a little confused about your question.
The USB-6211 has 4 Digital outputs that can be used, along with the 2 Analog outputs.
Are you referring to, how can you change your code to use the digital channels instead of using the analog channels?
Kind Regards
02-13-2012 10:07 AM
sorry for not being clear
yes lm trying to send out a digital signalS on the analog ports , lve used up P1, P1.1, P1.2, P1.3
02-14-2012 06:48 AM
Hi polarmess,
You can produce digital signals from an Analogue Output channel very easily from within LabVIEW. For example, if you were using TTL based logic you would just need to output either a 5V DC offset to represent a logic '1' or a 0V DC signal for a logic '0'. So, as far as the channels are concerned, it is possible to output these signals. You can perform this kind of operation with low level DAQmx VIs or via the DAQ Assistant.
A Question of Implementation
The problem with performing this kind of action is that speed is an issue. Digital Logic usually requires very high speeds of operation and depending on the type of Analogue Output implementation you choose, your signal generation will be greatly effected.
Single Point - So, if you were only writing single points of data at a time (Using the software to decide whether to next write a 5V or 0V to the AO channel) you would be limited to the operating speed of your software. This kind of implementation is easier to program however it's operation speed is an enormous drawback; the software would essentially have to recalculate which next value to write on each new operation.
Hardware Timed - Instead, you can look into buffering some of these analogue values down to the hardware level, the same way that users can generate very high frequency analog signals. This will allow your hardware to output your signal data at a much faster rate. The drawback of this method is that you could only write the bit pattern down to hardware and let the device cycle through it; in this respect it would be oblivious to any handshaking routines on the line. You could buffer a waveform that looks like a PWM to the hardware layer to allow the analogue channels to produce a PWM-like signal, however in order to update the duty cycle newly calculated PWM waveforms will need to be placed onto the hardware buffer.
In Short?
It can be done, but it really depends on the kind of behaviour you're trying to implement. If you want to output a digital signal that stays in a high or low state for long durations, try writing single analogue values (0V,5V) to the AO port. If you want to generate a high frequency signal, you'll have to define what the digital waveform looks like first before buffering it down to the hardware layer.
For examples on buffering analogue values to the hardware layer, please check out the following example:
<LabVIEW> » Help » Find Examples... » Hardware Input and Output » DAQmx » Analogue Generation » Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi.
This shows the format of how we can buffer down a high frequency signal to the analogue buffer of your device. This will allow you to generate signals at high speeds. I'd recommend that you try creating your digital waveform from within this example and seeing how the device behaves.
I hope that this helps!