LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

web interface design tools for RPi3 web service publishing

Hello,
I'm not very experienced in designing a proper web page. We were able to broadcast web service with RPi3. We would like to send commands such as open / close or stop / start commands to some systems working with lab view through web page.

In LINX 3.0 - 07 | Web Services, I have seen commands for importing data from the lab view in the main.html file. What I want to do is just like the example. In this regard, do you need to know what commands are required to communicate between the lab view and the web interface, and what tools do you recommend to use?

Thanks.

0 Kudos
Message 1 of 2
(2,157 Views)

The LINX 3.0 | Web Services example has a link called Web Service Tutorial Files which provides the www/main.html file.

 

The main.html file has JavaScript that is used to make the commands. For example on the page you can see the LED ON button.

 

In main.html that corresponds to two things:

 

First there is a button tag that has an id of ledon:

<button id="ledon"style="font-size: 200%">LED ON</button>

 

Second there is a script that listen for button clicks and sends a message back to the labview web service you made on the rpi:

		$('#ledon').click(function(){
			$.ajax({
				url: "led",
				type: "GET",
				data: "value=1",
				//dataType: "json",
				//success: onDataReceived
			});
		});

 

So the command in this case is to do a HTTP GET to the url "/led" as shown in the video. To add more commands you add new Web Resource VIs for different commands and you do different ajax requests to different URLs from main.html.

 

Were you able to get this example working on the RPI3?


Milan
0 Kudos
Message 2 of 2
(2,084 Views)