This document provides step-by-step instructions for wiring and configuring your NI DAQ device for digital input 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 input devices monitor the state of the digital signals and can transition from one digital pulse to another. Digital input 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 monitor the state as well as detect rising edges, a transition from logic low to logic high, and falling edges, a transition from logic high to logic low.
The three main types of digital input signals correspond to different digital logic families: TTL, sinking, and sourcing. Your signal connections vary based on your signal source 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 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 input means that when an external device drives current or applies voltage to the digital input terminal or pin (DI), the digital input provides a path to the device ground reference for the current or voltage. A sinking input cannot provide power to an external device. Common terms for a sinking device include NPN, Open Collector, Normally High, and IEC Negative Logic.
You can connect 2-, 3-, and 4-wire sourcing-output devices to a sinking input. A sourcing-output device drives current or applies voltage to the digital input. An example of a sourcing-output device is an open collector PNP.
Connect the output of the sourcing-output device to a sinking digital input. Connect the common of the external device to the COM/DGND terminal or pin.
Figure 2. Connecting a Sourcing-Output Device to a Sinking Digital Input (3-Wire Device Shown)
The digital input channel registers as ON when the sourcing-output device applies a voltage or drives a current that is in the input ON range. The channel registers as OFF when the device applies a voltage or drives a current that is in the input OFF range. If no device is connected to the input terminal, the channel registers as OFF. Refer to your device specifications section for ON and OFF state ranges.
A sourcing digital input means that the digital input (DI) terminal sources current from Vsup to a sinking output device. A sourcing digital input 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 connect 2-, 3-, and 4-wire sinking-output devices to the NI 9426 C Series sourcing digital input module. A sinking-output device provides a path from the DI pin to a voltage below Vsup. An example of a sinking-output device is an open collector NPN.
Connect the sinking-output device to the DI pin of the digital input channel. Connect the positive power supply lead of the external device to the Vsup pin. Refer to Figure 2 for an illustration of connecting a sinking-output device to a sourcing-digital input.
Figure 3. Connecting a Sinking-Output Device to a Sourcing-Digital Input (3-Wire Device Shown)
The digital input channel registers as ON when the sinking-output device drives the input below Vsup and meets the input ON range. The channel registers as OFF when the device does not drive the input low and is in the input OFF range. If no device is connected to the DI terminal, the channel registers as OFF. Refer to your device specifications section for ON and OFF state ranges.
Before connecting any signals, locate your device pinout.
Figure 4. Device Terminals Help
The following terminal types correspond with digital input measurements:
You can use MAX to quickly verify the accuracy of your measurement system Set Up. Using an NI-DAQmx Global Virtual Channel you can configure a digital input measurement 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 5. Creating an NI-DAQmx Virtual Channel
Figure 6. Device Physical Channels
Figure 7. Setting Up a Digital Input Channel in MAX
The next step is to physically connect the digital signal to your digital input device. Your digital signal should match your input configuration. Connect a TTL signal to a bidirectional TTL input terminal (Figure 1). Connect a sourcing digital output device to a sinking digital input terminal (Figure 2). Connect a sinking digital output device to a sourcing digital input terminal (Figure 3).
Use NI-DAQmx global virtual channels to preview your measurements.
Figure 8. Previewing a Digital Input Measurement 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.