Extending LabVIEW to the Web Using the LabSocket System

25
Extending LabVIEW to the Web Using the LabSocket System John Bergmans, CLD Bergmans Mechatronics LLC Bay Area LabVIEW User Group Meeting Santa Clara, CA Nov 19, 2013 B e rg m an s M ech a tro n ic s L LC 1616 Bedford Lane, Unit A bergmans.com Newport Beach, CA 92660 @jbergmans

description

The LabSocket system enables remote access to LabVIEW application using desktop or mobile web browsers without the need for browser plugins or a client-side run time engine. The system supports commonly used front panel elements, including Waveform Charts and Graphs, XY Graphs, MultiColumn ListBoxes and Tabs. The LabSocket-RT version of the system, with support for a limited set of front panel elements, enables browser access to LabVIEW Real-Time applications operating on platforms such at the CompactRIO. A key technology used in the system is the HTML5 WebSocket interface which enables continuous, bi-directional communication with a web browser. This technology also contributes to the name of the system: "LabSocket = LabVIEW + WebSocket". This presentation provides an overview of the system theory of operation, several existing applications for the system, and live demonstrations. Additional information about LabSocket is available at http://labsocket.com.

Transcript of Extending LabVIEW to the Web Using the LabSocket System

Page 1: Extending LabVIEW to the Web Using the LabSocket System

Extending LabVIEWto the Web Using the

LabSocket System

John Bergmans, CLD

Bergmans Mechatronics LLC

Bay Area LabVIEW User Group Meeting

Santa Clara, CA

Nov 19, 2013

B e r g m a n s M e c h a t r o n i c s L L C

1616 Bedford Lane, Unit A bergmans.comNewport Beach, CA 92660 @jbergmans

Page 2: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Current Approaches to Remote LabVIEW Access1.Native Client App

• Use TCP/IP sockets, LabVIEW shared variables, or .NET, to transmit data between client and LabVIEW

• Requires custom client development and modifications to LabVIEW app

2.LabVIEW Remote Panels• Requires LabVIEW Run-Time Engine (RTE) and browser plug-in on client platform

3.LabVIEW Web Services• Data transferred between application and client using the HTTP request-

response model (REpresentative State Transfer (REST) architecture)• Requires development of client software using Web languages

eg. HTML/JavaScript

4.LabVIEW Web UI Builder (http://www.ni.com/uibuilder/)• Build and run apps in browser using reduced-capabiliy LabVIEW• Requires Silverlight plug-in (runs on Windows and Mac OS X)

5.Data Dashboard for LabVIEW• Requires development of user interface and linking UI to block diagram• Limited to iOS, Android, Windows 8 and Windows Phone devices

Page 3: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

LabSocket System

Browser

LabSocket ServerPlatform

HTTP Server

Message Broker

“Target VI”

LabSocket Support VIs

LabVIEW Host Platform

Browser

Browser

WebSocket Interface

(Over TCP-IP)

HTML5 WebSockets enable automatic replication of LabVIEW front panel in a browser without plug-ins

LabSocket Support VIs

Startup- LabVIEW Front Panel screenscrape, send HTML and JavaScript code to HTTP server

Continous Operation- Transmit updates of LabVIEW front panel to browser- Update LabVIEW front panel when user generates events in browser

TCP-IPSocket

Interface

Page 4: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Other Configurations

Browser

LabSocket ServerPlatform (VM)

HTTP Server

Message Broker

“Target VI”

LabSocket Support VIs

LabVIEW Host Platform

Browser

Browser

WebSocket Interface

(Over TCP-IP)

TCP-IPSocket

Interface

Browser

LabSocket ServerPlatform (VM)

HTTP Server

Message Broker

“Target VI”

LabSocket Support VIs

LabVIEW Host Platform

Browser

Browser

WebSocket Interface

(Over TCP-IP)

TCP-IPSocket

Interface

PC on LAN

Page 5: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Demo Configuration

Browser

LabSocket ServerPlatform

HTTP Server

Message Broker

“Target VI”

LabSocket Support VIs

MacBook Pro

Browser

Browser

WebSocket Interface

(Over TCP-IP)

TCP-IPSocket

Interface

Server in San Jose, CA

Amazon EC2 Instancein Northern VA

Page 6: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Graphing

LabVIEW Front Panel Browser Representation

Page 7: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

MultiColumn ListBoxes

LabVIEW Front Panel Browser Representation

Page 8: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

LabSocket Start VITools Palette Context Help

Page 9: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Authentication• Authentication=T forces users to enter credentials • User authentication managed by ActiveMQ message broker

Page 10: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Moodle Integration

LabVIEW Front Panel LabSocket iframe in Moodle Lesson

• Option for integration with MOODLE Course Management System - https://moodle.org/

• application_type = moodle_integration places web page in moodle file structure

Page 11: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Remote Cascade Lab - KTH Royal Institute of Technology (Sweden)

GUI Main View Live Traverse Results

• Objective: to perform tests on turbine airfoils• LabVIEW software used to control test rig• LabSocket system enables lab testing to be performed

remotely using browser• Remote control of rig aided by use of web cam• 70 students have operated rig remotely with LabSocket

system to date (60 in groups of 3-6 and 10 individually)• Lab part of EU funded Virtual Campus Hub project

Additional information at: http://www.energy.kth.se/proj/projects/Remote_labs/RL/RL_website/RCL/RCL.html

Page 12: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

SportJury – First Commercial LabSocket Application

iPod touch browser screenshots

Swiss Snow Happening judges entering score data on iPod touch devices

Data aggregated on central PC

• Distributed, multi-user application for judging ski competitions• Used successfully at 2011 Swiss Snow Happening in Saas-Fee, Switzerland• Developed by Dynasys, D. Kölliker (Neuenegg, Switzerland) www.dynasys.ch

Page 13: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

“Multi-Pack” Systems for TEMPUS Program• TEMPUS: EU Program for modernization of higher education programs in Eastern

Europe, Central Asia, Western Balkans and Mediterranean - http://eacea.ec.europa.eu/tempus/

• “Multi-Pack” systems (eg. “Twin-Pack”, “Five-Pack”, etc) to be delivered as complete sets to TEMPUS partner university labs

• Integration with MOODLE Course Management System - https://moodle.org/

Page 14: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

LabSocket-RTLabSocket for LabVIEW Real-Time

Page 15: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

LabSocket-RT

HTTP Server

Message Broker

“Target VI” Copy

LabSocket Support VIs

LabVIEW RT Host Platform

Browser

WebSocket Interface

(Over TCP-IP)

TCP-IPSocket

Interface

Block Diagram Interface VIs

“Target VI”

LabSocket-RT Converter

LabVIEW Development PC

“Target VI” Copy

Block Diagram Interface VIs

Step 1 LabSocket-RT Converter copies HTML and JS to HTTP Server

Step 3 “Target VI” Copymanually deployed to RT Host

VM or Physical Server

Step 2 LabSocket-RT Converter inserts Block Diagram Interface

VIs into “Target VI” copy

• Special version for access to applications on LabVIEW Real-Time platforms

• Support for reduced set of Front Panel elements• Possible use case: RT application monitoring /

debugging

Page 16: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

LabSocket-RT• Converter replaces front panel elements in block diagram with “Block

Diagram Interface VIs”

Demo1.vi Demo1_RT.vi

Block Diagram Interface VIs

Page 17: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

LabSocket-RT• LabSocket RT Converter modifies copy of Target VI block diagram• Start Converter from Tools > LabSocket RT > LabSocket RT Converter …• Target copy manually added to project, included in build, and deloyed to RT plaform

LabSocket RT Converter

LabVIEW RT Project

Page 18: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

LabSocket-RT

Chrome Browser on Mac

Chrome Browser on iPhone

Demo1.vi Front Panel (Idle)

Screenshots

Page 19: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Closing Notes

• Coming soon: LabSocket on LabVIEW Tools Network

• Possible framework for custom or more complex applications

• Consider: LabVIEW / LabSocket as dynamic web authoring system (NoFlo alternative)

• What other applications can be enabled by WebSockets?

Page 20: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

ContactJohn BergmansBergmans Mechatronics LLC

phone: 714-474-8956e-mail: [email protected]: bergmans.comtwitter: @jbergmans

More Information and Downloadable Demoslabsocket.com

Page 21: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Extra Slides

Page 22: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

LabSocket Details

• Dynamically replicates LabVIEW front panel element values and properties such as color, visibility, disabled state, etc.

• Compatible with desktop and mobile browsers that have native WebSocket support (including Safari browser in iPhone, iPod touch and iPad). Option available for browsers without WebSocket support.

• Two possible architectures• Basic – one LabVIEW front panel replicated in one or more browsers• Multi-Client – multiple unique copies of a LabVIEW VI each connect to one or

more browsers

• Two platforms for LabSocket Server• Customer Server (LAN or cloud)• LabSocket Cloud

• Additional information and downloadable evaluation system at www.labsocket.com

Page 23: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Element Test VI

LabVIEW Front Panel Browser Representation

Page 24: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Waveform Charts

LabVIEW Front Panel Browser Representation

Page 25: Extending LabVIEW to the Web Using the LabSocket System

Bergmans Mechatronics LLC

Waveform Graphs

LabVIEW Front Panel Browser Representation