Data Acquisition and Auto Lab Report
Ahmed Hassanein 1
CPEG 331L – Lab 4
Introduction to Analog I/O with cDAQ Aim
• Interface the DAQ Chassis and Analog I/O modules
• Understand voltage levels and AC signals
• Manipulating data using LabVIEW
Applications
• Multimeters
• Alarms & Sirens
• Automated monitoring system
• Metronomes
Exercise 1 – Analog Input/Output
In this exercise you will experiment with the different modules to acquire analog inputs.
1. Connect a simple LED circuit as shown in Figure 1 and 2.
Figure 1 – Simple LED Circuit Figure 2 –MultiSim LED Circuit
2. Connect the Analog Output 9263 module to the chassis and make sure that it is set to sample on
demand when configuring it with the DAQ Assistant.
3. Connect the 9923 terminal block to the Analog Input 9207 module. Please refer to Figure 3 for
wiring of the connections. In order to power the 9207 module, an external power supply needs
to be used, however we are using the 9263 module for this purpose.
4. Connect AO0 and COM from the Analog Output module to lines 32 and 9 on the 9923 respectively,
which as seen in Figure 3 are Vsup and COM.
5. Next you will need to connect 2 wires to lines 33 and 29 which are also another set of Vsup and
COM, but those will be used to power our circuit as shown in Figure 1.
6. As for the analog input, connect 2 wires to lines 1 and 20 for AI0+ and AI0-.
Ahmed Hassanein 2
Figure 3 – 9207 Module
7. Setup your LabView VI as shown in Figure 4. DAQ Assistant should be set for voltage output and
samples on demand with an added control. DAQ Assistant2 will be the Analog Input module, set
it up to have samples on demand and add a numeric indicator to it. The stop button runs under
the DAQ assistant and is connected to the red button. It is not connected to the DAQ assistant
itself.
Figure 4 – Block Diagram and Front Panel For Ex. 2
8. Connect line 20 to the common ground of the circuit and Connect line 1 to node 1 as labelled in
Figure 2.
9. Run the VI and set data to 5V. Observe the value read by the analog input module. Move line 1 to
node 2 and then node 3.
10. What do you notice about the values? What device is the cDAQ emulating?
Ahmed Hassanein 3
Exercise 2 – Data Manipulation in LabVIEW
In this exercise you will create a VI that generates a random number between 0 and 5 before sending it
as an analog output. The analog input module will receive this number and multiply it by 2. The final
value is then compared with the original value (which is 5). If the final value is greater than 5, an LED
turns on. Otherwise, the LED remains off.
1. Connect an Analog Output from the NI 9263 Modules directly to an Analog Input on the 9207
Module via the terminal. 2. Setup all DAQ Assistants for sampling on demand.
3. Create a control for the output but multiply it by a random number before passing it to the DAQ
Assistant.
4. For the Input module multiply the data in by 2 and create a numeric indicator for it.
5. Compare the original value sent with the received value multiplied by 2 and create an indicator
to turn on if the received value is larger than the sent value.
6. Add a delay of 100 ms in each frame of the sequence.
7. Your final Block Diagram and Front Panel should be similar to Figures 5.
Figure 5 – Block Diagram and Front Panel For Ex. 3
Exercise 3 – Passive Buzzers
The passive buzzer in the lab is controlled by a digital signal of varying frequencies. In this exercise we will
use the 9263 module to produce a digital output. This is possible since we can keep the analog output at
a specific voltage. Furthermore, frequency manipulation in LabVIEW is much simpler with analog
components.
1. Connect your buzzer with any channel from the Analog Output module. Please make sure you use
the correct polarity (+ and -) on the buzzer.
2. Once your circuit is complete, create a new VI on LabView. Add one DAQ assistant to generate a
voltage analog output and set the generation mode to sample on demand.
Ahmed Hassanein 4
3. Add a Simulate Signal box to your block diagram and change it to a square wave. Add controls for
amplitude, frequency and offset. Chang the text box for frequency to a slider with a range from
0-5000. Connect the Simulate Signal block to the DAQ Assistant block. Your final block diagram
and front panel should be similar to Figure 7.
Figure 7 – Block Diagram and Front Panel for Buzzer Exercise
4. Ensure there are no syntax errors in your design and that your amplitude and offset are set
accordingly. Run your design and observe the change in sound as you drag the slider on the
frequency controller.
Exercise 4 – Alarm/Siren
Using sequences, exercise 3 can be adjusted to create a VI that continuously alternates the buzzer
between 2 frequencies.
1. Replace the frequency control with a constant and place it in a sequence of 2 frames.
2. Use a different value in each frame.
3. Make sure the buzzer’s output at these frequencies are distinguishable by ear.
4. Add an appropriate delay between both tones.
Optional Exercise – Voltage Monitoring System with Alarm
1. Add an analog output to your VI from exercise 4.
2. Wire the analog output from the 9263 module to the 9207 module as analog input.
3. Add an analog input to your VI from exercise 4.
4. If the analog input exceeds 5V an alarm should turn on.
5. On the front panel, a red LED should also turn on if the input exceeds 5V.
6. Otherwise a green LED should be on in the front panel.
Ahmed Hassanein 5
Optional Exercise – Metronome
1. Use the buzzer to create a musical metronome.
2. There should be 3 ticks of the same tone followed by a 4th tick of a different tone.
3. Add a slider on your front panel to control the speed of the metronome in beats per minute.
Report
Please prepare a report with the following requirements:
• Aim of the experiment
• Application of the experiment
• Introduction (1 to 2 paragraphs)
• Experiment Details
o Screenshot of your Front Panels
o Screenshot of your Block Diagrams
o A few paragraphs explaining the steps, configurations and changes you made to each
component, the operation of your device
o Answers to the questions in Exercise 1
• Discussion
o What did you learn?
o Any issues you faced?
o What are your thoughts on analog IO with LabView and cDAQ?
o How does a piezo buzzer operate?
o What was the frequency range for the buzzer you used in the lab?
o Compare Exercise 2 Data Manipulation tools in LabVIEW to other software such as
Arduino’s IDE in C, MATLAB or SimuLink. How easy is it to generate random numbers
and perform operations on inputs using LabVIEW compared to those examples?
• Conclusion (1/2 page)