Labview Lab 2. Vern Lindberg. April 16, 2012

Similar documents
Certified LabVIEW Associate Developer Exam. Test Booklet

CLAD Sample Exam 03. C. A control that output a cluster of the controls / indicators on the tabs.

Computer Interfacing Using LabView

Dept. of Electrical, Computer and Biomedical Engineering. Data Acquisition Systems and the NI LabVIEW environment

Arrays. Collection of data elements that are of same type

Small rectangles (and sometimes squares like this

Exercise 0 - Open and Run a Virtual Instrument (Slide 12)

OpenStax-CNX module: m Thermometer VI * National Instruments

Introduction to LabVIEW Exercise-1

Lab 4 - Data Acquisition

Lab Exercise 2: Data Acquisition with NI LabVIEW

Certified LabVIEW Associate Developer Examination

ME 365 EXPERIMENT 3 INTRODUCTION TO LABVIEW

Homework Assignment 9 LabVIEW tutorial

Certified LabVIEW Associate Developer Examination

CLAD Sample Exam 06. B. Panel Resize. C. Panel Close? D. Value Change

EK307 Lab: Microcontrollers

Speed Control of A DC Motor Through Temperature Variation Using NI ELVIS LabVIEW

Virtual Instrumentation With LabVIEW

2. The LabView Environment Two panes will open, one is the Front panel, and one is the Block Diagram

Labview for Everyone (National Instruments Virtual Instrumentation Series) Jeffrey Travis

Onwards and Upwards, Your near space guide Overview of the NearSys Two Sensor Temperature Array Figure 1. A complete Two Sensor Temperature Array

Figure 1. A complete Temperature Sensor

INTRODUCTION TO LABVIEW

Introduction to National Instruments LabVIEW and Data Acquisition (DAQ)

c01.qxd p /18/01 11:03 AM Page 1 Fundamentals

Virtual Instrumentation With LabVIEW

CLAD Sample Exam 04. B. When you create an Array constant on the Block Diagram, it is not visible on the Front Panel.

Learn LabVIEW 2010 / 2011 Fast

Read Temperature Data

Data Acquisition Laboratory

Determination of Drag Coefficient

Labview. Masood Ejaz

Hands-on Lab 2: LabVIEW NI-DAQ Basics 2

Today. 4/5/11 Physics 262 Lecture 10 Questions about Exams Homework. Lab: Continue project. Lecture. Review your exams and review practice exam again.

CLAD_80.questions.

EE 100 DMM and DC Power Supply LabVIEW Experiment Guide

PHYC 500: Introduction to LabView. Exercise 16 (v 1.2) Controlling hardware with DAQ device. M.P. Hasselbeck, University of New Mexico

NAME EET 2259 Lab 3 The Boolean Data Type

CS 150 Lab 3 Arithmetic and the Debugger. Lab 3.0 We are going to begin using the Visual Studio 2017 debugger to aid with debugging programs.

Experiment 1 Electrical Circuits Simulation using Multisim Electronics Workbench: An Introduction

Electronics II Physics 3620 / 6620

Student Quick Reference Guide

Lesson 4 Implementing a VI

DC Circuit Simulation

Learn the three palettes. Learn how data is passed in LabVIEW. Create a subvi using two different methods.

PHY 351/651 LABORATORY 1 Introduction to LabVIEW

TECH 3821 Lab #2 Relay Driver with Computer Control

Introduction to Labview and Temperature Measurement

Hardware: Acquiring Data and Communicating with Instruments

ME 224: EXPERIMENTAL ENGINEERING. Lecture 2

LabVIEW Tutorials. T.1 Temperature Measurement and Cold Junction Compensation (CJC) LUMS School of Science and Engineering

Pre-Laboratory #Boolean Expressions ECE 332

The LabVIEW Programming Environment and Basic Operations

Chemistry Excel. Microsoft 2007

1. Learn about LabView software and its different components

Microsoft Excel Lab: Data Analysis

Exercise 5: Basic LabVIEW Programming

ENGR 210 Lab1. Ohm's Law

REQUIRED MATERIALS Epiphany-DAQ board Wire Jumpers Switch LED Resistors Breadboard Multimeter (if needed)

Agilent 3630A Triple DC Power Supply. Agilent 34401A Digital Multimeter (DMM)

Part 1. Creating an Array of Controls or Indicators

Certified LabVIEW Associate Developer Exam. Test Booklet

Lab 4: Introduction to ELVIS II+ Introduction to ELVIS II+

Introduction to MATLABs Data Acquisition Toolbox, the USB DAQ, and accelerometers

NI LabView READ THIS DOCUMENT CAREFULLY AND FOLLOW THE INSTRIUCTIONS IN THE EXERCISES

EKT 314/4 LABORATORIES SHEET

Section 1 Establishing an Instrument Connection

Strain and Force Measurement

Page 1 of 6. ME 3200 Mechatronics I Laboratory Lab 2: LabView Computer Systems. Introduction

University of Illinois Department of Electrical and Computer Engineering ECE 451 Automated Microwave Measurements Laboratory

B. Including the Event Structure within a loop. C. Configuring a Timeout case within the Event Structure

Engineering Project-I. Module 1: Familiarization of LabVIEW and the Vernier Toolkit

Teaching Computer-Based Data Acquisition and Analysis Research Skills Using LabVIEW

Tutorial 3: Using the Waveform Viewer Introduces the basics of using the waveform viewer. Read Tutorial SIMPLIS Tutorials SIMPLIS provide a range of t

Lab 1: Getting familiar with LabVIEW: Part I

Ch En 475: Introduction to Instrumentation and Signal Processing with Labview

Arrays are lists of elements of the same data type. They are analogous to arrays in traditional languages.

PHYS 5061 Lab 1: Introduction to LabVIEW

ni.com Preparing for the CLAD Exam

Outline. More on Excel. Review Entering Formulas. Review Excel Basics Home tab selected here Tabs Different ribbon commands. Copying Formulas (2/2)

Download Instructions

Dept. of Electrical, Computer and Biomedical Engineering. Instrumentation for the data acquisition laboratory

A Simple & Economical Method For Reading A Thermistor With An EtherMeter.

Appendix C. Vernier Tutorial

Hands-On Introduction to. LabVIEW. for Scientists and Engineers. Second Edition. John Essick. Reed College OXFORD UNIVERSITY PRESS

OVERVIEW GOALS KEY TERMS

1

Advanced Programming Features

Excel Tables and Pivot Tables

LabVIEW Advanced for 7.0 Manual Course Errata

University of Florida EEL 3701 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering Revision 0 12-Jun-16

Excel 2016 Basics for Windows

ECE 451 Automated Microwave Measurements Laboratory. Experiment No. 2. Automated RF Power Detection Using LabVIEW

Wiring guide for dual-output vibration and temperature sensors

Lab 03: Edge Detection Tutorial

Create a worksheet that collects, displays and saves temperature data

Experiment 10 Fall 2012

Analytical Instrumentation

University of Florida EEL 3701 Dr. Eric M. Schwartz Madison Emas, TA Department of Electrical & Computer Engineering Revision 1 5-Jun-17

Transcription:

Labview Lab 2 Vern Lindberg April 16, 2012 1 Temperature Measurement Thermistors are sensitive semiconductor devices that can measure temperature over a restricted temperature range. The thermistors we will use are good around the range -50 to 100 C. Nominal resistance at room temperature is 10 kω. In this first step of a two week lab you will design a vi that will read voltage and compute the resistance of the thermistor, and from that compute the temperature using the Steinhart- Hart equation, 1 T = A + B ln R + C(ln R)3 (1) The circuit is almost trivial, a 10 kω resistor in series with a thermistor, powered by 5 V. The 5 V is a nominal value i.e. it not guaranteed to be exactly 5. Although the voltage is not known exactly, the precision resistor, of value R P, can be measured, and the resistance of the thermistor can be found by a simple ratio, R therm = V therm V resist R P (2) Available on the circuit board are a fixed +5V supply and also some banana jacks. At the top left of the board are the analog inputs. In software these are called ai0 etc., but on the circuit board each voltage channel needs two inputs called ACh0+ and ACh0. These are floating inputs, meaning that neither end is connected to ground and that a differential voltage can be measured. Today you will build the circuit from scratch, meaning that you will need to tell the program where the signals originate. The banana jacks are accessed by the breadboard pins called Banana A and Banana B. The thermistor is in a separate box that will be connected to the banana jacks. 1

The hook-up is schematically shown in Figure 1. The arrows in the On Board portion of Figure 1 are hook up wire jumpers, The arrows from the thermistor are banana cables. The precision resistor is nominally 10 kω. Connect the two sides of the resistor to channel ACh0 and the two sides of the thermistor to the ACh1. Figure 1: Voltage Divider using a thermistor. BA and BB are banana jacks. The circled resistor is the thermistor. Use a 10 kω precision resistor. 2 The Read and Calculate Loop The rest is done in software. 2.1 Reading the Voltages (a) Start a new VI with a big While loop in place. (b) Add code so that you can control the rate at which you take data. Start with collecting data every 0.25 seconds. Compute the time in seconds and make an indicator inside the loop to show running time. 2

(c) To collect the data you must access the DAQ board. Add a DAQ assistant from the Express/Input panel, another window will pop up. Choose Acquire Signals, Voltage, and select ai0 and ai1 for the two voltage inputs. The next window lets you specify parameters for the ADC: Call one ResistorVoltageACh0 and the other ThermistorVoltageACh1 (no spaces are allowed in the names). They should both be 0 to 6 V, differential, and 1 sample on demand. (d) Each time through the loop a measurement is made resulting in two numbers, the voltage across the resistor and the voltage across the thermistor. The output of the DAQ is of type DDT (dynamic data type) that has two channels. We need to separate these and get floating point values of each. I have found two ways to do this pick one. (i) Place two From DDT icons, both wired to the DAQ output. From the Configure Menu that pops up, pick Single Scalar, and make the resistor voltage channel 0 and the thermistor voltage channel 1. (Alternately wire constants 0 and 1 to the Channel Input of the From DDTs.) If the From DDT is already in place you can double click on it to get the Configure Menu. (ii) Less elegantly, insert a Split Signals icon from the Express menu and wire to the DAQ output. Place two From DDT icons from the Express menu, one wired to the top of the split signals (ACh0 ) and one to the bottom (ACh1 ). The icons should be Single scalars representing the two voltages. (e) It is a good idea to debug and check as you go. Be sure the DAQ and Elvis are on. Create indicators for the two voltages and run. Add the two voltages that should be the constant 5 V supply. Place a Waveform Chart on the front panel and wire the thermistor voltage to it. Place your finger on the thermistor for a few seconds and stop the program. As the temperature increases, you should see one voltage increasing and one decreasing. Once you know that the VI works, you may delete any of these indictors, 2.2 Computing the resistance and temperature Equation 2 and Equation 1 give the means of calculating the temperature. (a) Compute the resistance. Measure the value of your nominal 10 kω resistor with a multimeter. From the two readings of voltages and this resistance, you can determine the resistance of the thermistor with Equation 2. 3

Use a Mathematics Scripts&Formulas Formula Node. Right click on a boundary and Add inputs and outputs, naming each of them. Inside the formula node write the equation, ending with a semicolon. Your formula might look like RT=Rp*VR/VT; Avoid writing in the value of the precision resistor in the formula, instead create a constant outside with its value. That way it is easy to find and change if the precision resistor is changed. (b) Use another Formula Node and compute temperature using the Steinhart-Hart Equation 1 using A = 1.03245 10 3, B = 2.38582 10 4 and C = 1.58647 10 7, (all in K 1 ), where the resistance is in Ωs. The resulting temperature is in K. (I may be off on these constants a little bit, but am close. ) Also compute the temperature in Celsius and Fahrenheit. HINT: Make constants outside the Formula Node for A, B, and C, in these constants scientific notation for A is written 1.03245E-3. Inside the formula node you use +, -, *, /, and ** for the mathematical operations, and can use ln for the natural log. (c) Place a Waveform Chart on the front panel and place inside the loop to display the celsius temperature. (d) Run the program and make sure that it works as desired. 3 Displaying the results and Saving Data (a) Inside the loop build the array that will eventually be saved in an Excel file. Use a Build Array icon, enlarge it to have 4 inputs, make the first the time, the second the kelvin temperature, the third the celsius temperature, and the fourth the fahrenheit temperature. Connect the output of this array to an indexed tunnel. (b) Since the data are collected in equally spaced intervals, a Waveform Graph is suitable. Bring time to a non-indexed tunnel, kelvin, celsius, and fahrenheit temperatures to indexed tunnels. Place a Waveform Graph outside the loop and add the bundle that is suggested by the context help for the Waveform Graph. Plot fahrenheit (or celsius, your choice) temperature versus time outside the loop. Run the VI and touch the thermistor to change its temperature. (c) Finally write code to save the file. This is an involved process. (i) First you must tell the computer where to store the data. Place a FileI/O File Constants Path Constant outside the loop. In your Documents folder/library 4

create a folder to hold the data files. Right click on the Path Constant and Browse for Path and locate folder you just created. Click Current Folder and the path to that folder is created. (ii) Create a File Name: Deposit a String Control on the front panel, and a string constant.xls on the block diagram. Place a Strings Concatenate Strings on the block diagram and wire the file name and extenstion to the two inputs. (iii) Place a File I/O Build Path and wire the Path Constant to the base path, and the concatenated filename to the name inputs. (iv) From the File I/O menu deposit Open/Create/Replace File, Write Text File, Close File icons. The inputs to the Open... icon are the appended path from the Build Path, and an operation input. Create a constant at the operation input and choose Create from its pull down list. Connect the refnum out to the file input on the Write to Text, and the error out to the error in. Connect the refnum and error lines between the Write to Text and the Close File. Finally, place a Dialog and User Interface Simple Error Handler and connect the error out of the Close File to the error handler (v) Final step! The array data must be converted into a form that can be written to the file. Place a String Array to Spreadsheet String near the tunnel for the array. Connect the array to the array input (duh!). Connect the spreadsheet string to the text input of the Write to Text file. Create a constant at the format string input of the Array to Spreadsheet and make it %.2f, that is a floating point number with 2 digits after the decimal point. Put in a file name, then run your program, changing the temperature of the thermistor, stop it, locate the file in the folder you prepared, and open and it should open in Excel (after a prompt from Microsoft.) Run a second time with the same filename and see the error that results. As written the program Creates a file, and if that file already exists tells us of the error. We will discuss ways to reduce this aggravation in class. Add comments and adjust the layout so that your vi is neat. Print the front panel and block diagrams and place into your labbook. Be sure to save your vi, then save a copy to a new name. 5

In class we will (or have already) discuss a few other nice features that could be added to the saving process, namely Add the hour, minute, second to your file name so it will be unique (e.g. File132508.xls) Add date and time automatically to your file Add a comment to the file, such as Temperature of coffee as it cools Add column headers to your file 4 Subvis Saving data is a regular task, and regular tasks should be sub-vis. Then your main VI should read the voltages, compute thermistor resistance and determine the temperature. A subvi should take care of saving the data. Before doing any coding list the desired inputs to the subvi. In this case they would be (a) path (b) file name (c) format of data, and (d) data (and eventually Comments, and Headers.) Make sure that the labels for your controls are meaningful, since that is the lowest level of documentation. Move these 4 elements on the block diagram to the left, and the rest of the writing portion of the program to the right. Drag around all elements of the writing portion not including the 4 inputs (but the.txt, Concatenate, File opening, writing, closing and error handling and the Array to Spreadsheet should be included), then use Edit pull down menu and Create Sub VI. The selected elements should disappear and a new icon appears. Double click on this new icon to see the front panel and block diagram just for it. Right click on the connector pane (upper right corner icon) and you can edit the icon. Right click on the icon, go to VI Properties, use the category pull down menu to go to documentation, and add a brief description. This will appear in the contextual help. Save the subvi, then save your main vi. 6