This document provides step-by-step instructions for wiring and configuring your NI DAQ device for digital output signals. Before you begin using your NI DAQ hardware, you must install your application development environment and NI-DAQmx driver software. Refer to the Installing LabVIEW and NI-DAQmx document for more information.
All digital signals have two discrete levels – a high level and a low level. Digital output devices control the state of the digital signals and can transition from one digital pulse to another. Digital output lines can be programmed on a line-by-line basis or programmed collectively as a port (typically four or eight lines). A counter device can also generate digital output pulses or pulse trains.
The four major types of digital output signals correspond to different digital logic families: TTL, sinking, sourcing, and relays. Your signal connections vary based on your load and your DAQ device.
A transistor-transistor logic (TTL) compatible signal has the following characteristics:
Many NI DAQ devices feature TTL digital I/O lines. The number of digital lines varies from device to device, but all are bidirectional and all support the same logic levels. You can configure a line or a port as an input or an output in software. Most devices also feature pull-up or pull-down (or both) resistors on digital I/O lines to control the state of the lines when no signals are connected. Digital input applications include receiving TTL signals and sensing external device states, such as the state of the switch shown in the figure. Digital output applications include sending TTL signals and driving external devices, such as the LED shown in the figure.
Figure 1. TTL Digital I/O Connections
A sinking digital output means that the digital output (DO) terminal of a channel is driven to COM (ground reference) when the channel is turned on. A sinking output cannot provide power to an external device. Common terms for referring to a sinking device include NPN, Open Collector, Normally High, and IEC Negative Logic.
You can directly connect a sinking digital output channel to a variety of industrial devices such as solenoids, motors, actuators, relays, and lamps. Make sure the devices you connect to the digital output channel are compatible with the output specifications of the DAQ device. Refer to your device specification for more information.
Connect the external device to the DO terminal and the positive lead of the external power supply, and connect the negative lead of the power supply to the four COM terminals, as shown in Figure 2.
Figure 2. Connecting a Sourcing-Input Device to a Sinking Digital Output
If the module is switching an inductive or energy-storing device such as a solenoid, motor, or relay, and the device does not have flyback protection, install an external flyback diode as shown in Figure 3.
Figure 3. Connecting a Flyback Diode
A sourcing digital output means that the digital output (DO) terminal is driven to Vsup when the channel is turned on. A sourcing digital output therefore provides power to an external device. Common terms for referring to a sourcing device include PNP, Open Emitter, Normally Low, and IEC Positive Logic.
You can directly connect a sourcing digital output channel to a variety of industrial devices such as solenoids, motors, actuators, relays, and lamps. Make sure the devices you connect to the output channel are compatible with the output specifications of the DAQ device. Refer to your device specifications for more information.
You must connect an external power supply to the sourcing digital output DAQ device. This power supply provides the current for the devices you connect to the digital output channels. Connect the positive lead of the power supply to Vsup and the negative lead of the power supply to COM. The Vsup pins on a digital I/O device are typically internally connected. In this case you can connect only one external voltage supply to the device. Refer to your device specifications section for information. Connect the external device or load to the DO terminal and connect the common of the device to COM (ground reference), as shown in Figure 4.
Figure 4. Connecting a Sinking-Input Device to a Sourcing-Digital Output
A relay channel has two interchangeable terminals, CHa and CHb. When connecting a load to the NI 9481 C Series sourcing digital output module, connect the positive lead of the load to either the CHa or the CHb terminal, and the ground of the load to one of the leads of the power supply. Connect the remaining CHa or CHb terminal to the other lead of the power supply. Figure 5 shows a possible configuration.
Figure 5. Connecting a Load to a Relay Output
When the channel is turned on, the terminal connected to the load drives current or applies voltage to the load. When the channel is off, the terminal does not drive current or apply voltage to the load.
When inductive loads are connected to relay outputs, a large counter-electromotive force may occur at switching time because of the energy stored in the inductive load. These flyback voltages can damage the relay outputs and/or the external power supply. Figure 6 shows examples of using an external flyback diode to protect DC inductive loads and an MOV to protect AC inductive loads.
Figure 6. Contact Protection for DC and AC Inductive Loads
NI-DAQmx supports programmable power-up states for PFI and DIO lines on many NI DAQ devices. You can set the state of physical channels for some devices when your computer is powered on or the device is reset in NI-DAQmx. Software can program any value at power up to the PFI and DIO lines:
Devices have limited numbers of writes to the EEPROM, so change power-up states infrequently.
Before connecting any signals, locate your device pinout.
Figure 7. Device Terminals Help
The following terminal types correspond with digital output measurements:
You can use MAX to quickly verify the accuracy of your measurement system setup. Using an NI-DAQmx Global Virtual Channel you can configure a digital output generation without any programming. A virtual channel is a concept of the NI-DAQmx driver architecture used to represent a collection of device property settings that can include a name, a physical channel, input terminal connections, the type of measurement or generation, and scaling information.
Follow these steps to begin:
Figure 8. Creating an NI-DAQmx Virtual Channel
Figure 9. Device Physical Channels
Figure 10. Setting Up an Digital Output Channel in MAX
The next step is to physically connect the digital signal to your digital output device. Your digital signal should match your output configuration. Connect a TTL signal to a bidirectional TTL output terminal (Figure 1). Connect a sourcing digital input device to a sinking digital output terminal (Figure 2). Connect a sinking digital input device to a sourcing digital output terminal (Figure 4). Connect the positive and negative leads of a load to CHa and CHb (or vice versa) of a relay output (Figure 5).
Use NI-DAQmx global virtual channels to preview your measurements.
Figure 11. Previewing a Digital Output Generation in MAX
You also have the option of saving your NI-DAQmx Global Virtual Channel should you wish to refer to this configuration screen again in the future.
If your device supports programmable power-up states (refer to your device specifications), follows these steps to configure your digital I/O lines in MAX.
Figure 12. Setting Power-Up States in MAX