This tutorial teaches you how to use the new Remote Panel feature in LabVIEW in conjunction with VI
templates to build LabVIEW applications that have a unique user interface for each new user instead of
displaying a common user interface to everyone. We will refer to such applications as
"Simultaneous Instances Remote Panels" applications. This functionality is useful in the case
where you want a lot of people to have access to your LabVIEW appliction, but you want each user to see
different data that is unique to that individual. For example, this is useful in the case of distance
learning applications where you want every student to use the same LabVIEW VIs, but each student has a
different idea for how to use the VI to solve the problem and therefore wants to interact and control it
differently. By using the material provided in this tutorial you can learn how to use the Remote Panels
feature in LabVIEW and use VI Templates to build these applications.
The LabVIEW Remote Panels feature allows you to view and control VIs throught a standard Web browser.
Creating the Remote Panels page is easy with the LabVIEW Web Publishing Tool. A few mouse clicks creates
a web page with the embedded VI front panel image, that can be viewed through the client's web browser.
Remote Panels allow multiple clients to simultaneously view the front panel of the same VI (if multiple
remote panel licenses are enabled.) However, only one client can control the VI front panel. By default,
the execution system cannot execute multiple calls to the same VI simultaneously. For our distance
learning example, this means that every student would see the same application and all of them would have
to interact with it in the same way since only one student could control it and everyone else is watching
what that one student is doing.
However, if you make a VI reentrant, each instance of the call maintains its own state of information.
Then, the execution system runs the VI from its own separate dataspace. Although it does allow mulitple
calls to the same VI to occur and for each call to have unique data, it does not allow the VI to be in use
by multiple students at the same time. What would happen in this case is that each student could have
unique control of the application but the VI would be accessible by only one student at a time, and the
next student would not be able to use the VI until the student currently using the VI was finished.
This is a result of how the LabVIEW VI Server actually calls the VI. When you call a VI using a Virtual
Instrument Class Reference (Open VI Reference, Property/Invoke Nodes, Close Application/VI Reference),
it is treated as if you had opened the front panel and were running the VI. You cannot have multiple
copies of a "Top Level" VI running simultaneously.
The solution therefore must both allow all students to have unique control of the LabVIEW VI, and allow
all of these individual instances of the VI to run simultaneously. This can be achieved by using the VI
templates. Each time a template VI is called simultaneously with VI server, a replica VI with unique name
is created. At the end of execution, these uniquely named VIs may be closed and deleted. When the VI is
opened as a template VI, each connection to the web page will result in a new instance of the VI and each
client can gain control of its instance through the remote panels. In this case, each student gets a
unique instance of the VI to work with each time they open the web page.
To show how these technologies can be used, lets walk through an example application that uses this
technique. The example below uses CGI scripting to dynamically access the LabVIEW VI Server and return
individual instance of the template VI. The LabVIEW Internet Toolkit provides the ability for your
LabVIEW applications to respond to CGI scripting commands.
<HTML> <HEAD> <TITLE>Simultaneous Instances Remote Panels</TITLE> </HEAD> <BODY> <H2>Simultaneous Instances Remote Panels</H2><P> Click Submit to be redirected to the selected database viewer. <FORM action=/cgi-bin/test/RemotePanels.llb/redirect.vi method=post> Database Viewers (Test CAtegories): <INPUT TYPE ="RADIO" NAME="radio" VALUE="FieldPoint"> FiledPoint <INPUT TYPE ="RADIO" NAME="radio" VALUE="DAQ"> DAQ <INPUT TYPE ="RADIO" NAME="radio" VALUE="IMAQ"> IMAQ <INPUT TYPE ="RADIO" NAME="radio" VALUE="Motion"> Motion <INPUT TYPE ="RADIO" NAME="radio" VALUE="CAN"> CAN <INPUT TYPE ="RADIO" NAME="radio" VALUE="GPIB"> GPIB <INPUT TYPE ="RADIO" NAME="radio" VALUE="FileIO"> FileIO <INPUT TYPE ="RADIO" NAME="radio" VALUE="NetIO"> NetIO <INPUT TYPE ="RADIO" NAME="radio" VALUE="Jitter"> Jitter <INPUT name=Submit type=submit value=Submit> <INPUT name=Reset type=reset value=Reset> </FROM> </BODY> </HTML> |