Design_of_a_Virtual_Function_Generator_for_Signal_
Design_of_a_Virtual_Function_Generator_for_Signal_
Email address:
[email protected] (G. Tektas), [email protected] (C. Celiktas)
*
Corresponding author
Received: May 5, 2017; Accepted: May 15, 2017; Published: July 5, 2017
Abstract: A virtual function generator was designed by developing a code by LabVIEW. Signals with the same amplitude
and frequency supplied from a real function generator and the virtual function generator were sent to a real oscilloscope to
measure the quantities. The signals from the virtual one were generated at analog output channel of a National Instruments
(NI) multifunction data acquisition device. Amplitude and time quantities of the signals from both generators were compared
with each other. The results from the virtual generator were highly in compatible with those of the real one. It was concluded
that the designed virtual function generator could be used to supply the signals especially in low frequencies.
unit time. Rise time is the time it takes for the pulse to rise
1. Introduction from 10 to 90% of its full amplitude. Fall time is the time it
Virtual instrumentation combines with a computer, takes for the pulse to fall from 90 to 10% of its full amplitude
software and a wide variety of measurement and control [4]. Width is the width of the signal in terms of second.
hardware. User defined instruments can be created with it Bogdan explained how the signals were generated by a
[1]. Processes in a virtual instrument are performed by DAQ (Data Acquisition) device [5]. The use of data
software functions whereas they are done by microprocessor acquisition device and LabVIEW to implement a signal wave
in a real instrument. generator was presented by the author [6]. Rob et al.
LabVIEW is a software which is used to design the virtual designed a virtual signal generator by LabVIEW [7].
instrument. It has a graphical programming language. A code In this paper, a virtual function generator was designed by
is developed by the software functions (icons) instead of the developing a code. The signals in different frequencies and
lines of text [2]. amplitudes supplied from the real and virtual function
A virtual function generator which is a type of the virtual generators were displayed in the oscilloscope. Measurement
instruments can be designed by using LabVIEW software. quantities obtained from the oscilloscope were compared
The virtual function generator is used to supply signals in with each other.
sinus, triangle, square and sawtooth shape with different
frequencies and amplitudes like a real function generator. 2. Material and Methods
Peak to peak voltage, amplitude, frequency, rise time, fall
time and width quantities of the signals supplied from the LabVIEW has two windows named as front panel and
developed virtual generator can be obtained from an block diagram which are seen in Figure 1. Front panel is an
oscilloscope. Peak to peak voltage is a difference between interface between user and the virtual instrument. Controls
maximum and minimum voltage values of a signal. and indicators of the virtual instrument take part in this panel.
Amplitude is a difference between high and low voltages Block diagram is a window that the code is written for the
(states). The high and low states are the most positive and virtual instrument. The code is formed by making
negative states [3]. Frequency is the number of signals per connections between the functions used in the block diagram.
24 Gozde Tektas and Cuneyt Celiktas: Design of a Virtual Function Generator for Signal Generation
A GW Instek 2204 model digital oscilloscope, a Thurlby Circuit scheme for the measurements is shown in Figure 2.
Thandar TG230 function generator (real function generator), As can be seen in the scheme, sinus, square and triangle
a NI USB-6008 multifunction data acquisition device, an NI signals supplied from the virtual function generator were
GPIB-USB-HS [GPIB (General Purpose Interface) generated at analog output (AO) channel of the 6008 since
Controller for Hi-Speed USB] and developed virtual function the signals were continuous with changing amplitude. Same
generator were used in this study. type signal shapes were supplied from the real and virtual
In the virtual function generator, controls were developed function generators. The signals supplied from both
for selecting signal type, amplitude, frequency and offset generators were sent to the CH 1 (Channel 1) and CH 2
values. The 6008 was utilized as hardware of the designed (Channel 2) inputs of the oscilloscope. In this way, both
virtual instrument. In order to stop and start the oscilloscope signals were displayed simultaneously.
by the developed code, the GPIB connection was used.
Amplitude and frequency values of the signals were set via peak voltage, amplitude, frequency, rise time, fall time and
amplitude and frequency knob of both generators. The real width quantities were obtained from the oscilloscope. Each
function generator has a display to show amplitude and measurement was repeated five times for each amplitude and
frequency quantities. Two methods were employed in this frequency values. All results were recorded after the
study. The first one was constant amplitude and different oscilloscope was stopped. In the following tables, averages of
frequency. In this method, amplitudes of the signals were the measurements are given with their errors.
kept constant to 2 V. Signal frequencies of 10 and 50 Hz
were supplied. The second method was constant frequency 3. Results
and different amplitude. Frequency of the signals was kept
steady on 20 Hz. Amplitudes were adjusted to 1 and 5 V 3.1. Sinus Signal
respectively because analog output voltage range of the 6008
is from 0 to 5 V. The 6008 is unable to generate analog Sinus signal images obtained from the oscilloscope are
signals with high frequency due to the fact that it has shown in Figure 3 for the voltage/division and time/division
maximum update rate of 150 Hz [9]. For this reason, of 2 V/div. and 25 ms/div. settings, respectively. Results
maximum signal frequency was increased to 50 Hz. Peak to using first and second methods are given in Tables 1 and 2.
Advances in Applied Sciences 2017; 2(2): 23-27 25
10 Hz Frequency 50 Hz Frequency
Measurement Quantities
Real Generator Virtual Generator Real Generator Virtual Generator
Peak to Peak (V) 1.852 2.036±0.0904 1.928 2.016±0.0437
Amplitude (V) 1.788 1.976±0.0951 1.844 1.892±0.0254
Frequency (Hz) 9.872 9.688±0.0190 49.422 48.748±0.0138
Rise Time (ms) 31.38 29.79±0.0532 6.270 5.737±0.0929
Fall Time (ms) 30.98 28.95±0.0702 6.310 5.763±0.095
Width (ms) 51.07 50.37±0.0139 10.24 10.19±0.0045
1 V Amplitude 5 V Amplitude
Measurement Quantities
Real Generator Virtual Generator Real Generator Virtual Generator
Peak to Peak (V) 0.936 0.998±0.0625 4.664 5.064±0.0790
Amplitude (V) 0.898 0.964±0.0697 4.456 4.936±0.0972
Frequency (Hz) 19.820 20.044±0.0112 19.786 19.698±0.0045
Rise Time (ms) 14.83 14.19±0.0451 14.97 14.78±0.0134
Fall Time (ms) 15.09 14.10±0.0704 15.35 14.91±0.0295
Width (ms) 25.22 25.15±0.0025 25.47 25.38±0.0036
Figure 3. Comparison of the sinus signal shapes obtained from the real and
the virtual generators.
10 Hz Frequency 50 Hz Frequency
Measurement Quantities
Real Generator Virtual Generator Real Generator Virtual Generator
Peak to Peak (V) 2.052 2.060±0.0039 2.048 2.052±0.0019
Amplitude (V) 1.940 1.96±0.0102 1.940 1.964±0.0122
Frequency (Hz) 9.840 9.938±0.0099 49.506 49.078±0.0087
Rise Time (µs) 795.2 798.4±0.0040 792.0 798.4±0.0080
Fall Time (µs) 796.8 805.3±0.0105 795.3 800.1±0.0060
Width (ms) 50.59 49.99±0.0120 10.00 10.20±0.0200
26 Gozde Tektas and Cuneyt Celiktas: Design of a Virtual Function Generator for Signal Generation
1 V Amplitude 5 V Amplitude
Measurement Quantities
Real Generator Virtual Generator Real Generator Virtual Generator
Peak to Peak (V) 1.014 1.004±0.0100 4.928 5.120±0.0375
Amplitude (V) 0.992 0.984±0.0081 4.800 4.992±0.0385
Frequency (Hz) 19.688 19.766±0.0039 19.608 19.614±0.0003
Rise Time (µs) 800.0 805.3±0.0067 802.7 802.5±0.0002
Fall Time (µs) 792.4 803.9±0.0144 800.1 805.1±0.0062
Width (ms) 25.59 25.00±0.0238 25.19 25.59±0.0155
10 Hz Frequency 50 Hz Frequency
Measurement Quantities
Real Generator Virtual Generator Real Generator Virtual Generator
Peak to Peak (V) 1.980 2.008±0.0139 2.000 2.040±0.0196
Amplitude (V) 1.480 1.520±0.0263 1.528 1.492±0.0241
Frequency (Hz) 9.794 9.824±0.0031 49.400 49.196±0.0041
Rise Time (ms) 31.03 30.76±0.0088 6.271 5.940±0.0558
Fall Time (ms) 30.93 31.29±0.0118 6.234 6.145±0.0145
Width (ms) 51.61 49.59±0.0407 10.110 9.719±0.0407
1 V Amplitude 5 V Amplitude
Measurement Quantities
Real Generator Virtual Generator Real Generator Virtual Generator
Peak to Peak (V) 0.990 0.969±0.0215 4.808 4.880±0.0148
Amplitude (V) 0.851 0.866±0.0166 4.184 4.150±0.0082
Frequency (Hz) 19.250 19.676±0.0217 19.824 19.766±0.0029
Rise Time (ms) 17.64 17.77±0.0036 17.54 16.62±0.0554
Fall Time (ms) 18.06 18.28±0.0118 17.50 16.95±0.0323
Width (ms) 25.52 26.63±0.0418 25.45 24.05±0.0584
Advances in Applied Sciences 2017; 2(2): 23-27 27