Sei sulla pagina 1di 29

LabVIEW

Web Services

Hans-Pe4er Halvorsen, M.Sc.

Problem
How to Share Data between Devices in a Network?
Server(s)

Firewalls
Security
Local Network/
Internet

Clients

Routers/Switches, etc.

Data
2

Problem
How to Share Data between Devices in a Network?

Data

Clients

Direct ConnecLon between the Data(base) and the Clients that need the Data is
normally not possible, due to security, compaLbility issues, etc. (Firewalls, Hacker
A4acks, etc.)
Direct ConnecLon in a Local Network (behind the Firewall) is normally OK but
3
not over the Internet

SoluLon: Web Service

Web Service

Internet

HTTP

Clients

Data
Web Services uses standard web protocols like HTTP, etc.
HTTP is supported by all Web Browser, Servers and many Programming Languages.
This means you can create and use Web Services in all the popular programming
languages.

LabVIEW Web Services

CreaLng the Web Service in LabVIEW


Create an empty
LabVIEW Project
or use your
exisLng Project

Create a Web Service Method

Create your
Block Diagram

Create your
Front Panel

TesLng and Debugging

Default Port for Debugging: 8001

It Works!

Manage the Web Service


or type: h4p://localhost:3582 in your Browser

Here you can change HTTP


Port, etc.
The Default Port is 8080

Default Login:
UserName: Admin
Password:<empty>

Web Service ProperLes

Publish the Web Service


Default Port for
Publishing: 8080

It Works!

Note! IP address 127.0.0.1 is the localhost address. You


may use your actual IP address instead. Espesially when
calling the Web Service form another computer or device,
you need to spesify the actual IP address.

How-To Find your IP Address

Install Web Service on the Server/Remote


Computer/Device without LabVIEW installed

Congure the Web Applica/on Server: h4p://localhost:3582 in theWeb Browser o your


Server or h4p://[remote device IP address] . Note! Microsoi Silverlight is required.

Data Dashboard for LabVIEW

iPad, iPhone, Android, Windows 8

iPhone Example

Enter the IP Address for your


Server (the computer where the
LabWIEW Web Service is installed)

iPhone Example

iPhone Example

Windows 8 Example

References
Tutorial: CreaLng and Accessing a LabVIEW
Web Service:
h4p://zone.ni.com/reference/en-XX/help/
371361K-01/lvhowto/build_web_service/

Hans-Pe7er Halvorsen, M.Sc.


Telemark University College
Faculty of Technology
Department of Electrical Engineering, Informa/on Technology and Cyberne/cs


E-mail: hans.p.halvorsen@hit.no
Blog: h7p://home.hit.no/~hansha/

29

Potrebbero piacerti anche