Академический Документы
Профессиональный Документы
Культура Документы
The following procedure outlines how to count the number of digital pulses received on the counter pin of an
NI Educational Laboratory Virtual Instrumentation Suite (NI ELVIS) II device, and then how to output the digital
value to the digital port of the device in binary format. This procedure requires a single-pole double-throw
(SPDT) switch as well as eight 330 Ω resistors and eight LEDs.
Note: If you have a jumper wire connected to your counter input pins that is toggled between DGND, the
+5 V rail achieves the same results as an SPDT switch.
3. Connect the resistor and LED indicator network – using a breadboard is recommended but not required
a. Connect eight LEDs and a 330 Ω resistor in series – the resistor is used to regulate the current flow
through the LED to prevent it from overheating
b. Connect the other terminal of the LED to one of the port0/line0 terminals on your device
c. Connect the other terminal of the resistor to the DGND of your device
d. See the figure below for proper configuration of one LED
Note: LEDs are diodes, so they allow current to flow in only one direction. If an LED does not light up when
the 5 V voltage is applied, reverse the direction/polarity of the LED because this is most likely happening
because the LED is reversed. If it still does not light up, the LED may no longer be working.
ni.com/students/learnlabview
4. Create a new VI in LabVIEW
a. Open LabVIEW and select File >> New VI
8. Right-click the Data output terminal and select Create >> Numeric Indicator
ni.com/students/learnlabview
13. Wire the output from the counter input DAQ Assistant Data output terminal to the Data input terminal of
the digital output DAQ Assistant
a. Notice that a Convert from Dynamic Data VI is automatically inserted
b. This is because the counter input’s data type is dynamic, and the digital output requires a 1D array
of numeric
14. Wire the Stopped output from the counter input DAQ Assistant to the Stop (T) input of the digital output
DAQ Assistant
a. This stops the digital generation if the Stop button is pressed
15. Create the stop condition to include when the Stop button is pressed or an error is detected
a. Unwire the Conditional Terminal from the Stopped output terminal of the counter input
DAQ Assistant
b. Right-click the block diagram and select Programming >> Boolean >> Or
c. Wire the output from the Stop button control to the bottom input of the Or Boolean function
d. Right-click the block diagram and select Programming >> Cluster, Class, & Variant >> Unbundle by
Name and place this to the right of the digital output DAQ Assistant
e. Wire the Error Out output terminal of the digital output DAQ Assistant to the input of the Unbundle by
Name function and ensure Status is selected to be unbundled
f. Wire the output of the Unbundle by Name function to the top input of the Or function
g. Wire the output of the Or function to the input of the Conditional Terminal
©2011 National Instruments. All rights reserved. LabVIEW, National Instruments, NI, and ni.com are trademarks of National Instruments.
Other product and company names listed are trademarks or trade names of their respective companies.
ni.com/students/learnlabview