EJS JIL Server and LabVIEW An Architectu
EJS JIL Server and LabVIEW An Architectu
Abstract—Designing and developing web-enabled remote laboratories for pedagogical purposes is not an easy task. Often,
developers (generally, educators who know the subjects they teach but lack of the technical and programming skills required to build
Internet-based educational applications) end up discarding the idea of exploring these new teaching and learning experiences mainly
due to the technical issues that must be mastered. To tackle this problem, authors present a novel technique that allows developers to
create remote labs in a quick, didactical, and straightforward way. This framework is based on the use of two well-known software tools
in the scope of engineering education, Easy Java Simulations and LabVIEW. The development exploits a new feature of Easy Java
Simulations known as EJS-elements that enables Java developers to create and integrate their own authoring libraries (elements) into
EJS, thus increasing its application possibilities. Particularly, the EJS element here presented allows to LabVIEW programs be
controlled from EJS applications through a communication network. This paper presents the element creation details and how this can
be used to create web-enabled experimentation environments for educational purposes. A step by step example of development of a
remote lab for automatic control education is described.
1 INTRODUCTION
The UserLabviewConnector class contains the high-level With the configuration provided by the user, it gen-
methods that define a particular connection with a Lab- erates an specialized subclass of LabviewConnector
VIEW VI (Listing 2). Note that these functions are applica- which implement the high level protocol to commu-
tion specific. For example, each LabVIEW VI has its own nicate with the JiL Server and LabVIEW.
controls and indicators. Thus, the synchronization of the values of the linked EJS
variables and LabVIEW controls and indicators is simply
Listing 2. Class UserLabviewConnector done with a call to the method step() inside an Evolution
page, a mechanism of EJS which allows for the introduction
1: public class UserLabviewConnector
extends LabviewConnector {
of Java code to be executed periodically.
2: public void connect(); The configuration of the element require only three steps:
3: public void step(); 1) Add the LabVIEW Element to the current simulation
4: public void getValues(); by dragging and dropping to the Model Elements
5: public void setValues();
page.
6: public void disconnect();
2) Open the LabVIEW Element properties dialog, and
7: }
introduce the url of the server and the path of the
LabVIEW VI to be loaded.
Finally, the LabviewConnectorElement class provides two
3) Link the LabVIEW controls and indicators of the
functionalities: the implementation of the ModelElement
LabVIEW VI with the variables of the EJS simulation.
interface, which defines the contract required by EJS (List-
As mentioned before, it is encouraged to do the commu-
ing 3) to incorporate the library into the software tool as an
nication with the high-level protocol unless there is a good
element, and the code generator to automatize the definition
reason to use the low-level method.
of the UserLabviewConnector class.
Regardless of the chosen approach, in most of the appli-
cations, the variables can be grouped into two classes,
Listing 3. Interface ModelElement namely,
1: public interface ModelElement {
2: public javax.swing.ImageIcon getImageIcon(); synchronous, which are the variables that correspond
3: public String getGenericName(); to controls and indicators that must be updated with
4: public String getConstructorName(); a constant period, because they have a value that
5: public String getInitializationCode(String changes frequently. Examples of this kind of varia-
_name); bles are the control input to the actuators or the
6: public String getDestructionCode(String _name); measures read from the sensors correspond to this
7: public String getImportStatements(); class.
8: public String getResourcesRequired(); asynchronous, which are variables that have the same
9: public String getPackageList(); value the most of the time, only changing sporadi-
10: public String getDisplayInfo(); cally, and they usually correspond to configuration
11: public String savetoXML(); parameters or user commands to interact with the
12: public void readfromXML(String _inputXML); plant.
13: public String getTooltip();
14: public void clear(); 4 EXAMPLE: BUILDING A REMOTE LAB
15: public void setFont(java.awt.Font font); To design a new remote laboratory with the proposed archi-
16: public void showHelp(java.awt.Component
tecture, there are several common activities that must be
parentComponent);
faced:
17: public void showEditor(String _name, java.awt.
Component parentComponent, Experiments design. Obviously, the starting point is to
ModelElementsCollection list); design the activities or experiments that should be
18: public void refreshEditor(String _name); possible to carry out with the lab. These activities
19: public java.util.List< ModelElementSearch> will usually depend on the hardware availability
search (String info, String searchString, and the teaching purposes.
int mode, String elementName,
LabVIEW VI implementation. Once the activities have
ModelElementsCollection collection);
been decided and the hardware is ready, the next
20: }
logical step is to implement the LabVIEW applica-
tion that allows to interact locally with the plant. The
functionalities implemented in the server may
3.2.1 The LabviewConnectorElement Class depend on the system, but basic needs are: i) data
The EJS element is implemented by the class LabviewConnec- acquisition to interface with the hardware, ii) safety
torElement. The functionalities provided by this class are measures to protect the plant, and, iii) data logging to
listed in the following points: register experiments data. JiL Server is in charge of
all these functionalities.
Implement the interface ModelElement, allowing the EJS user interface. Finally, an user interface must be
class to be recognized as an element and loaded by provided to students in order to carry out the activi-
EJS. ties designed in the first stage.
398 IEEE TRANSACTIONS ON LEARNING TECHNOLOGIES, VOL. 8, NO. 4, OCTOBER-DECEMBER 2015
4.1.3 The Plant make it able to handle the streaming, one of them copes with
the image, and is able to reproduce either Motion-JPEG (each
The platform to obtain the experimental data is a remote
frame is codified as a JPEG image) or MPEG-4 (an standard
laboratory compounds of two identical CoupledTank plants
video format) transmitted over HTTP, and the other one
by Quanser [26]. Each plant consists of two tanks and a
plays the audio. The middle-layer is the JiL Server, which
water pump. One of the tanks is placed at the bottom, and
publishes the variables (controls and indicators) of the Lab-
the other at the top. The top tank has a valve whose output
VIEW VI to make them available over a network connection.
goes to the first tank. Thus, the system admits configura-
Further, the third layer is the EJS application in the client
tions of different complexities.
side, which is not only the graphical interface to configure
the control system and/or monitor the plant, but it also con-
4.1.4 The Remote Lab tains the controller implementation itself.
The platform has been developed with the software tools With regard to the communications, from an abstract
Easy Java Simulations [23], [25], JiL Server [24], and Lab- point of view each node is composed of two components: a
VIEW, that are combined to allow the interaction with the signal-generator and an event-generator. For example, for a
plant over the network. The controller is entirely in the cli- sensor node the signal generator can be a zero-order hold
ent side, thus the event-based schemes are adequate that builds the signal from the periodic sensor readings,
because they allow the reduction of the data transmission, and the event-generator is the sampling scheme that decides
thus using more efficiently the network resources. when to communicate the data to another nodes. Note that
The remote lab is based on the three-tier architecture pre- since the event generator can also be configured to emulate
sented in Section 4 (Fig. 4). In the server side, there is a PC a periodic sampling, this approach is also valid to represent
connected to the plant through a Data Acquisition Card a discrete control system.
(DAQ). This PC runs a LabVIEW Virtual Instrument (Lab- From the point of view of the control system, the two
VIEW VI) which implements monitoring functions and acts control loops, depicted in Fig. 5, are considered. In the
as an interface with the plant, i.e. it allows to obtain the read- first configuration, the sampler is placed at the output of
ings from the sensors and sends the control action to the the controller, and in the second one it is situated after
pumps. Also, there is a webcam to transmit a real-time video the process output.
and audio streaming of the plant, to allow students to feel The student interface (Fig. 6) has been implemented in
more like if they were in a real lab, even if they are remotely EJS based on the use of elements, which allows to facilitate
connected. Two view elements (or plugins) provided by EJS the building of the lab and to assure its reliability.
ET AL.: EJS, JIL SERVER, AND LABVIEW: AN ARCHITECTURE FOR RAPID DEVELOPMENT OF REMOTE LABS
CHACON 399
Fig. 5. Two control loops with different location of the send-on-delta sam-
pler. (a) The error signal at the input of the controller is sampled, and (b)
the controller output is sampled.
ACKNOWLEDGMENTS
This work has been funded by the National Plan Projects
DPI2011-27818-C02-02 and DPI2012-31303 of the Spanish
Ministry of Science and Innovation and FEDER funds.
The authors would like to thank the Chilean National
Commission for Research, Science and Technology
(CONICYT), for the financial support through Fondecyt
Initiation Project Ref. 11121437. Jes
us Chac
on is the
Fig. 8. The configuration window of the LabVIEW Connector Element corresponding author.
helps the user to configure the connection parameters, i.e. the server
address, the path of the LabVIEW VI file, and the linkages between the REFERENCES
EJS variables and the controls and indicators of the LabVIEW VI.
[1] D. Gillet, A. V. Nguyen, and Y. Rekik, “Collaborative web-based
experimentation in flexible engineering education,” IEEE Trans.
readings, and to send the updates in the control action or Educ., vol. 48, no. 4, pp. 696–704, Nov. 2005.
other parameters. These two things can be done with a call [2] M. Casini, D. Prattichizzo, and A. Vicino, “The automatic control
to the method labview.step() in an Evolution Page. Note that telelab: A user-friendly interface for distance learning,” IEEE
Trans. Educ., vol. 46, no. 2, pp. 252–257, May 2003.
this approach can be rather unefficient as the amount of [3] A. Lareki, J. Martınez, and N. Amenabar, “Towards an efficient
exchanged variables grows. Frequently, the values of the training of university faculty on ICTs,” Comput. Educ., vol. 54,
LabVIEW VI controls corresponds to configuration parame- no. 2, pp. 491–497, 2010.
ters that only changes due to the user interaction. Thus, it [4] N. Duro, R. Dormido, H. Vargas, S. Dormido-Canto, J. Sanchez, G.
Farias, and S. Dormido, “An integrated virtual and remote control
can be a better option to invoke only the method labview.get- lab: The three-tank system as a case study,” Comput. Sci. Eng.,
Values() periodically, and to call asynchronously the method vol. 10, no. 4, pp. 50–59, 2008.
labview.setValues() when needed. [5] L. Gomes and S. Bogosyan, “Current trends in remote labo-
ratories,” IEEE Trans. Ind. Electron., vol. 56, no. 12, pp. 4744–4756,
Dec. 2009.
[6] M. Stefanovic, V. Cvijetkovic, M. Matijevic, and V. Simic, “A Lab-
4.6 Step 5: User Interface VIEW-based remote laboratory experiments for control engineer-
The user interface is shown in Fig. 6. The main window ing education,” Comput. Appl. Eng. Educ., vol. 19, no. 3, pp. 538-
contains two plots which show the process and the control- 549, 2011.
[7] LabVIEW home page. (2013) [Online]. Available: http://www.ni.
ler outputs. Depending on the configuration, the sampler com/labview
output is plotted either with the process output (when sam- [8] G. Farias, R. De Keyser, S. Dormido, and F. Esquembre,
pling the process variable) or with the controller output (if “Developing networked control labs: A Matlab and easy java sim-
the control variable is sampled). From this window it is pos- ulations approach,” IEEE Trans. Ind. Electron., vol. 57, no. 10,
pp. 3266–3275, Oct. 2010.
sible to control the execution of the simulation. In addition, [9] E. Fabregas, G. Farias, S. Dormido-Canto, S. Dormido, and F.
there are three additional windows, one with the configura- Esquembre, “Developing a remote laboratory for engineering
tion of the PID controller, another with the configuration of education,” Comput. Educ., vol. 57, pp. 1686–1697, 2011.
the sampler, and the third one to configure the process. [10] R. Costa, M. Valles, L. M. Jimenez, L. Diaz-Guerra, A. Valera, and
R. Puerto, “Integraci on de dispositivos fısicos de un laboratorio
remoto de control mediante diferentes plataformas: LabVIEW,
Matlab y C/C++,” Revista Iberoamericana de Automtica e Informtica
5 CONCLUSION Ind. RIAI, vol. 7, no. 1, pp. 23–34, 2010.
[11] Z. Magyar and K. Zakova, “SciLab based remote control of
The main contribution of this work is an architecture for experiments,” Adv. Control Educ., vol. 9, no. 1, pp. 206–211, 2012.
rapid development of remote labs. The architecture is based [12] A. M. Hernandez, M. A. Maanas, and R. Costa-Castello, “Learning
on the use of LabVIEW, the JiL Server, and EJS, and allows respiratory system function in BME studies by means of a virtual
laboratory: RespiLab,” IEEE Trans. Educ., vol. 51, no. 1, pp. 24–34,
educators who are not expert programmers to address the Feb. 2008.
development of a remote lab with a minimized learning [13] EJS home page. (2013) [Online]. Available: http://www.um.es/
curve, due to the intuitivity of the graphical tools in the fem/EjsWiki
framework.
ET AL.: EJS, JIL SERVER, AND LABVIEW: AN ARCHITECTURE FOR RAPID DEVELOPMENT OF REMOTE LABS
CHACON 401
[14] J. S
anchez, S. Dormido, R. Pastor, and F. Morilla, “A Java/Matlab- Hector Vargas received the degree in electrical
based environment for remote control system laboratories: Illus- engineering from the De la Frontera University,
trated with an inverted pendulum,” IEEE Trans. Educ., vol. 47, Temuco, Chile, in 2001 and the PhD degree in
no. 3, pp. 321–329, Aug. 2004. computer science from UNED, Madrid, Spain,
[15] J. S
anchez, F. Morilla, S. Dormido, J. Aranda, and P. Ruiperez, in 2010. Since 2010, he has been with the
”Virtual and remote control labs using java: A qualitative Electrical Engineering School at Pontificia Uni-
approach,” IEEE Control Syst. Mag., vol. 22, no. 2, pp. 8–20, Apr. versidad Catolica de Valparaiso. His current
2002. research interests include simulation and con-
[16] R. Barrett, J. Cona, P. Hyde, B. Ketcham, B. Kinney, and J. Schakel- trol of dynamic systems, multiagent systems,
man. (2003). Virtual Microscope. Univ. Delaware [Online]. Avail- and engineering education.
able: http://www.udel.edu/biology/ketcham/microscope/
[17] J. Goffart, “Design of a web-based remote lab for a brewery proc-
ess,” Master thesis, HAMK Univ. Appl. Sci., H€ameenlinna, Fin-
land, 2007. Gonzalo Farias received the degree in computer
[18] H. Vargas, J. S anchez, C. A. Jara, F. A. Candelas, F. Torres, and S. science from the De la Frontera University,
Dormido, “A network of automatic control web-based labo- Temuco, Chile, in 2001 and the PhD degree in
ratories,” IEEE Trans. Learn. Technol., vol. 4, no. 3, pp. 197–208, computer science from UNED, Madrid, Spain, in
Jul.–Sep. 2011. 2010. Since 2012, he has been with the Electrical
[19] H. Vargas, J. S anchez, Ch. Salzmann, F. Esquembre, D. Gillet, and Engineering School at Pontificia Universidad
S. Dormido, “Web-enabled remote scientific environments,” Com- Catolica de Valparaiso. His current research
put. Sci. Eng., vol. 11, no. 3, pp. 34–46, 2009. interests include machine learning, simulation
[20] H. Vargas, Ch. Salzmann, D. Gillet, and S. Dormido, “Remote and control of dynamic system and engineering
experimentation mashup,” presented at the 8th IFAC Symp. Adv. education.
Control Educ., Kumamoto, Japan, 2009.
[21] H. Vargas, J. Sanchez, N. Duro, R. Dormido, S. Dormido-Canto, G.
Farias, S.Dormido, Ch. Salzmann, and D. Gillet, “A systematic
two-layer approach to develop web-based experimentation envi- Jose Sanchez received the computer sciences
ronments for control engineering education,” Intell. Autom. Soft degree in 1994 from Madrid Polytechnic Uni-
Comput., vol. 14, no. 4, pp. 505–524, 2008. versity and the PhD degree in sciences from
[22] R. Dormido, H. Vargas, N. Duro, J. Sanchez, S. Dormido-Canto, G. UNED in 2001 with a thesis on the develop-
Farias, F. Esquembre, and S. Dormido, “Development of a web- ment of virtual and remote labs for teaching
based control laboratory for automation technicians: The three- automatic control across the Internet. Since
tank system,” IEEE Trans. Educ., vol. 51, no. 1, pp. 35–44, Feb. 1993, he has been at UNED Department of
2008. Computer Sciences and Automatic Control as
[23] (2013) [Online]. Available: http://fem.um.es/Ejs an assistant professor. His main research inter-
[24] H. Vargas, “An integral web-based environment for control engi- ests for the time being: event-based control,
neering education,” Ph.D. dissertation, Dptm. Informatica y networked control systems, remote and virtual
Autom atica, UNED. Madrid, Spain, 2010. laboratories in control engineering, and pattern recognition in nuclear
[25] W. Christian and F. Esquembre, “Modeling physics with easy java fusion databases.
simulations,” Phys. Teacher, vol. 45, no. 8, pp. 475–480, 2007.
[26] (2013) [Online]. Available: http://www.quanser.com/english/ n Dormido received the BS degree in
Sebastia
html/home/fs_homepage.html
physics from Complutense University, Madrid,
[27] E. Besada-Portas, J. A. L opez-Orozco, L. de la Torre, and J. M. de
Spain, in 1968 and the PhD degree in the scien-
la Cruz-Garcıa, “Remote control laboratory using EJS applets and
ces from Basque Country University, Bilbao,
twinCAT programmable logic controllers,” IEEE Trans. Educ.,
Spain, in 1971. He received a Doctor Honorary
vol. 56, no. 2, pp. 156–164, May 2013.
degree from the Universidad de Huelva and Uni-
[28] L. de la Torre, “New generation virtual and remote laboratories:
versidad de Almerıa. In 1981, he was appointed
Integration into web environments 2.0 with learning management
as a professor of control engineering at UNED,
systems,” Ph.D. dissertation, Dptm. Informatica y Automatica,
Madrid. His scientific activities include computer
UNED. Madrid, Spain, 2013
control of industrial processes, model-based pre-
[29] C. Salzmann and D. Gillet, “Smart device paradigm standardiza-
dictive control, hybrid control, and web-based
tion for online labs,” in Proc. 4th IEEE Global Eng. Educ. Conf.,
labs for distance education. He has authored or coauthored more than
Berlin, Germany, 2013, pp. 1217–1221.
250 technical papers in international journals and conferences and has
supervised more than 35 PhD thesis. From 2001 to 2006, he was the
Jesu s Chaco n received the degree in automa-
president of the Spanish Association of Automatic Control, CEA-IFAC.
tion and industrial electronics engineering from He received the National Automatic Control prize from IFAC Spanish
the University of Co rdoba, Spain, in 2010, and
Automatic Control Committee.
the PhD degree in computer science from UNED,
Madrid, Spain, in 2014. Since 2010, he has been
at UNED Department of Computer Sciences and
Automatic Control as a full time researcher. His
current research interests include simulation and
control of event-based control systems, and
remote and virtual labs in control engineering.