labview web services

Post on 20-Jan-2017

273 Views

Category:

Documents

15 Downloads

Preview:

Click to see full reader

TRANSCRIPT

LabVIEW  Web  Services  

Hans-­‐Pe4er  Halvorsen,  M.Sc.  

Problem  

2  

Clients  

Data  

How  to  Share  Data  between  Devices  in  a  Network?  

Local  Network/Internet  

Server(s)  Firewalls  

Routers/Switches,  etc.  

Security  

Problem  

3  

Clients  Data  

How  to  Share  Data  between  Devices  in  a  Network?  

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  not  over  the  Internet  

SoluLon:  Web  Service  

Web  Service  Internet  

 HTTP  

Clients  

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.  

Data  

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  

Here  you  can  change  HTTP  Port,  etc.  The  Default  Port  is  8080  

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

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  

Configure  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  

top related