Hands-on Lab. LabVIEW NI-DAQ Digital Inputs and Outputs

Similar documents
EET 310 Programming Tools

Servo Motors (SensorDAQ only) Evaluation copy. Vernier Digital Control Unit (DCU) LabQuest or LabPro power supply

Cornerstone Electronics Technology and Robotics I Week 15 Voltage Comparators Tutorial

Lab 4 - Data Acquisition

First Bytes Programming Lab 2

Annex: VISIR Remote Laboratory

Using LabVIEW to Measure Temperature with a Thermistor

Hands-On: Introduction to Object-Oriented Programming in LabVIEW

The basic set up for your K2 to run PSK31 By Glenn Maclean WA7SPY

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

Lab 3: Introduction to Data Acquisition Cards

Experiment: Series and Parallel Circuits

Exercise 10: Basic LabVIEW Programming

How to use the OMEGALOG software with the OM-SQ2010/SQ2020/SQ2040 Data Loggers.

Renewable Energy Monitor User Manual And Software Reference Guide. (979)

LabVIEW Day 1 Basics. Vern Lindberg. 1 The Look of LabVIEW

Lab 1: Full Adder 0.0

Data Acquisition Using NI-DAQmx

Lab 3 - DC Circuits and Ohm s Law

Three Levels of Data-Logging Software from National Instruments

Evaluation copy. Build a Temperature Sensor. Project PROJECT DESIGN REQUIREMENTS

Tutorials Drawing a 555 timer circuit

Lab E1: Introduction to Circuits

STUDY OF CELLPHONE CHARGERS

Digital I/O: OUTPUT: Basic, Count, Count+, Smart+

Switch board datasheet EB

Dash 18X / Dash 18 Data Acquisition Recorder

4.1 DESCRIPTION OF CONTROLS cont.

QUICK START GUIDE. SG2 Client - Programming Software SG2 Series Programmable Logic Relay

How to read this guide

WinLIN Setup and Operation:

Dash 8Xe / Dash 8X Data Acquisition Recorder

Implementing PID Temperature Control Using LabVIEW. Abstract. Introduction

Maximum value. resistance. 1. Connect the Current Probe to Channel 1 and the Differential Voltage Probe to Channel 2 of the interface.

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

DSP Laboratory: Analog to Digital and Digital to Analog Conversion

Alpha 10 SERVICE MANUAL. Downloaded from MAX 10 Meter Amateur Transceiver AM/FM/CW/SSB 6 BAND PROGRAMMABLE MODEL AM-1000.

Experiment #5, Series and Parallel Circuits, Kirchhoff s Laws

Bluetooth to serial HC-06 wireless module

Cell Phone Vibration Experiment

Arduino Lesson 13. DC Motors. Created by Simon Monk

Quick Start Guide for High Voltage Solar Inverter DC-AC Board EVM. Version 1.3

LDG SLS-2 Two-Port RJ45 Switch

How To Use Multiisim On A Computer Or A Circuit Design Suite 10.0 (Aero)

By: John W. Raffensperger, Jr. Revision: 0.1 Date: March 14, 2008

TouchKit Software User manual for Windows 7 Version:

The goal is to program the PLC and HMI to count with the following behaviors:

Arduino Lab 1 - The Voltage Divider

Objectives: Part 1: Build a simple power supply. CS99S Laboratory 1

Decimal Number (base 10) Binary Number (base 2)

Data Acquisition in LabVIEW

ic-mq EVAL MQ1D EVALUATION BOARD DESCRIPTION

To perform Ethernet setup and communication verification, first perform RS232 setup and communication verification:

Resistance, Ohm s Law, and the Temperature of a Light Bulb Filament

Total solder points: 167 Difficulty level: beginner advanced DMX CONTROLLED RELAY K8072 ILLUSTRATED ASSEMBLY MANUAL

RLC Series Resonance

7-SEGMENT DIGITAL CLOCK

How to connect to a Class II router using a mobile-phone data cable specifically for Solwise & Safecom routers

Solar Energy Discovery Lab

DMX-K-DRV. Integrated Step Motor Driver + (Basic Controller) Manual

Tristan s Guide to: Solving Series Circuits. Version: 1.0 Written in Written By: Tristan Miller Tristan@CatherineNorth.com

Lab 1: Introduction to PSpice

Measuring Electric Phenomena: the Ammeter and Voltmeter

8 Channel Status Input Panel model SIP-8

LabVIEW Lesson 5 Clusters

AC 800M. EtherNet/IP DeviceNet Linking Device LD 800DN. Power and productivity for a better world TM SP1134

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

3. On the top menu bar, click on File > New > Project as shown in Fig. 2 below: Figure 2 Window for Orcad Capture CIS

LEN s.r.l. Via S. Andrea di Rovereto 33 c.s CHIAVARI (GE) Tel Fax mailto: len@len.it url: http//

Electronic WorkBench tutorial

USB to RS-422/485 Serial Adapter

ezsystem elab16m Project 1F: Alarm System (Full Project description)

PLL Frequency Synthesizer Evaluation Kit. PE3293-EK User s Manual

Electronics. Discrete assembly of an operational amplifier as a transistor circuit. LD Physics Leaflets P

Installing Remote Desktop Connection

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

PLL frequency synthesizer

DC Circuits (Combination of resistances)

RX-6 Six In - One Out All in One Receive Antenna Switch Local and Remote Control System RX6ACI User Manual Version 2.1

INF-USB2 and SI-USB Quick Start Guide

Experiment 2 Diode Applications: Rectifiers

Crown Field Support Engineering

How to connect your Victron to a computer with VE Bus Quick Configure

Fundamentals of Signature Analysis

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

Bluetooth HC-06 with serial port module Easy guide

Department of Electrical and Computer Engineering LED DISPLAY PROJECT

Dynamax Inc Copyright

GPIB Instrument Control

Installing the Software... 1 Using the System Tray Icon... 5 Restoring the System Tray Icon... 6

POINTS POSITION INDICATOR PPI4

Installing MPU-401 Compatible Cards in Windows 95

PLC training panel (Twido version)

GLOLAB Universal Telephone Hold

TEECES DOME LIGHTING SYSTEMS

STEELSERIES FREE MOBILE WIRELESS CONTROLLER USER GUIDE

Student Exploration: Circuits

Introduction to LabVIEW

Creative Inquiry Electronics Project Lab Manual. NI mydaq

Transcription:

Hands-on Lab LabVIEW NI-DAQ Digital Inputs and Outputs This lab introduces digital input and output (DIO) with LabVIEW software and USB-6211 hardware. Understanding DIO is important because one can learn to turn on/off transistors (digital output) and read toggle or tactile switches (digital input). Concept 1: Create a VI that uses a digital line to turn an LED on or off. The USB-6211 provides 4 digital input and 4 digital output lines. One of these digital output lines will be wired to a real LED (see Photo). A VI, featuring one toggle switch, will provide the graphical user interface. When executed, the user will use the mouse to toggle the switch which consequently turn the real LED on or off. Photo: USB-6211 turns LED on or off Step 1: Place an array control on the empty VI. First, right click and then select Array, Matrix and Cluster control (see Figure 1-1A). Next drag and drop this control on the front panel (gray area). Figure 1-1A: Select Array, Matrix, Cluster Control 1

Step 2: Drag a toggle switch into the Array control. Right click, select the Boolean control, and select the Vertical Toggle switch (see Figure 1-2A). Drag this switch into the Array control (see Figure 1-2B). Figure 1-2A: Select Vertical Toggle Figure 1-2B: Drag and drop into the Array Step 3: Wire up the block diagram. Invoke the DAQ Assist. In the block diagram window, right click and select Measurement I/O NI-DAQmx DAQ Assist (see Figure 1-3A). This will bring up the pop up box. Figure 1-3A: Launch DAQ Assist 2

Figure 1-3B: Select Line Output Figure 1-3C: Select port1/line0 In the pop up box (Figure 1-3B), click on Digital Output and select Line Output. The pop up box will refresh (Figure 1-3C). Select port1/line 0. This selection refers to the USB- 6211 s first digital output line (recall, digital systems often start counting with 0). One will notice the USB-6211 has four digital lines (line0 to line3). Click Finish. The pop up box will refresh (Figure 1-3D). Make sure the Generation Mode reads 1 Sample (On Demand) and click OK. Save your program as usb6211digitaloutput1_0.vi Figure 1-3D: Select 1 Sample (on Demand) and click OK 3

The pop up box will disappear and one can now drag the DAQ Assistant element into the block diagram. Select the wire tool and connect the Array element s output into the DAQ Assistant s data input (see Figure 1-3E) Figure 1-3E: Wire up the Array to the DAQ Assistant (digital output) Step 4: Physically wire up the LED circuit and run the program. Use a screwdriver to secure jumpers between the USB-6211 and solderless breadboard. Hook up the resistor and LED as shown in Figure 1-4 and refer to the schematic. Make sure LED s cathode (short leg and flat end of the colored plastic housing) is hooked up to ground Figure 1-4: Wiring photo and schematic. NB: LED s negative end (cathode) goes to ground Execute the VI by clicking the Continuous Play (arrows in a circle) button on the Front end. Toggle the switch and note the LED turning on and off. 4

Exercise 1: In LabVIEW create programs for the following: COM +'ve Photo E1-1: Wiring setup for reading current 1.1. Set a multimeter to read current (up to 400 ma). Hook up the meter s leads as shown in the figure. Toggle the switch from your Digital Output program usb6211digitaloutput1_0.vi). What current does the multimeter read? This is called a source current. 1.2. If the digital output voltage is 5 Volts and the LED voltage is 0.7 Volts, what value resistor should one use? Hint: Use the source current value with Ohm s Law. What value resistor was used in the experiment? 1.3. Search for sink current. Sketch a schematic where the USB-6211 digital line acts to sink current for the LED circuit. What are the advantages of sinking vs. sourcing current? 5

Concept 2: Digital Output Port The USB-6211 has 4 digital output lines. Together, these lines make up one port. One will invoke decimal-to-binary conversion to light up 4 LEDs in 16 different combinations. Step 1: Create a 1-D array of 32-bit unsigned integers Drop an array control into the blank VI. Next, drop a numeric control into the array as shown in Figure 2-1A. Move the mouse cursor over the numeric control to highlight it. Right click and select Representation. Select U32, which means unsigned 32-bit integer (see Figure 2-1B). Figure 2-1A: Create an array of integers Figure 2-1B: Select unsigned 32-bit integers Step 2: Create the Block Diagram. Select the DAQ Assistant (recall Concept 1 Step 3). This time, select Port Output. Figure 2-1A: Select Port Output Figure 2-2B: Select port1 6

Make sure the Generation Mode is set to 1 Sample (On Demand). See Figure 2-2C. Finish by wiring the Array s output to the DAQ Assist s data input (see Figure 2-2D). Save your program as usb6211digitaloutputport1_0.vi Figure 2-2D: Wire Array and DAQ Assist Figure 2-2C: Select 1 Sample (On Demand) Step 3: Breadboard all 4 LEDs using the USB-6211 s 4 digital output lines. Connect Ports P1.0 (pin 6) through P1.3 (pin 9) to resistors and LEDs as shown in Figure 2-3. Click the continuous play button. Cycle the numeric control from 0 to 15 to light LEDs. Figure 2-3: USB-6211 4-bit digital output port 7

Exercise 2: 2-1. For usb6211digitaloutputport1_0.vi what happens over the numeric control is set to 16? What is this? 2-2. To light LED #0 and LED #3, what is the numeric control number? Hint: binary to decimal conversion. 2-3. Write a LabVIEW program with a For-Next structure that runs from 0 to 15 and lights up the LEDs in binary fashion. Hint: Use the Build Array element in the block diagram. Save as usb6211digitaloutputportwhileloop1_0.vi Concept 3: Digital Inputs The USB-6211 also features 4 digital input lines. These can be configured to sense binary states. Here, +5 Volts in a digital input line denotes a HI state. GND (or close to 0 Volts) connotes a LO state. As such, the position of a binary device, like a SPST toggle switch, can be sensed. Step 1: Employ an LED which will light if the digital line is +5 Volts Refer to Figures 3-1A and 3-1B to create the front panel and block diagram respectively. The 1- D array in the front panel is created by dropping a Boolean LED into it. The DAQ Assistant is configured with Acquire Signals Digital Input Line Input and port0/line0. The Acquisition Mode is set for 1 Sample (On Demand). Save the program as usb6211digitalinput1_0.vi Figure 3-1A: 1-D Array of Boolean LED Figure 3-1B: Digital Input setup 8

Step 2: Wire a +5V digital input The USB-6211 has a built-in +5 Volt supply (on Pin 10). Refer to Figure 3-2 and execute the program. When Pin 10 is brought to Pin 1 (digital input P0.0), the front panel LED will light. Exercise 3 Figure 3-2: Wiring up a digital input line 3-1. Write and demonstrate a LabVIEW program that tells the user the state of all 4 digital input lines. Build upon usb6211digitalinput1_0.vi to include 4 LEDs. 3-2. Consider the following schematic. Why is this the preferred method to set a digital input line HI or LO? Hint: a non-connected digital line does not mean GND. Figure E3-2: Preferred setup for digital inputs 9