LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way of displaying a waform through a webservice

Solved!
Go to solution

Hi

 

 

I  know my way around text based programming languages fairly well, but am very new to Labview.
The problem I am facing is something that I can't seem to find any good information about on the internet.

 

I have a DAQmx board of which I would like to show waveforms of the analog inputs on a website. The webservice documentation says webservices acutally support waveforms, but if I wire it to a terminal I can't start the webservice.

What I did now is split the x and y values, add them to an array and show them on a webpage using google Charts. This works, but only gives me the image of 1 reading of course. I know you can make a streaming web VI as well, which I could refresh every n seconds, but that still wouldn't give me a continuous stream to the webpage, it would just refresh the image... 

 

Am I totally missing something, or is there just no easy way to do this in labview? (I am using labview 2013 btw )

 

 

Thank you,

Vincent

0 Kudos
Message 1 of 4
(2,862 Views)

Hi Vincent!

 

To be able to help you better I would like to know which version of labview you are using. How ever, please try and take a look at this information and see if it helps you solve the issue.

https://decibel.ni.com/content/docs/DOC-11742

and

http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/build_web_service/

 

Hope to hear from you!

 

Best regards,

 

Collin de Wit
Applications Engineer
National Instruments

0 Kudos
Message 2 of 4
(2,804 Views)
Solution
Accepted by topic author Vince_vd

You might want to take a look at the new NI Community here: https://decibel.ni.com/content/groups/web-services

 

They've posted up some examples of how you can use AJAX/javascript to retrieve data from a web service. You are probably right in breaking apart the waveform - javascript/google charts probably won't know how to handle the LabVIEW waveform data type so better to just send an array of numbers to plot on the chart.

 

How you update the chart will be up to you, your web service could either send the full XY plot each time you request it or you could just periodically poll for new values and add them to a local buffer on the client/browser side.

 

If you need faster update rates, you might want to check out my WebSockets library (linked in my signature).


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 3 of 4
(2,793 Views)

To CollindeWit:

Thanks, but I had obviously already looked over all the basic web service documentation, my problem isn't really in there. 
The web ui builder could be a solution, but I'd like to just build the ui myself as html/javascript is not really a problem for me.

 

To Sam_Sharp:

I had not seen that community yet, thanks a lot!

Polling every n seconds and adding it to a buffer is what I was thinking as well and is what I was working out right now. I'll just let the labview vi start a couple of seconds before showing the data (a few seconds is not really a problem here) so I have time to buffer it.

 

Your websocket library seems really awesome too!! It is actually exactly what I was looking for, but I'm going to try it with the buffer first as I don't really need the constant stream if this method works. Still great to know it's out there though, I'm sure I'll be able to use it in the future!

0 Kudos
Message 4 of 4
(2,788 Views)