labview web services

29
LabVIEW Web Services HansPe4er Halvorsen, M.Sc.

Upload: tranhanh

Post on 20-Jan-2017

273 views

Category:

Documents


15 download

TRANSCRIPT

Page 1: LabVIEW Web Services

LabVIEW  Web  Services  

Hans-­‐Pe4er  Halvorsen,  M.Sc.  

Page 2: LabVIEW Web Services

Problem  

2  

Clients  

Data  

How  to  Share  Data  between  Devices  in  a  Network?  

Local  Network/Internet  

Server(s)  Firewalls  

Routers/Switches,  etc.  

Security  

Page 3: LabVIEW Web Services

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  

Page 4: LabVIEW Web Services

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  

Page 5: LabVIEW Web Services

LabVIEW  Web  Services  

Page 6: LabVIEW Web Services

CreaLng  the  Web  Service  in  LabVIEW  

Create  an  empty  LabVIEW  Project  –  or  use  your  exisLng  Project  

Page 7: LabVIEW Web Services

Create  a  Web  Service  Method  

Page 8: LabVIEW Web Services

Create  your  Block  Diagram  

Page 9: LabVIEW Web Services

Create  your  Front  Panel  

Page 10: LabVIEW Web Services

TesLng  and  Debugging  

Page 11: LabVIEW Web Services

Default  Port  for  Debugging:  8001  

Page 12: LabVIEW Web Services

It  Works!  

Page 13: LabVIEW Web Services

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>  

Page 14: LabVIEW Web Services
Page 15: LabVIEW Web Services
Page 16: LabVIEW Web Services

Web  Service  ProperLes  

Page 17: LabVIEW Web Services

Publish  the  Web  Service  

Default  Port  for  Publishing:  8080  

Page 18: LabVIEW Web Services

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.  

Page 19: LabVIEW Web Services

How-­‐To  Find  your  IP  Address  

Page 20: LabVIEW Web Services

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.  

Page 21: LabVIEW Web Services

Data  Dashboard  for  LabVIEW  

iPad,  iPhone,  Android,  Windows  8  

Page 22: LabVIEW Web Services

iPhone  Example  

Enter  the  IP  Address  for  your  “Server”  (the  computer  where  the  LabWIEW  Web  Service  is  installed)  

Page 23: LabVIEW Web Services

iPhone  Example  

Page 24: LabVIEW Web Services

iPhone  Example  

Page 25: LabVIEW Web Services

Windows  8  Example  

Page 26: LabVIEW Web Services
Page 27: LabVIEW Web Services
Page 28: LabVIEW Web Services

References  

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

Page 29: LabVIEW Web Services

Hans-­‐Pe7er  Halvorsen,  M.Sc.  Telemark  University  College  Faculty  of  Technology  Department  of  Electrical  Engineering,  Informa/on  Technology  and  Cyberne/cs  

   E-­‐mail:  [email protected]  Blog:  h7p://home.hit.no/~hansha/    

29