Labview Remote Lab: January 2011
Labview Remote Lab: January 2011
net/publication/221910210
CITATION READS
1 2,171
2 authors, including:
Aurel Gontean
Polytechnic University of Timisoara
130 PUBLICATIONS 454 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Aurel Gontean on 04 June 2014.
1. Introduction
LabVIEW is a quite interesting programming language, and despite its odd first impression
is very powerful. We remember when we started to use it for the first time it was somehow
strange to me, we thought what this, a graphical programming language? For the first
contact whit this language, LabVIEW somehow hides its power, this could be due to fact
that for the first contact everyone tries the simulation part. A usual first application would
be to generate a sine wave to a graph. Unfortunately, this won’t really impress a user.
All LabVIEW field engineers nightmare is to know that the users think that LabVIEW is a
simulation environment. Their main job is to erase that from the users mind. Of course it has
a very strong simulation part, but the main target is the real hardware controlling.
If we think put of the box a little, we will realize that if LabVIEW hides its power, that means is
very simple to use, but if we think about the big amount of software and hardware National
instruments make, we will see that it’s quite an extraordinary programming language.
To make a short count, we can see that only LabVIEW 2009 with Modules, Toolkits and
Device Drivers are 3 DVDs in compressed kit version. If we consider that in other hand we
have NI Multisim circuit design suite, LabWindows/CVI C programming language for
instruments and Measurement Studio LabVIEW style buttons add-on for Microsoft Visual
Studio, then we can imagine that engineers National Instruments create a lot of software.
In hardware area we can just say that they have a lot of stuff, and if they don’t have am
equipment, then another company has it and LabVIEW has the driver for that equipment.
Sometimes the diver is made by the National Instruments engineers, sometimes is made by
third party vendors, but my only concern is to work, and they mostly do. A useful section in
the www.ni.com webpage is the IDNET (Instrument Driver Network), where you can find
the LabVIEW and LabWindows/CVI drivers for almost any equipment. You just have to
search here: www.ni.com/devzone/idnet. A good instruments vendor would be Agilent
Technologies; we can say that it’s very hard to find equipments from Agilent without
LabVIEW or LabWindows/CVI driver.
This way we can easily say that LabVIEW it’s much more than MATLAB Simulink in color.
LabVIEW has a strong programming part, despite its simple appearance, if we go deeply in
some specific area, like NI Vision or CompactRIO, then things will start to get quite complex
and complicated. But knowing that this is complicated in LabVIEW, if we think to do the
same thing without LabVIEW, in another programming language, it could be almost
impossible, for a reduced number of engineers, in a short amount of time.
In LabVIEW it’s possible, almost everything is possible.
276 Modelling, Programming and Simulations Using LabVIEW™ Software
We would like to correct the sentence above; some things are possible only indirectly. Some
extra programming in needed, but after all an engineer can do what he planned.
numbers (8 bits). The first Shift Register with 0 initialization will always increase the
fragmentation index with 2, this way we will reach at the end minus 2 (n-2) of the HEX
word. There is a condition too, if we reach at the end of the HEX string to exist the While
loop. From String Subset we convert the HEX string to number, the number is converted to
ASCII with the Type Cast VI. For some strange reason the Type Cast VI puts an ASCII space
before the converted ASCII character, this space is a \00 type space, so this will have to be
deleted, it’s deleted with the Match Pattern VI using the ^[\00]* command and wired to the
after substring output (after the \00), and we will obtain the good converted ASCII value.
This value will be concatenated with the following strings using the second Shift Register
with the empty string initialization.
signal was the trapezoidal signal, which is mostly used when controlling motors. Nobody
wants a square pattern for the motors acceleration. In cars, in lifts the motor usually
accelerates in a trapezoidal pattern.
As we can see in Fig. 9., the program is working. The hardest part is configuring the
parameters. The parameters are configured using equation (1).
⎧⎪ N p ⋅ Uminr = A − U0
⎨ (1)
⎪⎩N p ⋅ Uminf = A − U0
Where Np is the number of points; Uminr,Uminf are the minimal voltages for rise and fall; A is
the amplitude of the signal; U0 is the start voltage. In our case it will be: 0,0003 * 10000 = 5 –
2, this way we created the trapezoidal signal.
In Fig. 12. We can see the experimental setup of the NAND gate on a PCB with protection
and connectors for accessing. The used NAND gate is integrated in a 74ACT00 IC.
The used NI equipment for this experiment was the NI PXI-4110 power supply and the NI
PXI-4072 digital multimeter.
t pHL + t pLH
tp = (3)
2
In the standard TTL gate’s case tpLH = 12 ns and tpHL = 8 ns, so tp = 10 ns.
The experimental setup can be seen on Fig. 12. The setup is on the same PCB as for the
transfer characteristic.
The used NI equipments are NI PXI-4110 power supply, the NI PXI-5112 oscilloscope and
the NI PXI-5412 signal generator.
In Fig. 16. we can see the Front Panel of the experiment.
As we can see we have the configuration of the oscilloscope, the power supply and the
function generator.
The oscilloscope has a configured resource ID and the Time/div setting. It has also both
channels activated with 0 V offset for channel 0 and 3 V offset for channel 1 and Volts/div
(Vertical Range) dial. It also has some triggering configurations like slope on positive, DC
coupling and 1 V level. We have the both graphs (input and output of the NAND gate) on
the waveform graph and cursors to measure the propagation time.
The power supply has a basic configuration just for supplying current to the IC. It has
resource ID, current limit to 100 mA, 5 V voltage level, output enabled indicator, an
indicator showing 0 as the selected channel, and a measurement of the output of the
activated channel.
The function generator has resource indicator, the settings for output mode, which is on
standard, square waveform type, and the setting for amplitude, which is at 5 V and the
setting for frequency, which is at 1 MHz.
In Fig. 17. we can see the Block Diagram of the program.
As we can see we have the initialization for the function generator, the setting of the output
mode, the amplitude and frequency setting, the enabling of the output and the starting of
the generation.
The oscilloscope is initialized and has standard initialization.
Finally the power supply is initialized.
We enter in the While loop. We configure the voltage and the current of the power supply;
we enable its output and measure the output voltage.
We continue to the oscilloscope, we configure the trigger settings, the timing settings. After
we make the settings for the vertical range and start the readings of the values for
representing on the graph both of the channels (0 and 1). We unite the two channels with a
Build Array and output it on a Waveform Graph.
For the function generator we can control the frequency and amplitude during the program
execution, this way we have it inside the loop too.
When we exit the loop we disabled the output, we stopped the generation we resettled the
device. Finally we close the function generator, the oscilloscope, we reset and close the
power supply and end the whole execution with a simple error handler to have the error
messages in case if something goes wrong.
and at the end we close the signal generator. Finally the logic analyzer is closed too, and the
program is ended with a simple error handler.
channel and the sampling divisor is 5. We have also indicators for frequency and RPM. We
have also a median filter which can be deactivated with a button and we have a slot setting
dial, which must be set to be equal with the number of slots of the disk present on the
motor. This should be correctly set to calculate the RPM.
In Fig. 25. we can see the Block Diagram of the program. We have two parallel while loops.
The first loop is for the trapezoidal signal generation. We have first the creation of the channel,
after we have the start of the generation process. Next we enter the While loop, we have here
the trapezoidal signal creation similar to paragraph 2.5. This is the method how a signal is
generated by a DAQ board; we provide the numbers (samples) of the signal and the use the
write signal VI, which has the icon with the pencil. After we exit the loop with closing the
instrument (delete task) and we finish the program with the simple error handler.
The second loop is for the counter configuration. We have channel creation for the counter,
the timing settings (sample configuration), the start of the execution continues, followed by
the signal reading, which is filtered and with a specific formula we calculate the RPM and
represent it on a Waveform Graph.
Equation (4) shows how to calculate the RPM from the frequency.
f
RPM = N ⋅ 60s (4)
s
Finally we close the instrument and we handle errors. We put everything in the loop to be
controllable during execution.
In Fig. 31. we have the Front Panel of the Agilent 33250A signal generator. As we can see we
have resource ID, the waveform type is sine wave, the frequency 100 kHz, the offset is 0 V
and the amplitude is 5 V.
Fig. 31. Front Panel for the Agilent 33250A Function / Arbitrary Waveform Generator.
In Fig. 32. we can see the Front Panel of the oscilloscope application. We can see the resource
ID of the oscilloscope and the horizontal adjust dial. We have two channels activated with
two graphs and two vertical adjust dials. The first graph represents the input AC signal and
the second graph represents the output DC signal. From this graphs we ca see that the
power supply works correctly and we have an AC – DC power supply.
Fig. 32. Font Panel for the Power Supply Testing with Oscilloscope.
LabVIEW Remote Lab 295
In Fig. 33. we have the 33250A Agilent signal generator programming. We have between the
initialization and closing a While loop. In the loop we have the waveform configuration VI
and the output enable VI.
Fig. 33. Block Diagram for the Agilent 33250A Function / Arbitrary Waveform Generator.
In Fig. 34. we have the Block Diagram of the oscilloscope application.
We start with the channel creation. We enter in the while loop. We have some timing
settings for the horizontal adjust and the vertical adjust and readings for the both activated
channels (channel 0 and channel 1). We put a Bessel filter to the output signal of the voltage
supply. When we exit from the while loop we close the instrument and handle errors.
global variables communicates not only between different VIs on the same computer, but
between VIs on different computers, connected via networks cables if they are in the same
subnet.
will have indicator and vice-versa. We can imagine an invisible line, connection between
these global variables. These lines transport the data between the two VIs via Ethernet. The
data is sent from the networked real-time host, but there is also feedback from the Widows
host.
5. Conclusion
LabVIEW is a very complete programming language. We could say that if assembly is a first
level programming language and C is a second level programming language, than
LabVIEW should be a third level programming language. LabVIEW is graphical and has a
lot of implemented blocks, as they say; you don't have to invent the wheel again. This
concept makes programming really fast and could reduce very much an engineer's work.
As we could see in paragraph 2., LabVIEW has a lot of block, but not enough. It hasn't got
everything that is needed. In paragraph 2. we presented only 7 programming tricks that we
made and we thought that should be important to know. We are sure that are much more
tricks in this programming language. We encountered and solved much more programming
problems, but we decided not to present those tricks, because, they are not so general. After
all LabVIEW is a very complex programming language, but there is place for more.
After the tricks we presented 6 applications made with the PXI industrial system and 2
applications made with CompactRIO. They have similarities; some of them are made with
both of the PXI and ComapctRIO platforms. The applications were made for didactical
purposes and for publishing them on the LabVIEW Remote Lab. All the applications are
published and accessible from the http://plst.etc.upt.ro address with a user name and
password.
6. References
Antonovičs U. & Priednieks Ē. (2006). Interactive Learning Tools for Electrical Engineering
and Electronics Course, Electronics and Electrical Engineering, ISSN 1392-1215 –
Kaunas Technologija, No. 7(71), pp. 29–34, 2006.
Auer, M.E. & Gallent, W. (2000) The Remote Electronic Lab as a Part of the Telelearning
Concept at the Carinthia Tech Institute, Proceedings of the ICL2000, Villach/Austria,
2000.
LabVIEW Remote Lab 305
Garbus, R.U.; Aguirre, I.J.O.; Sanchez, R.C. & Pureco, O.R. (2006). Virtual Remote Lab for
Control Practic, Electronics, Robotics and Automotive Mechanics Conference, vol. 2, pp.
361-366, 2006.
Gontean, A.; Lie, I. & Szabó, R. (2009 a). LabVIEW powered remote lab, Design and
Technology of Electronics Packages, (SIITME) 2009 15th International Symposium, pp.
335-340, Gyula, Hungary, September , 2009.
Gontean, A.; Lie, I. & Szabó, R. (2009 b). Using a Low Cost Programmable Power Supply for
Automated Testing, Design and Technology of Electronics Packages, (SIITME) 2009 15th
International Symposium, pp. 341-346, Gyula, Hungary, September , 2009.
Gontean A. & Szabó R. (2009 a). Remote temperature measurement with and without FPGA,
TELFOR 2009 – 17th Telecommunications Forum, pp. 775-778, Belgrade, Serbia,
November, 2009.
Gontean A. & Szabó R. (2009 b). Comparison between PIC and CompactRIO remote motor
control, TELFOR 2009 – 17th Telecommunications Forum, pp. 747-750, Belgrade,
Serbia, November, 2009.
Grober, S.; Vetter, M.; Eckert, B. & Jodl, H.-J. (2007). Experimenting from a distance –
remotely controlled laboratory, Eur. J. Phys., vol. 28, pp. 127-141, 2007.
Hercog, D.; Gergic, B. & Matko, V. (2005). Remote Lab for Electric Drives, Industrial
Electronics – ISIE 2005 Proceedings of the IEEE International Symposium, vol. 4. pp.
1685-1690, 2005.
Khalil, A.; Hasna, M.; Benammar, M.; Chaabane, M. & Ben Amar, C. (2009). Development of
a remote lab for electrical engineering program, Signals, Circuits and Systems (SCS) –
3rd International Conference, pp. 1-5, 2009.
Mihela Lascu (2007). Advanced programming techniques in LabVIEW, Politehnica Publishing
House, Timişoara, 2007.
*** National Instruments (2008). LabVIEW™ Data Acquisition and Signal Conditioning
Exercises, 2008.
*** National Instruments (2008). Data Acquisition and Signal Conditioning – Course Manual,
2008.
*** National Instruments (2007). LabVIEW™ Basics II: Development – Course Manual, 2007.
*** National Instruments (2007). LabVIEW™ Basics I: Introduction – Course Manual, 2007.
*** National Instruments (2008). CompactRIO™ and LabVIEW™ Development Fundamentals –
Course Manual, 2008.
Paladini, S.; da Silva, J.B.; Alves, G.R.; Fischer, B.R. & da Mota Alves, J.B. (2008). Using
Remote Lab Networks to Provide Support to Public Secondary School Education
Level, Computational Science and Engineering Workshops – CSEWORKSHOPS '08 11th
IEEE International Conference, pp. 275-280, 2008.
Szabó, R.; Gontean, A. & Lie, I. (2010). Sound Based Coin Recognition and Clapper,
MENDEL '10 – 16th International Conference on Soft Computing, pp. 509-516, Brno,
Czech Republic, June, 2010.
Szabó, R.; Gontean, A.; Lie, I. & Băbăiţă, M. (2009). Oscilloscope Control with PC, NAUN
2010 – International Journal of Computers and Communications, pp. 33-40, Issue 3,
Volume 3, September, 2010.
306 Modelling, Programming and Simulations Using LabVIEW™ Software
Uran, S.; Hercog, D. & Jezernik; K., (2006). Remote Lab Experiment RC Oscillator for
Learning of Control, International Journal of Online Engineering, vol. 2, no. 4, pp. 1-8,
2006.