extending labview to the web using “labsockets”

13
Extending LabVIEW to the Web using the “LabSocket” System John Bergmans Bergmans Mechatronics LLC www.bergmans.com National Instruments LabVIEW User Group Meeting Santa Ana, CA Nov 17 2010 1616 Bedford Lane, Unit A Phone: 714-474-8956 Newport Beach, CA 92660 Fax: 949-646-1429 Bergmans Mechatronics LLC

Upload: bergmans-mechatronics-llc

Post on 18-Dec-2014

1.864 views

Category:

Technology


2 download

DESCRIPTION

Bergmans Mechatronics’ “LabSockets” system enables LabVIEW applications to be monitored and controlled from a desktop or mobile web browser (including the Safari browser for iPhone and iPad), without browser plug-ins. The system employs the new WebSocket interface standard which enables continuous, bi-directional communications between web browsers and servers. Included in the presentation are i) the limitations of current techniques for remote access to LabVIEW applications; ii) an introduction to WebSockets; and, iii) an overview of the structure and operation of the LabSocket system. A video of the system in action is available here http://screencast.com/t/eKuQ02PAdo . Please contact John Bergmans (jbergmansbergmans.com) if you'd like to try using LabSockets with your application.

TRANSCRIPT

Page 1: Extending LabVIEW to the Web using “LabSockets”

Extending LabVIEW tothe Web using the

“LabSocket” System

John BergmansBergmans Mechatronics LLC

www.bergmans.com

National Instruments LabVIEW User Group MeetingSanta Ana, CANov 17 2010

1616 Bedford Lane, Unit A Phone: 714-474-8956Newport Beach, CA 92660 Fax: 949-646-1429

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

Page 2: Extending LabVIEW to the Web using “LabSockets”

• Goal: monitor and control a LabVIEW application using a plug-in-free browser

• Potential Use-Cases

• Monitor and control a LabVIEW-controlled lab test from the desktop in office or on the road using a mobile device

• Monitor large-scale LabVIEW application by crews in the field – ie oil rig equipment monitoring

• For low-cost embedded systems – eliminate physical UI by using browser to interface to device

Bergmans Mechatronics LLC

Remote Access to LabVIEW Application

LabVIEW Application

Browser onLaptop,

Desktop orMobile DeviceDesktop /

Embedded Device

Page 3: Extending LabVIEW to the Web using “LabSockets”

1. 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

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)

Bergmans Mechatronics LLC

Current Approaches

Page 4: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

Browser/Back-End Communications

Traditional interface between browser and web server

Desktop Server

1) Data Request

2) ReplyBack-End

ApplicationBrowser Web ServerSoftware

Page 5: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

Traditional interface between browser and web server

Desktop Server

1) Data Request

2) ReplyBack-End

ApplicationBrowser Web ServerSoftware

Continuous bi-directional communication between browser and server using WebSocket

Desktop Server

WebSocketServer

Back-EndApplication

WebSocket

Browser

Data to Back-End App

Data from Back-End App

Browser/Back-End Communications

Page 6: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

WebSocket

• Enables continuous, bidirectional communications between browser and server

• Originally part of new HTML5 specification, now a stand-alone spec (W3C – API, IETF – protocol)

• Simple browser and back-end implementation

• Substantially reduced header info size (request and response: ~900 bytes vs WebSocket: 4 bytes)

• Multiple organizations developing WebSocket servers

• Kaazing Corp., Mountain View, CA (www.kaazing.com) • Developer of commercial WebSocket gateway• Emulation for legacy and mobile browsers• Contributor to HTML5 spec• Disclosure: BML has referral agreement with Kaazing

Page 7: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

Sample BML Demo Applications using WebSocket

Interface to MySQLhttp://http://www.bergmans.com/lab/ws_sql.html

EarthControl – Multiplayer Facebook gamehttp://apps.facebook.com/earthcontrol

Page 8: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

“LabSocket” = LabVIEW + WebSocket

LabSocket system uses WebSockets to enable automatic replication of LabVIEW front panel in a browser without plug-ins

Data transfer via

WebSocket

Data transfer via

TCP/IP Socket

LabVIEW Application

WebSocketGateway

MessageBroker

LabSocketInterface

Browser onDesktop or

Mobile DeviceDesktop / Embedded Device

Server

Page 9: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

“LabSocket” = LabVIEW + WebSocket

LabSocket system uses WebSockets to enable automatic replication of LabVIEW front panel in a browser without plug-ins

Data transfer via

WebSocket

Data transfer via

TCP/IP Socket

LabVIEW Application

WebSocketGateway

MessageBroker

LabSocketInterface

Browser onDesktop or

Mobile DeviceDesktop / Embedded Device

LabSocket Interface

Startup- Establish TCP/IP socket connection to message broker- LabVIEW Front Panel Screen Scrape, send JavaScript code to web server

Steady-state- Transmit updates in LabVIEW front panel to browser- Update LabVIEW front panel based on events generated in browser

Server

Page 10: Extending LabVIEW to the Web using “LabSockets”

Asynchronous MessagingProtocol

Data transfer via WebSocket

Data transfer via TCP/IP Socket

LabVIEW Application

CloudServer WebSocket

GatewayMessage Broker

LabSocketInterface

Bergmans Mechatronics LLC

LabSocket – Cloud Service Configuration

Browser onDesktop or

Mobile DeviceDesktop / Embedded Device

Page 11: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

Demohttp://www.bergmans.com/lab/LabSocket.html

LabVIEW Front Panel Chrome Browser

Page 12: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

Screenscrape SubVI

Label for one LED

Page 13: Extending LabVIEW to the Web using “LabSockets”

Bergmans Mechatronics LLC

Future Work• Perform demo / proof-of-concept testing

• Complete cloud service• Allow LabVIEW developers to automatically set up applications• Subscription set up

• Improved GUI element support• Additional GUI elements• Additional GUI element properties (color, font type, etc)