LabVIEW Web Development Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Presentation and Demos | Building Basic Web Applications with LabVIEW

This is a presentation with an overview of demos about getting started with web technology. Please view the attached PDF slides for context about this technology, and open and run the variety of demos that are attached.

Requirements:

LabVIEW 2014+ Full or Professional

Notepad++ (recommended for modifying HTML and JS files)

Demos included (for tutorials on how to build these demos, click link):

1. Add two numbers using the LabVIEW Web Server

2. Use HTML and JS to create a simple web interface for your adder. Modify the response model.

3. Call external JavaScript libraries to extend your web client such as Google Charts and jQuery (no tutorial yet, see attached source code)

4. Use a cloud server such as data.sparkfun.com to host data and have your web client just load data from this server. (no tutorial yet, see attached source code or check out examples on data.sparkfun.com)

5. Use a JS framework such as Bootstrap to create a responsive menu for your application. Look at a completed test and measurement example.

Posted webcast of presentation: http://www.ni.com/webcast/3799/en/

Joey S.
Senior Product Manager, Software
National Instruments
Download All
Comments
teegee
Member
Member
on

The Demos.zip is a great way to get started. However, I had some problems getting Demo 5 working out of the box. Here are some modifications I had to make:

- Main.vi needs to be in the "Startup VIs" folder of the WebMessageHandler web service

- UserInterface.vi needs to ignore errors from Unflatten from JSON. I had the unflatten fail sometimes sending an error in the shift register that could only be cleared by disconnect/reconnect

Elnin83
Member
Member
on

Hello,

I've some trouble with Demo 3 JavaScript Libraries. If I start the webservice on my computer (port 8001 debug mode) and open "initial.html", I have the graph on my screen but without data.

If I open "random" file with web browser, I have 100 data (waveform data). Each time I refresh the page, I have a new set of data so this Random.vi is working

I think that something doesn't work in the JavaScript but I don't know what's wrong in it. Any help will be appreciated.

Thanks

JoeySpinella
NI Employee (retired)
on

Elnin83,

Have you tried both the 'initial.html' and 'initial_submit.html'?

The one with the submit button uses jquery instead of a raw HTTP request. It sounds like the problem is in the AJAX request and getting the data formatted correctly. Both of these demos still work fine for me on Chrome with LabVIEW 2015 (LabVIEW 2013 and 2014 will be the same).

Joey S.
Senior Product Manager, Software
National Instruments
Elnin83
Member
Member
on

Hi Joey,

New download of Lvproject.

I start my Webservice (port 8001)  then I use "show public URL" by right clicking on initial_submit or initial.html file. Copy and paste to web browser. I tried both initial.html and initial_submit.html with Chrome. My graph is still empty.

Stop webservice and try to deploy (port 8080). Same result.

Webserver properties :

random.vi

  • URL Mapping : GET method with both standard URL mapping & name of VI included
  • Output type : terminal JSON

Random .vi is working fine, output terminal is waveform type and I have one hundred new data.

I'm working with Labview 2014 SP1.

Thanks.

JoeySpinella
NI Employee (retired)
on

Random bug that may be affecting you: the server doesn't work correctly if the "Show method URL" dialog is still open. Make sure to click close first.

Joey S.
Senior Product Manager, Software
National Instruments
kech
Member
Member
on

Hi, 

 

I'm getting the following error while running demo1. add.vi  

What adaption do i need to make?

 

Fehler -67301 bei NI_WebServices.lvlib:Error Converter (ErrCode or Status).vi

Mögliche Ursachen:

LabVIEW: (Hex 0xFFFEF91B) LabVIEW-Webdienste: Ungültige Anfrage-ID.

 

Kech

 

 

yeti69
Member
Member
on

I fixed a -67301 by deleting the *WEB.vi and starting over !  I only discovered this by doing the AddTwo WebServer example - which worked first go, and only difference to the Shared Variable example is I might have done a rename of the vi.

 

 

Contributors