View Paper

advertisement
Virtual Instrument for the Study of the Signals Generating
Mihai Bogdan
Computer Science and Electrical Engineering Department,
Lucian Blaga University of Sibiu, 550025, Romania,
E-Mail: mihai.bogdan[at]ulbsibiu.ro
Abstract
This paper aims to achieve a virtual instrument, developed around NI myDAQ of National
Instruments Company, for the study of the signals generating. Virtual instrument have been
developed by using LabVIEW graphical language programming. This virtual instrument will
assist students who will conduct laboratory at Virtual Instrumentation discipline and will
generate several waves: sinusoidal, triangle, square and sawtooth. These signals will be
generated at AO 0 analog output channel of DAQ device.
Keywords: Virtual instrument, LabVIEW, NI myDAQ, Front Panel, Block Diagram
1 Introduction
In the past 20 years, measuring systems have experienced a radical change, a revolution, in
which the computer has the leading role. In more than 20 years ago, serial communications (RS232 and GPIB) enabled computer for the first time to become a part of measuring systems
(http://www.energ.pub.ro/).
By using the computer as a central "controller" for all instruments of measuring system, they
were able to integrate and coordinate multiple measurement instruments in a single system.
Signal generators are electric devices that are used as time variable voltage sources with a
specified waveform and adjustable amplitude and frequency. These instruments are used in
electrical laboratory in controlling, adjusting or measuring the electrical signals (Rob et al, 2011).
Modular acquisition boards (DAQ) appearance, eliminated the need for coupling to a dedicated
processor and memory existence within integrated programs and independent measuring
instruments. The advantages of DAQ cards were: computer components have become smaller,
decreased costs and increased performance of measuring systems.
National Instruments produce a wide range of DAQ cards, which generally used for acquiring
and generating signals. These cards usually have a few numbers of analog inputs/outputs, digital
inputs/ouputs, counters and frequency generator with hardware/software timing. Many devices
have a test panel for testing specific device functionality, such as the ability to acquire and
generate signals.
LabVIEW programs are called virtual instruments, or VIs, because their appearance and
operation imitate physical instruments, such as oscilloscopes, multimeters and spectrum analyzer.
LabVIEW contains a comprehensive set of tools for acquiring, analyzing, displaying, and storing
data, as well as tools to help you troubleshoot code you write. In LabVIEW, you build a user
interface, or front panel, with controls and indicators. Controls are knobs, push buttons, dials, and
other input mechanisms. Indicators are graphs, LEDs, and other output displays. After you build
the user interface, you add code using VIs and structures to control the front panel objects. The
block diagram contains this code (http://www.ni.com/pdf/labview/us/getting_started_820.pdf).
The 10th International Conference on Virtual Learning ICVL 2015
351
2 The Signal Generator VI
Using NI myDAQ device, acquired from National Instruments, we have created a virtual
instrument for generating different types of signals (sine, rectangle, triangle, and sawtooth) as well
as the possibility of displaying such signals in a graphics indicator.
The application is realized in LabVIEW because this programming environment offers a very
attractive interface with the user.
NI myDAQ is a data acquisition device, low-cost, focused on students, who together with
LabVIEW graphical programming, enables the measurement, generation and signals analysis from
the real world. NI myDAQ combines hardware with eight ready-to-run software-defined
instruments, including a function generator, oscilloscope, and digital multimeter (DMM); these
software instruments are also used on the NI Educational Laboratory Virtual Instrumentation Suite
II (NI ELVIS II) hardware platform so the lab experience can be extended to experiments
anywhere, anytime. With NI LabVIEW system design software, users can extend the instrument
functionality into hundreds of custom applications (http://www.ni.com/mydaq/what-is/).
There are two analog output channels on NI myDAQ. These channels can be configured as
either general-purpose voltage output or audio output.
Both channels have a dedicated digital-to-analog converter (DAC), so they can update
simultaneously. In general-purpose mode, you can generate up to ±10 V signals. In audio mode,
the two channels represent left and right stereo outputs. Analog outputs can be updated at up to
200 kS/s per channel, making them useful for waveform generation.
2.1 The Front Panel of the VI
The Front Panel was conducted by using the controls (inputs) and the indicators (outputs) as
follows:
- one control for channel setting;
- two controls for setting minimum and maximum values respectively of the output signal
supported by NI myDAQ;
- two control to change the amplitude and the frequency of the generated signal;
- one control for selecting the type of signal generated;
- one boolean STOP control;
- one graphical indicator for displaying the generated signal.
Figure 1. Signal Generator Front Panel
352
University of Bucharest and West University of Timisoara
2.2 The Block Diagram of the VI
NI-DAQmx is the next generation drivers for the data acquisition hardware from National
Instruments, that has significantly simplified the programming of data acquisition hardware in
LabVIEW. NI-DAQmx is a programming interface you can use to communicate with data
acquisition devices. Measurement & Automation Explorer (MAX) is a tool automatically installed
with NIDAQmx and used to configure National Instruments hardware and software (Bogdan,
2013).
LabVIEW interacts with many kinds of real world hardware. To see what devices are
recognized by the computer, go to Start » Programs » National Instruments » Measurement &
Automation and then select My System » Devices and Interfaces. Under NIDAQmx Devices
section we see all of the devices listed, including NI myDAQ (Bogdan, 2011).
It is easy to use and has many new features such as improved ease of use, faster development
time, multithreaded measurements and increased accuracy of measurements. NI-DAQmx can be
used to generate analog signals if the data acquisition hardware has the analog output capability.
(http://bme.sunysb.edu/labs/wlin/BME313/Project04.pdf). The DAQmx VIs can be found under
Functions >>All Functions >> NI Measurements >> DAQmx Data Acquisition.
Figure 2. Signal Generator Block Diagram
The following are the steps for creating virtual signal generator, block diagram.
a) Create a virtual channel and task using the NI-DAQmx Create Virtual Channel VI. Select
Analog output and than voltage.
- Physical Channels specifies the names of the physical channels to use to create virtual
channels. The DAQmx physical channel constant lists all physical channels on devices and
modules installed in the system. You also can wire a string that contains a list or range of physical
channels to this input.
- Maximum value specifies the maximum value you expect to generate.
- Minimum value specifies the minimum value you expect to generate.
b) Create the waveform data for the analog signal generation. I have used Basic Function
Generator VI to create the waveform, that creates an output waveform based on signal type.
Signal Type is the type of waveform to generate.
0 Sine Wave (default)
1 Triangle Wave
The 10th International Conference on Virtual Learning ICVL 2015
353
2 Square Wave
3 Sawtooth Wave
Frequency is the frequency of the waveform in units of hertz.
Amplitude is the amplitude of the waveform. The amplitude is also the peak voltage.
Figure 3. DAQmx Create Virtual Channel
Figure 4. Basic Function Generator VI
c) Call the DAQmx Start VI to start the acquisition.
This VI transitions the task to the running state to begin the measurement or generation.
d) Write the waveform data in a loop until the user hits the stop button or an error occurs.
Figure 5. DAQmx Start Task
Figure 6. DAQmx Write VI
3 Conclusion
Using computers, software, DAQ boards and drivers for these metrics, can be achieved with
open architecture (allow further developments), based on the software with user-defined functions.
These systems can replace traditional instruments, classical, focusing on hardware and whose
functions are defined by the manufacturer.
Virtual instruments based on personal computers (PC), thereby benefiting the performance of
these new embedded technologies: the powerful processors, the next-generation operating system,
the possibility of interconnecting to the Internet.
References
Bogdan, M. (2013): Virtual signal generator using the NI-USB 6008 data acquisition. Nonconventional
Technologies Review, Volume XVII, 5-8.
Bogdan, M. (2011): Virtual instrument for frequency measurement and spectral analysis, Journal of
Electrical and Electronics Engineering, Vol. 4, 19-22.
Rob, R., Panoiu, C., Panoiu, M., A. (2011): Signal generator designed in LabVIEW program. Annals of
faculty engineering Hunedoara, 149-150.
http://www.energ.pub.ro
http://www.ni.com/mydaq/what-is
http://www.ni.com/pdf/labview/us/getting_started_820.pdf
http://bme.sunysb.edu/labs/wlin/BME313/Project04.pdf
Download