Physics 3100 Electronics, Fall 2008, Digital Circuits 1 LabView Exercises: Part III The working VIs should be handed in to the TA at the end of the lab. This is a lab under development so we may experience some “glitches” the first time through. Please bear with us. Initializing the NI 6251 and SCC68s The NI 6251 Multifunction I/O allows rapid analog to digital conversion and input to the computer as well as rapid Digital to Analog conversion and output from the computer via the USB port. It also provides digital I/O capabilities as well as some timer functions. We have interfaced this device to an SCC68 box containing analog and digital buffers to protect the sensitive inputs and outputs of the 6251. These two devices are connected by a 37 pin cable. The banana plugs and BNC connectors which we have added to the SCC68 provide a convenient interface to the student’s experiments. Exercise 1: Using MAX to initialize the NI 6251 The first time this hardware is used on any given computer it must be initialized. The Measurement and Automation Explorer (MAX) software provides an easy way to identify the NI hardware connected to the computer. Follow the following steps: 1) Once you are sure that the NI 6251 and SCC68 are correctly connected and powered on, launch MAX by double clicking on its icon on the desk-top.
34
Embed
LabView Exercises: Part III - Physics, University of Guelphjdavis/phys3100/labs... · 2008-11-17 · LabView Exercises: Part III The working ... 2) On the left side of ... USB has
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Physics 3100 Electronics, Fall 2008, Digital Circuits 1
LabView Exercises: Part IIIThe working VIs should be handed in to the TA at the end of the lab.
This is a lab under development so we may experience some “glitches” the first time through. Please bearwith us.
Initializing the NI 6251 and SCC68sThe NI 6251 Multifunction I/O allows rapid analog to digital conversion and input to the computer as wellas rapid Digital to Analog conversion and output from the computer via the USB port. It also providesdigital I/O capabilities as well as some timer functions. We have interfaced this device to an SCC68 boxcontaining analog and digital buffers to protect the sensitive inputs and outputs of the 6251. These twodevices are connected by a 37 pin cable. The banana plugs and BNC connectors which we have added tothe SCC68 provide a convenient interface to the student’s experiments.
Exercise 1: Using MAX to initialize the NI 6251
The first time this hardware is used on any given computer it must be initialized. The Measurement andAutomation Explorer (MAX) software provides an easy way to identify the NI hardware connected to thecomputer. Follow the following steps:
1) Once you are sure that the NI 6251 and SCC68 are correctly connected and powered on, launch MAXby double clicking on its icon on the desk-top.
Physics 3100 Electronics, Fall 2008, Digital Circuits 2
2) On the left side of the window which MAX opens you will see a column entitled “Configuration”.Double-click on “Devices and Interfaces” to expand the sub-category (or click on the ‘+’ box). Double-click on NI-DAQmx Devices. The expanded sub-category should show an NI USB-6251 (Mass Termi-nation): “Dev xx” (there will only be one such entry for your computer).
3) Click on the NI USB 6251 entry (it should be showing a green circuit board on the left to indicate thatit is connected).
4) Click on the Properties tab at the centre top of the window. This will open a “Device Properties”dialog box. On the Accessory tab which is displayed there will be a check-list. Scroll down the list tofind SCC-68 as shown. Click on SCC-68 and on “OK”.
Physics 3100 Electronics, Fall 2008, Digital Circuits 3
5) Now click on the tab “Test Panels..” at the top of the window to display the test panel dialog box.
This panel will allow you to test the functioning of your NI 6251 and the SCC 68 which is connected
Physics 3100 Electronics, Fall 2008, Digital Circuits 4
to it.
6) Begin by testing the Analog Input channels (the first tab). The channels which are connected via theSCC 68 are Dev*/ai4 and Dev*/ai12. First select Channel Name Dev*/ai4 and set up the testfor Continuous Mode, and the RSE Input Configuration, as shown below.
If there is no signal source connected to the BNC connector labelled AI0 on the SCC 68 the displaychart should show noise similar to that displayed on the figure when you press Start.
6) Connect the output from your function generator to the input AI0 BNC connector. Since the acquisitionrate specified in the test panel is 1000 Hz (see figure above) your function generator frequency shouldbe set to a frequency which is less than 500 Hz. (You must sample at least twice as fast as thehighest frequency of interest..this is the sampling theorem). Choose a suitably low frequency. Also,the input should have an amplitude less than 10 volts. If the output displayed on the panel is as you’dexpect, click on STOP and perform the same test on Channel Name Dev*/ai12 using the same setup parameters. If both channels pass this test, move on to the Analog Output test by clicking on theAnalog Output tab at the top of the window.
7) Connect the Dev*/ao0 output from BNC AO0 on the SCC 68 to your oscilloscope. Set up channel 0as shown below
Physics 3100 Electronics, Fall 2008, Digital Circuits 5
You should see a sine wave on your oscilloscope. Change the amplitude and frequency to verify thateverything is working correctly then repeat the test using Dev*/ao0 and the AO1 BNC connector.
8) Finally, click on the“Digital I/O”tab at the top of the window and test the 4 output and 4 input digitallines. These are connected to the coloured banana jacks and are labelled DO0 through DO3 and DI0through DI3. Set up the test panel as shown below, using port1 and click on “Start”. Lines 0 through3 are assigned as inputs while those from 4 through 7 are outputs. All 8 lines are connected internallyto pull-up resistors so the 4 input lines )bits 0 through 3) show up as “high” unless something pullsthem down. Connect any of the 4 lines DI0 through DI3 to ground using a wire with banana plugsand the corresponding circular green “light” on the test panel should go dark.. Next, connect one ofthe output lines DO0 through DO3 to an LED (use a 1 kΩ series resistor). Then using the test panel’sslide switches you should be able to turn the LED on and off. This demonstrates that the digital I/Ois working. After you have completed these tests you may continue with the next exercise.
Physics 3100 Electronics, Fall 2008, Digital Circuits 6
Exercise 2: Data Acquisition Using the NI USB-6251plus SCC 68The National Instruments USB-6251 provides 16 single-ended or 8 differential channels of analog input. Itdoes this using a single 16-bit analog to digital converter capable of digitizing at a maximum rate of 1.25MHz. The 16 channels are provided by multiplexing the input to this A/D converter. If more than onechannel is used the maximum aggregate sampling rate is 1.0 MHz (i.e., 500 kHz per channel for 2 channels,etc). It also provides two separate 16 bit analog output channels which can operate at up to 2.86 MHz for asingle channel or 2.0 MHz aggregate for two channels. See the attached data sheet for detailed specifications.
The NI SCC 68 provides the interface between the NI 6251 and the user’s experiment. We have enabledtwo analog input channels, channel ai4 and ai12 each of which is buffered by an Analog Devices OP249op-amp to provide operation over the full range of specifications of the NI 6251. The two digital outputsare also buffered by OP249’s operating with a series 51 Ω resistor to protect against short-circuits on theoutputs. Finally, we provide 4 digital input lines (port 1, bits 0 to 3) and 4 digital output lines (port 1, bits4 to 7) which are buffered by a 74LS244. There is a 560 Ω pull-up resistor on each digital input and output.
The NI USB 6251/SCC 68 combination is a flexible and powerful data acquisition and control systemand the exercise described below is an introduction to using such a system.
Physics 3100 Electronics, Fall 2008, Digital Circuits 7
Exercise 2: Data Acquisition using the A/D Converter
In this exercise you will build a LabView VI for acquiring data from the two analog input channels ai4 andai12. The VI allows you to change the sampling rate and to save the data to an“.lvf”file. (This is LabView’stext formatted data file format.)
Launch LabView and, under “New”, click on “Blank VI”. Decorate your front panel as shown below.
The corresponding block diagram should be as shown in the next figure.
Physics 3100 Electronics, Fall 2008, Digital Circuits 8
You will notice that the block diagram contains three loop structures: the outermost loop is a while loopwhich terminates only when the “STOP” button is pushed, the large inner loop is a “Case” structure whichexecutes every time you press the “READY” button. The small inner loop executes when you push the“Save?” button and saves the data to a file.
When you place the“DAQ Assistant”on the block diagram you will need to configure the physical channelbeing used (dev*/ai4). The configuration dialog box should open when you place it on the block diagram. Ifit doesn’t, right click on the icon and, from the menu displayed, select “Properties”. Set up channel dev*/ai4as shown.
Physics 3100 Electronics, Fall 2008, Digital Circuits 9
This VI allows you to collect “# of samples” data points at “Sampling Rate”. If you connect a sine waveto the AI0 input channel. The sampled data is displayed on the front panel graph. If you like the look ofthe data you can save it by pressing “Save?”.
Save a set of data and open the .lvm file with Windows NotePad to see the organization of the data file.Once your VI is working, save it to give to the TA. Then, click on “Save As” and choose “Substitute Copy
for Original” and give it a new name so that you can modify the VI for the next exercise.
Physics 3100 Electronics, Fall 2008, Digital Circuits 10
Exercise 3: Generating a Square Wave Output using the D/A Converter
If you modify the VI as shown by the Front Panel and Block Diagrams below, you will be able to generateand output a waveform which you can use to excite some external circuit. The A/D converter can then beuse to view the excitation and the response.
Physics 3100 Electronics, Fall 2008, Digital Circuits 11
As an example we suggest using a “square wave” excitation of an RLC circuit. Set up the D/A converterto provide a 50 Hz square wave, amplitude of 4 v. using a size of 1024 samples. This output should beconfigured to appear at Physical Channel Dev*/ao0. Build an RLC resonant circuit as shown
Use the output of the D/A (from BNC AO0) as Vi. Connect AI0 to the input side of the RLC circuit andconnect AI1 to the output side of the circuit.
When you click on the READY button, the VI generates roughly a single cycle of the square wave whichresults in a 4 volt step at the input to the resonance circuit. The circuit then rings at its characteristicfrequency ω0 = 1/
√LC. The ringing decays rapidly with time because of the internal resistance of the wire
used to make L1. Measure the frequency of the ringing and estimate the decay time.Save the VI and give the results to the TA.
Requirements and Compatibility | Ordering Information | Detailed Specifications | Pinouts/Front Panel Connections
With recent bandwidth improvements and new innovations from National Instruments, USB has evolved into a core bus of choice for measurement and automation applications. NIM Series high-speed devices for USB deliver high-performance data acquisition in an easy-to-use and portable form factor through USB ports on laptop computers and otherportable computing platforms. NI created NI signal streaming, an innovative patent-pending technology that enables sustained bidirectional high-speed data streams on USB. Thenew technology, combined with advanced external synchronization and isolation, helps engineers and scientists achieve high-performance applications on USB.
M Series high-speed multifunction data acquisition (DAQ) modules for USB are optimized for superior accuracy at fast sampling rates. They provide an onboard NI-PGIA 2amplifier designed for fast settling times at high scanning rates, ensuring 16-bit accuracy even when measuring all available channels at maximum speed. All high-speed deviceshave a minimum of 16 analog inputs, 24 digital I/O lines, seven programmable input ranges, analog and digital triggering, and two counter/timers. USB M Series devices are idealfor test, control, and design applications including portable data logging, field monitoring, embedded OEM, in-vehicle data acquisition, and academic. High-speed NI USB-625x MSeries devices have an extended two-year calibration interval.