39
ni.com Building Web Applications with LabVIEW Alexey Podolskiy Technical Marketing Engineer

Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

  • Upload
    vobao

  • View
    265

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

ni.com

Building Web Applications with LabVIEW Alexey Podolskiy

Technical Marketing Engineer

Page 2: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

2ni.com

High Level Web Connectivity Options in LabVIEW

Page 3: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

5ni.com

The way

1. Context

3. HTTP4. HTML/JS

7. Next Steps

2. Web Services

6. The Cloud5. JavaScript Libraries

Page 4: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

ni.com

www.tinyurl.com/lvweb

https://decibel.ni.com/content/groups/web-services

Page 5: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

7ni.com

Remote Connectivity Options in LabVIEW

Page 6: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

8ni.com

LabVIEW Web Client Technologies

Native Technologies• HTTP Palette• TCP/UDP/FTP/SMTP/WebDav• LabVIEW Web Server

External Tools• LabSocket• WebPager• Cloud Dashboard

Page 7: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

10ni.com

2. Web Services

1. Context

3. HTTP4. HTML/JS

7. Next Steps

2. Web Services

6. The Cloud5. JavaScript Libraries

Page 8: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

11ni.com

What is a Web Server?

Software that accepts and responds to HTTP requests, usually from a browser.

Page 9: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

12ni.com

LabVIEW Web Services

Web Service

LabVIEW Web Services host web content and respond to HTTP requests.

Page 10: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

13ni.com

LabVIEW Web Services

Web Browser

Web Service

LabVIEW Web Services host web content and respond to HTTP requests.

Page 11: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

14ni.com

LabVIEW Web Services

Web Browser

Web Service

LabVIEWWeb Method

LabVIEW Web Services host web content and respond to HTTP requests.

Page 12: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

15ni.com

Web Service in a Project

Page 13: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

16ni.com

Web Service in a Project

Page 14: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

17ni.com

Static Content and Web Methods

Web Browser

Web Service

LabVIEWWeb Method

HTML

JS

CSS

Page 15: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

18ni.com

3. HTTP

1. Context

3. HTTP4. HTML/JS

7. Next Steps

2. Web Services

6. The Cloud5. JavaScript Libraries

Page 16: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

19ni.com

Uniform Resource Locator OR “Web Address”

scheme://domain:port/path?query_string

URL

HTTP – Hyper Text Transfer Protocol

ProtocolLocation Resource path

Query String

http://www.ni.com/exampleURL?value=“true”

Page 17: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

20ni.com

HTTP Demo –Add two numbers

http://127.0.0.1:8001/WebService1/add?b=4.5&a=3.5

Ex.

Page 18: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

22ni.com

HTTP Demo –Add two numbers

Protocol Target Web Service Name

VI Name

http://127.0.0.1:8080/WebService1/add?b=2&a=4

Query

Page 19: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

23ni.com

URL Mapping

Page 20: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

24ni.com

Browser to LabVIEW Communication

Web Browser

Web Service

LabVIEWWeb Method

Page 21: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

25ni.com

Static Content and Web Methods

Web Browser

Web Service

LabVIEWWeb Method

HTML

JS

CSS

Page 22: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

26ni.com

4. HTML/JS

1. Context

3. HTTP4. HTML/JS

7. Next Steps

2. Web Services

6. The Cloud5. JavaScript Libraries

Page 23: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

27ni.com

What is HTML?

HTML is a markup language for describing web documents (web pages). It is the Front Panel of your web application.

Ex.

Page 24: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

28ni.com

What is JavaScript?

JavaScript can change HTML content. It is the Block Diagram of your web application.

Ex.

Turn on a lightbulbJavaScript Introduction

Page 25: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

29ni.com

HTML and JavaScript Run in the Browser

Web Browser

Web Service

LabVIEWWeb Method

Page 26: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

30ni.com

AJAX

Web Browser

Web Service

LabVIEWWeb Method

Asynchronous JavaScript and XML – web applications with behind the scenes updates

Page 27: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

31ni.com

AJAX Demo –Add on Value Change

Ex.http://127.0.0.1:8001/WebClient/home.html

Page 28: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

36ni.com

Add Two Numbers on Value Change - AJAX

• LabVIEW Web Method

Page 29: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

39ni.com

AJAX

Web Browser

Web Service

LabVIEWWeb Method

Asynchronous JavaScript and XML – web applications with behind the scenes updates

Page 30: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

40ni.com

5. JavaScript Libraries

1. Context

3. HTTP4. HTML/JS

7. Next Steps

2. Web Services

6. The Cloud5. JavaScript Libraries

Page 31: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

41ni.com

JavaScript Libraries

Web Browser

Web Service

LabVIEWWeb Method

Libraries

Page 32: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

43ni.com

Graph Example

Page 33: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

48ni.com

4. The Cloud

1. Context

3. HTTP4. HTML/JS

7. Next Steps

2. Web Services

6. The Cloud5. JavaScript Libraries

Page 34: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

49ni.com

Cloud Data

Page 35: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

51ni.com

Cloud Demo

• Load Data from Cloud source

• Pass data to Google Chart

Page 36: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

53ni.com

7. Next Steps

1. Context

3. HTTP4. HTML/JS

7. Next Steps

2. Web Services

6. The Cloud5. JavaScript Libraries

Page 37: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

54ni.com

Next Steps: www.tinyurl.com/lvweb• Getting Started Series

• Context• Web Services• HTTP• HTML and JavaScript• AJAX• JavaScript Libraries

• Publishing Data Series• Text Stream• Table Display• Chart• Historian

• Misc Examples• Google Maps• Screenscrape• Your Example Here!

Page 38: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

55ni.com

7. Next Steps

1. Context

3. HTTP4. HTML/JS

7. Next Steps

2. Web Services

6. The Cloud5. JavaScript Libraries

Page 39: Building Basic Web Applications with LabVIEW printsouthafrica.ni.com/sites/default/files/2 Building Basic Web... · ni.com Building Web Applications with LabVIEW Alexey Podolskiy

ni.com