LabSocket User Guide
LabSocket User Guide
LabSocket
User Guide
LabSocket v3.4
July 2015
Alliance
Partner
1.
Introduction
............................................................................................................
1
1.1
Supported
Platforms
........................................................................................................................................
1
1.2
Client
Mapping
....................................................................................................................................................
1
1.3
Downloading
and
Activating
LabSocket
VIPM
File
.............................................................................
2
1.4
LabSocket
Server
...............................................................................................................................................
2
1.5
Licensing,
Executables
and
Real-‐Time
Deployments
........................................................................
3
1.6
Contact
...................................................................................................................................................................
3
2.
System
Requirements
.............................................................................................
4
2.1
Browsers
...............................................................................................................................................................
4
2.2
LabVIEW
Development
Platform
...............................................................................................................
4
2.3
LabSocket
Server
Virtual
Machine
Host
..................................................................................................
4
2.4
Supported
NI
Real-‐Time
Linux
Platforms
..............................................................................................
5
2.5
LabSocket
Server
Ports
...................................................................................................................................
5
3.
Theory
of
Operation
................................................................................................
6
3.1
Overview
...............................................................................................................................................................
6
3.2
Client
Mapping
Modes
.....................................................................................................................................
6
3.3
LabSocket
Server
...............................................................................................................................................
7
4.
Setup
Instructions
...................................................................................................
9
4.1
LabSocket
Server
Virtual
Machine
Installation
....................................................................................
9
4.2
LabSocket
Software
Installation
..............................................................................................................
11
4.3
Uninstalling
LabSocket
Software
.............................................................................................................
12
5.
LabSocket
Application
Development
.....................................................................
13
5.1
Creating
a
Basic
Mapping
Mode
Application
......................................................................................
13
5.2
Creating
a
MultiClient
Mapping
Mode
Application
..........................................................................
19
5.2.1
MultiClient
Mapping
Mode
–
How
it
Works
......................................................................................
19
5.2.2
Step-‐by-‐Step
Instructions
.........................................................................................................................
20
6
Standalone
Applications
.........................................................................................
27
6.1
Basic
Mapping
..................................................................................................................................................
27
6.2
MultiClient
Mapping
......................................................................................................................................
31
6.3
Deploying
to
NI
Linux
Real-‐Time
Targets
...........................................................................................
39
7.
Example
Files
........................................................................................................
45
8.
LabSocket
Start
VIs
................................................................................................
47
9.
LabSocket
Status
Window
.....................................................................................
50
9.1
Log
Page
.............................................................................................................................................................
50
9.2
Clients
Page
.......................................................................................................................................................
50
9.3
Diagnostics
Page
.............................................................................................................................................
51
10.
Advanced
Features
..............................................................................................
53
10.1
Preprocessor
Tags
.......................................................................................................................................
53
10.2
Picture
Rings
and
High-‐Fidelity
Boolean
Elements
......................................................................
55
10.3
Developer
Customization
.........................................................................................................................
56
10.3.1
Arbitrary
JavaScript
for
the
Browser
...............................................................................................
56
BML-2015-105.4.1 i
10.3.2
Custom
JavaScript
for
Unsupported
Elements
.............................................................................
58
10.4
Working
with
Images
.................................................................................................................................
59
11.
User
Administration
............................................................................................
61
BML-2015-105.4.1 ii
1. Introduction
LabSocket enables remote access to LabVIEW applications from desktop or
mobile web browsers without the need for browser plugins or a client-side run
time engine. The system automatically creates a web page representation of a
LabVIEW application (“Target VI”) front panel and dynamically synchronizes the
contents of the web page and front panel.
A key technology used in the system is the HTML5 WebSocket interface that
enables continuous, bi-directional communication with a web browser. The use
of this interface contributes to the name of the system: "LabSocket = LabVIEW
+ WebSocket".
This User Guide describes the setup and operation of the LabSocket software.
The guide assumes that the user is familiar with LabVIEW but has only a basic
level of Linux and server virtualization experience.
BML-2015-105.4.1 1
Table 1. Client Mapping Modes
Client Mapping Mode
Platform Basic MultiClient
Desktop Yes Yes
cRIO-903x Yes Planned
BML-2015-105.4.1 2
1.5 Licensing, Executables and Real-Time Deployments
The LabSocket licensing agreement allows the software to be installed on a
single developer platform. From this single development platform, developers
may:
a) create an unlimited number of standalone Windows executables that
incorporate the LabSocket software and deploy these executables to an
unlimited number of Windows platforms; and,
b) create an unlimited number of Real-Time applications that incorporate
the LabSocket software and deploy these applications to an unlimited
number of CompactRIO 903x devices.
Full licensing terms can be found under "Help > LabSocket License..." after
LabSocket installation. See Section 6 for instructions on creating executables
and real-time applications.
1.6 Contact
For assistance with system setup or questions about the system, please
contact:
John Bergmans
Bergmans Mechatronics LLC
e-mail: [email protected]
Phone: 1-714-474-8956 (8 AM to 6 PM US Pacific Time)
Skype: johnbergmans
BML-2015-105.4.1 3
2. System Requirements
2.1 Browsers
Browsers that use the LabSocket system must be compatible with the HTML5
WebSocket interface standard. Fortunately, most modern mobile and desktop
browsers are compatible with this standard. A complete list of WebSocket-
compatible browsers is shown at: http://caniuse.com/websockets
For users who require support for older browsers such as Internet Explorer 9.0
and earlier, a commercial gateway product can be provided to emulate the
behavior of the WebSocket interface.
BML-2015-105.4.1 4
2.4 Supported NI Real-Time Linux Platforms
LabSocket is compatible with the new series of CompactRIO 903x NI Linux Real-
Time controllers. The following elements are supported on these platforms:
• Numeric controls and indicators, including enums
• String controls and indicators
• Boolean controls and indicators, including booleans with images
Tab elements, decorations and static pictures are also supported.
BML-2015-105.4.1 5
3. Theory of Operation
3.1 Overview
To enable remote access to a LabVIEW application, or "Target VI", over the
Web, LabSocket operates "LabSocket Support VIs" on the LabVIEW Host
Platform in parallel to the Target VI. The LabSocket Support VIs operate
unobtrusively and perform two key functions:
1. Upon starting the system, the Support VIs perform a screenscrape of the
Target VI front panel. This function involves generating a web page using
HTML and JavaScript code representing the Target VI front panel. This
code is then posted to an HTTP server on the LabSocket Server platform.
WebSocket
Interface TCP-IP
Socket
Interface
Browser
(Target VI 1)
HTTP Server
LabSocket
Browser Message Target
Support
(Target VI 2) Broker VI
VIs
…
LabSocket
Server LabVIEW
Browser
(Target VI n) LabVIEW Host PC or
NI Real-Time Linux Platform
Physical Machine or
Virtual Machine
Figure 1. LabSocket in Basic Client Mapping Mode
BML-2015-105.4.1 6
MultiClient Client Mapping Mode supports N:N Target VI instance-to-browser
client mapping. In this mode, each browser that connects to the system is
mapped to a unique instance of the Target VI (Figure 2). MultiClient Mode is
ideal for applications in which each user must operate the Target VI
independently. Examples of such applications include database access systems
and on-line quizzes.
Browser Target
(Target VI 1) VI 1
HTTP Server
LabSocket
Browser Message Target Target VI
Support
(Target VI 2) Broker VI 2 Prototype
VIs
(inactive)
…
…
LabSocket
Server Target
Browser VI n
(Target VI n)
LabVIEW
LabVIEW Host PC
The Client Mapping mode is selected based on which LabSocket Start VI is added
to the block diagram of the Target VI. “LabSocket Start.vi” and “LabSocket-MC
Start.vi” invoke Basic and MultiClient mapping, respectively. Additional
information on the use of these VIs is presented in Section 5, LabSocket
Application Development. Wiring input details for the VIs is available in
Section 8, LabSocket Start VIs.
BML-2015-105.4.1 7
communications with the browser.
2. The HTTP server transmits HTML and JavaScript code to each browser
that connects to the system.
The two main physical implementations of the LabSocket Server software are:
2. An existing Cloud Server (Quick start option) - This option is available for
free for use with the LabSocket evaluation software and enables
developers to get started quickly with the use of the system.
Commercial users can also use one of the following two LabSocket Server
implementations. Please contact Bergmans Mechatronics to discuss and request
these options.
BML-2015-105.4.1 8
4. Setup Instructions
This section provides step-by-step instructions on the installation of the
LabSocket system. The instructions consist of two parts: i) LabSocket Server
Virtual Machine installation; and, ii) LabSocket software installation.
The LabSocket Server VM OVA file contains a Virtual Machine with Ubuntu
13.10 operating system, Apache HTTP server, ActiveMQ message broker
and administrative software. All of this software is preconfigured and will
automatically begin execution when the VM is started.
3. Start VirtualBox
6. From the Oracle VM Virtual Manager window, select the newly imported
server and press the Start button. A new terminal window will open.
BML-2015-105.4.1 9
7. At the prompt, log in the VM using the username “labsocket” and
password “labsocket” (no quotes for either value).
8. To enhance the security of the VM, change your password by entering the
command
passwd
ifconfig
Note the IP address for the "eth0" interface. This is the IP address that
will be used later for communication with the LabSocket software on this
VM.
10.The HTTP server, message broker and administrative software are all
launched automatically when the VM is started. There is therefore no
additional work required in the VM. End this terminal session using the
command
logout
11.The LabSocket Server VM is now ready for use and will continue to
operate in the background until it is stopped using the VirtualBox Manager
window.
BML-2015-105.4.1 10
4.2 LabSocket Software Installation
NOTE - The LabSocket VIPM file can optionally be downloaded from the
LabVIEW Tools Network FTP directory:
http://www.ni.com/gate/gb/GB_EVALTLKTLABSOCKET/US
In this case, substitute Step 2b above with the following two steps:
i. In the JKI Package Manager window select File > Open Package File(s).
ii. Select downloaded vip file and click Open.
BML-2015-105.4.1 11
4.3 Uninstalling LabSocket Software
1. Start LabVIEW
Note that the OpenG LabVIEW ZIP library and its dependencies may optionally
be uninstalled as part of the uninstall process.
BML-2015-105.4.1 12
5. LabSocket Application Development
This section describes the process of developing desktop applications that
operate within the LabVIEW development environment using either Basic and
MultiClient client mapping modes. For an overview of client mapping refer to
Section 3.2, Client Mapping Modes.
1. Create a new LabVIEW VI. From the main LabVIEW window, select File >
New VI
BML-2015-105.4.1 13
Figure 3. Selecting LabSocket Start.vi from Functions Palette
BML-2015-105.4.1 14
3. Wire the following three terminals of LabSocket Start.vi (Figure 4):
• IP Address – a cluster containing two strings is wired to this input:
o LabSocket_Server is the IP address of the LabSocket Server.
Two options are available here:
• URL – wire a string indicator to this terminal. This indicator will display
the URL at which the Target VI may be accessed with a browser. The
URL is based on the filename of the VI. If “labsocket.com” is used as
the LabSocket Server IP address, a random four-digit number is
appended to the URL.
4. Add a while loop, a Wait VI, and simple controls and indicators as shown
below (Figure 4). Wire the error out terminal of LabSocket Start.vi to the
edge of the while loop. This wire forces LabSocket Start.vi to complete
execution before the while loop starts.
BML-2015-105.4.1 15
a) Block Diagram
b) Front Panel
Figure 4. Simple Demo.vi
BML-2015-105.4.1 16
filename Simple Demo.vi is used, although any name is acceptable.
7. The LabSocket Status window will appear. The URL at which the Target VI
may be accessed will be displayed in the Log page of this window
(Figure 5). This URL will match that output on the URL terminal of
LabSocket Start.vi. See Section 9, LabSocket Status Window, for
additional information about the LabSocket Status window
BML-2015-105.4.1 17
8. When a browser is pointed to the URL displayed in the LabSocket
Status window, it will automatically display a representation of the Front
Panel. All supported controls and indicators in the front panel will also
become synchronized with those in the browser (Figures 6 and 7).
Each browser that connects to the system via the URL of the web client
will contain the same content as the first browser. Each user also has the
ability to change any of the active controls in the browser.
BML-2015-105.4.1 18
5.2 Creating a MultiClient Mapping Mode Application
Target
VI 1
Target VI
Prototype
Browser 1 LabSocket (inactive)
Target
Browser 2 Support
VI 2
Browser n VIs
…
Data to and
from browsers Target
VI n
Copies of Target VI
(Front panels not visible)
Figure 8 Overview of MultiClient Mapping Mode
As browsers connect to and disconnect from the system, LabSocket starts and
stops unique instances of the Target VI. When a browser is connected to the
system, LabSocket automatically synchronizes each browser with a unique
Target VI instance. The significance of MultiClient mapping mode is that is
enables each remote user to interact in an independent session with an instance
of the Target VI
BML-2015-105.4.1 19
5.2.2 Step-by-Step Instructions
The following instructions show how to use LabSocket to access a Target VI in
MultiClient Mapping mode. The instructions consist of creating two VIs: 1) a
simple Target VI; and, 2) a top-level Server VI that calls the LabSocket software
and identifies the Target VI.
1. Create a new Target VI that contains a while loop, a Wait VI, a Get
Date/Time String VI, and controls and indicators as shown below
(Figure 9). It is important to note that in MultiClient Mapping mode, the
Target VI does not contain any LabSocket VIs.
2. Set the mechanical action of the Stop button to either "Switched when
Pressed" or "Switched when Released". Save the file to disk. In this guide,
the filename MultiClientTarget.vi is used, although any name is
acceptable.
BML-2015-105.4.1 20
a) Block Diagram
b) Front Panel
Figure 9. MultiClientTarget.vi
BML-2015-105.4.1 21
3. Create a new Server VI. Add to this VI a while loop, a Wait VI, and
controls and indicators as shown below (Figure 10).
4. Also add the LabSocket-MC Start.vi to the block diagram of the Server VI.
This VI can be found in the Tools Palette under Addons>LabSocket
(Figure 11).
6. Save the Server VI. In this guide the filename Server.vi is used, though
any name is allowed.
BML-2015-105.4.1 22
a) Block Diagram
b) Front Panel
BML-2015-105.4.1 23
Figure 11. Selecting LabSocket-MC Start.vi from Functions Palette
BML-2015-105.4.1 24
7. Start the application by pressing the Run Arrow in the Server.vi front
panel. Note that MultiClientTarget.vi is not running and will remain in this
state for the duration of this exercise.
BML-2015-105.4.1 25
Figure 12. Three Browsers, Each Connected to a Unique Instance of
MultiClientTarget.vi
BML-2015-105.4.1 26
6 Standalone Applications
Two types of standalone applications may be created using LabSocket: I)
executables for Windows platforms; and, ii) deployed applications for
CompactRIO 903x NI Linux Real-Time Targets. Any number of either application
type may be created using a single LabSocket license.
Sections 6.1 and 6.2 describe procedure for creating standalone executables
using Basic and MultiClient Client Mapping, respectively. Section 6.3 provides
instructions on how to deploy a Basic Client Mapping application to a cRIO-903x
platform.
2. On the Information page, enter values for the Build Specification Name,
Target Filename and Destination Directory. Any values may be used for
these fields. The values used in this procedure are shown in Figure 14.
BML-2015-105.4.1 27
Figure 14. Build Specification Information Page
3. On the Source Files page, click on the Target VI and select it as a Startup
VI (Figure 15)
BML-2015-105.4.1 29
5. Review the settings on the Source File Settings page (Figure 17). No
changes are necessary here.
6. Press Build to build the executable. Upon completion, the executable can
be found in the build destination directory (Figure 18). As an option, the
project may be closed and LabVIEW may be exited.
BML-2015-105.4.1 30
7. Double-click on the application icon to run it, then point a browser to the
URL in the LabSocket Status Window to access it remotely (Figure 19).
BML-2015-105.4.1 31
Figure 20. Initial State of MultiClient Mapping,lvproj Project
2. On the Information page, enter values for the Build Specification Name,
Target Filename and Destination Directory. Any values may be used for
these fields. The values used in this procedure are shown in Figure 21.
BML-2015-105.4.1 32
3. On the Source Files page, set MultiClientServer.vi as a Startup VI and
MultiClientTarget.vi an Always Included VI. (Figure 22).
BML-2015-105.4.1 33
a) Destination for MultiClient.exe
BML-2015-105.4.1 34
5. Review the settings on the Source File Settings page (Figure 24). The
default values for “Inclusion Type” and “Destination”, shown in Table 2,
should be used.
BML-2015-105.4.1 35
a) Source File Settings for MultiClientServer.vi
BML-2015-105.4.1 36
6. Press Build to build the executable. Upon completion, the executable can
be found in the build destination directory (Figure 25). As an option, the
project may be closed and LabVIEW may be exited.
7. Double-click on the application icon to run it, then point multiple browsers
to the URL in the LabSocket Status Window to establish remote
connections to independent instances of the Target VI (Figure 26).
BML-2015-105.4.1 37
Figure 26. Three Browsers, Each Connected to a Unique Instance of
MultiClientTarget.vi Launched from Executable of MultiClientServer.vi
BML-2015-105.4.1 38
6.3 Deploying to NI Linux Real-Time Targets
The following instructions describe how to deploy a Target VI that includes the
LabSocket software to a CompactRIO cRIO-903x for operation in headless mode
and using the LabSocket Basic client mapping mode.
These instructions assume that the cRIO-903x device has already been
connected to the development platform and that a LabVIEW project that
includes the cRIO-903x device has already been created.
BML-2015-105.4.1 39
2. Right-click on Build Specification and select New > Real-Time Application.
The Application Properties pop-up window will open.
3. Enter the Build specification name on the Information page. In this case
the name is “Element Test” is used (Figure 28).
BML-2015-105.4.1 40
4. Select the Source Files page. Select the name of the Target VI
(“LabSocket Demo – Element Test.vi”) in this case and select it as a
Startup VI (Figure 29).
BML-2015-105.4.1 41
5. The default settings for the Destinations and Source File Setting
categories are shown in Figures 30 and 31 for reference purposes. These
settings do not need to be changed.
BML-2015-105.4.1 42
Figure 31. Real-Time Application Source File Settings Page
10.Right-click on the target in the Project tree and select Utilities > Restart
to restart the cRIO.
BML-2015-105.4.1 43
Target)VI)Opera2ng)on)cRIO)
Display)Connected)to)
cRIO%9030))
Mini)DisplayPort)
Target)VI)Displayed))
in)Browser)on)Mac)
cRIO%9030)
LabVIEW)Project)for)
Target)VI)
(in)Windows)VM)on)Mac))
BML-2015-105.4.1 44
7. Example Files
The LabSocket VIPM package installation process in Section 4.2, LabSocket
Software Installation, automatically installs a set of example Target VIs that
illustrate the capabilities the system. These VIs may be accessed by
selecting Help > Find Examples... from the main LabVIEW window. Select
the Directory Structure radio button. In the directory structure, double-click on
the LabSocket directory, to locate the examples (Figure 33).
Two types of example VIs are included with the LabSocket VIPM: The first type
is example VIs that demonstrate replication of front panel elements. These VIs
are listed in Table 3. Although each of these VIs operates in Basic client
mapping mode, the concepts demonstrated in these VIs are applicable to
MultiClient mapping mode.
The second type of example VIs demonstrate MultiClient mapping (Table 4).
These VIs can be found within the MultiClient directory in the LabSocket
example directory described above.
BML-2015-105.4.1 45
Table 3. Front Panel Replication Example VIs
Filename Description
LabSocket*Demo*-*Advanced*Booleans.vi Demonstrates*that*booleans*defined*as*Strict*Type*Defs*are*
replicated*using*images*of*the*true*and*false*states.
LabSocket*Demo*-*Custom*JavaScript.vi Uses*the*LabSocket3Custom3JavaScript.vi3to*insert*arbitrary*
text*into*the*browser*client.**
LabSocket*Demo*-*Custom*JavaScript*-*New*Browser.vi Uses*the*LabSocket3Custom3JavaScript.vi3to*insert*event*
handlers*into*the*browser*client.
LabSocket*Demo*-*Dynamic*Pictures.vi Demonstrates*dynamic*synchronization*of*pictures*elements*
with*those*in*the*browser
LabSocket*Demo*-*Element*Test*-*Simple.vi A*simplified*version*of*"LabSocket*Demo*-*Element*Test.vi"
LabSocket*Demo*-*Element*Test.vi Demonstrates*synchronization*of*Front*Panel*elements*values*
LabSocket*Demo*-*Enum.vi Demonstrates*synchronization*of*enumerated*types
LabSocket*Demo*-*Math*Demo.vi Illustrates*how*to*use*LabSocket*in*a*multiple-VI*system.*The*
front*panel*of*the*main*Target*VI*is*accessible*over*the*web*
while*other*VIs**VI*display*the*Target*VI*URL*and*a*Stop*button*
for*the*application
LabSocket*Demo*-*MultiColumn*ListBox*-*Control.vi Demonstrates*the*use*of*a*MultiColumn*ListBox*as*a*control*
LabSocket*Demo*-*MultiColumn*ListBox.vi Demonstrates*the*eight*combinations*of*MultiColumn*
ListBoxes*that*are*possible*based*on*i)*row*visibility;*ii)*column*
header*visibility;*and,*iii)*presence*of*vertical*scrollbar.
LabSocket*Demo*-*Multiline*Button*Text*and*Accents.vi Illustrates*support*for*buttons*with*multiple*lines*of*text*and*
string*controls*and*indicators*with*accents
LabSocket*Demo*-*Picture*Ring*Simple.vi A*simple*demonstration*of*picture*rings*in*action
LabSocket*Demo*-*Picture*Ring.vi Picture*ring*demonstration
LabSocket*Demo*-*Picture.vi Demonstrates*replication*of*a*picture*element*in*the*browser
LabSocket*Demo*-*Plots*as*Images Illustrates*the*use*of*the*#LS_image*preprocessor*tag*to*
enable*replication*of*plots*as*images
LabSocket*Demo*-*Preprocessor.vi Illustrates*the*use*of*the*#LS_no_display*and*#LS_no_sync*
preprocessor*tags*to*hide*and*unsynchronize,*respectively,*
front*panel*elements
LabSocket*Demo*-*Quiz.vi Illustrates*how*to*set*up*a*simple*quiz*application.**Includes*
dynamic*updates*of*button*text*and*text*indicator*background*
color.*
LabSocket*Demo*-*Stub*VI.vi Demonstrates*the*use*of*the*"element*stub.vi"*that*enables*
developers*to*create*custom*JavaScript*code*for*unsupported*
front*panel*elements.
LabSocket*Demo*-*Tabs.vi Demonstates*synchornization*of*tab*element*pages
LabSocket*Demo*-*Waveform*Chart.vi Demonstration*of*support*for*Waveform*Charts
LabSocket*Demo*-*Waveform*Graph.vi Demonstration*of*support*for*Waveform*Graphs
LabSocket*Demo*-*XY*Graph.vi Demonstration*of*support*for*XY*Graphs
BML-2015-105.4.1 47
Table 5. Terminals of LabSocket Start.vi and LabSocket-MC Start.vi
Default Input
Terminal Description Value
Maximum Defines the maximum number of clients that can connect 1
Number of to the system.
Clients (LabSocket-MC Start.vi only)
Server Cluster containing username and password for access to LabVIEW /
Credentials LabSocket Server LabVIEW
IP Address Cluster containing two strings: XX.XX.XX.XX /
• LabSocket_Server – IP Address of LabSocket Server blank
relative to LabVIEW Host platform. Section 4.1, Step 9
describes how to determine this value.
• External – IP Address of LabSocket Server relative to
browser. Leave blank if same as LabSocket_Server IP
address.
To use the LabSocket server software on the cloud server
at labsocket.com during initial evaluation testing, set
LabSocket_Server to “labsocket.com” (no quotes) and
leave External blank
Application • standalone – Target VI is rendered alone in a web page standalone
Type • moodle_integration – Target VI is rendered within an
iFrame in a Moodle course web page. Contact
Bergmans Mechatronics for more information on this
option.
Authentication User authentication requirement for browser access False
Required • True – A pop-up window appears in browser when web
page loads. User must enter credentials before web
page becomes active (Figure 36)
• False – User credentials are not requested. (In this
case, the browser sends the credentials “client /
client” to the message broker. Unless these credential
settings have been changed, browser access will always
be permitted.)
See Section 11, User Administration, for additional details
about user administration and authentication.
error in Errors that occur before LabSocket Start(-MC).vi is called no error
Target VI Path to Target VI. empty path
(LabSocket-MC Start.vi only)
error out Errors that occur prior to calling or within LabSocket NA
Start(-MC).vi
URL URL for access to Target VI NA
BML-2015-105.4.1 48
Figure 36. Login Window That Appears When
Authentication Required Input is True
BML-2015-105.4.1 49
9. LabSocket Status Window
The LabSocket Status Window provides details on the operation of the
LabSocket software. The window appears when either the LabSocket Start.vi or
LabSocket-MC Start.vi are called and contains three pages: 1) a Log page; 2) a
Clients page; and, 3) a Diagnostics page. Each of these pages is described in
detail below.
Note that calls to either LabSocket Start.vi and LabSocket-MC Start.vi will launch
the Status Window only if the window is not already active.
BML-2015-105.4.1 50
Figure 38. LabSocket Status Window – Clients Page
BML-2015-105.4.1 51
The Diagnostics page also includes a display of the number of clients currently
connected to the Target VI
Click Close to close the Status window and discontinue the synchronization of
the Target VI and browser. Closing the Status window will not stop the Target
VI and stopping the Target VI does not close the Status window.
BML-2015-105.4.1 52
10. Advanced Features
This section provides details on the following advanced features of LabSocket: i)
preprocessor tags that allow fine tuning of the browser client; ii) picture ring
support and high-fidelity replication of boolean elements; iii) insertion of custom
JavaScript code into the browser client; and, iv) replication of PNG images in the
browser.
Optional/arguments/are:/
i)/compression/I/image/compression/(0=no/
image/compression,/9=maximum/image/
compression);/and,
/ii)/decimation/I/number/of/iterations/of/main/
LabSocket/processing/loop/to/skip/before/
checking/for/image/update.
Not/supported/on/cRIOI903x/targets.
The effect of the #LS_no_display tag is shown in the screenshot of the example
VI “LabSocket Demo - Preprocessor.vi” in Figure 40. The example VI “LabSocket
Demo - Plots as Images.vi” also demonstrates the effect of preprocessor tags
(see Section 7, Example VIs).
BML-2015-105.4.1 53
Figure 40. Screenshot of “LabSocket Demo – Preprocessor.vi” demonstrating the
use of “#LS_no_display” preprocessor tag to prevent replication of a picture
(L- LabVIEW VI, R – Browser)
BML-2015-105.4.1 54
10.2 Picture Rings and High-Fidelity Boolean Elements
LabSocket supports replication of Picture Ring controls and indicators. This
replication only occurs if the element is a type def, otherwise the element is not
replicated. The example VI “LabSocket Demo – Picture Ring Simple.vi” illustrates
Picture Ring control and indicator replication (Figure 41).
BML-2015-105.4.1 55
LabSocket also supports high-fidelity replication of Boolean controls and element
if the element is a type def. A screenshot of the example VI “LabSocket Demo –
Advanced Booleans.vi” and its browser representation is illustrated in Figure 42.
BML-2015-105.4.1 56
screenshot of the block diagram of this VI is shown in Figure 43. The front panel
and browser representation are shown in Figure 44.
BML-2015-105.4.1 57
10.3.2 Custom JavaScript for Unsupported Elements
The second customization option is to add arbitrary JavaScript code to the
browser for LabVIEW front panel element types that are not supported by the
LabSocket system.
BML-2015-105.4.1 58
Figure 46. Screenshot of “LabSocket Demo – Stub VI.vi” illustrating the use of
“element – stub vi” to add custom browser representations for currently
unsupported front panel elements (L- LabVIEW VI, R – Browser)
3. A new, unnamed VI will appear. Copy the picture control from this VI to
the front panel of the Target VI.
BML-2015-105.4.1 59
A simple Target VI using a picture element and its representation in a browser is
shown in Figure 47.
BML-2015-105.4.1 60
11. User Administration
All applications and users connecting to the ActiveMQ message broker require
proper credentials before transmitting or receiving data via the broker. By
default, the broker loads credentials from a configuration file on startup. This
section describes how to modify the credentials in this configuration file.
In the instructions below, two locations within the VM directory structure are
defined as follows:
$LABSOCKET_HOME = /home/labsocket
$ACTIVEMQ_HOME = /home/labsocket/apache-activemq-5.9.0
BML-2015-105.4.1 61
Table 7. Default User Definitions of ActiveMQ Message Broker
in LabSocket Server VM
Username Description
LabVIEW name used by LabSocket Support VIs. This username
and its associated password are wired to the Server
Credentials input of LabSocket Start.vi
LabSocketPHP name used by PHP-based administrative program.
Credentials for this client are defined in the file
$LABSOCKET_HOME/LabSocket_php/credentials.txt
client remote browser user
client2 remote browser user
To activate the new user settings, restart the Virtual Machine using the
command
BML-2015-105.4.1 62