07-11-2013 03:46 AM
Hi all.
I am a long term Labview user, but this is an area I am relatively new to. Ultimately, I want to get an iPad to receive live streaming video from a Labview program running on a PC over wireless Ethernet. Buttons on the iPad should trigger events on the PC Labview and text data can be sent and received between the iPad to the PC. Data will only be stored on the PC. There will be no Labview controls or indicators on the iPad. The choices I see are:
(1) Use remote desktop application and run the webserver on the PC (Risks relying on another vendor and is costly)
(2) Just run the webserver on the PC with the webpages.
(3) Run the HTML on the iPad and get it to talk to the PC remotely.
(4) We are writing Objective C app on the iPad for message handling and video streaming. THis seems the hard way to go.
Incidentally, the Labview will talk to a USB camera and that video (in low res) needs to periodically find its way into the iPad with minimal latency (VLC has too much latency). So the streaming could either be concurrent where the Labview controls the USB camera and also redirects the video as needed to the iPad. Alternatively, the Labview could relinquish control of the USB camera, call a DLL for example for another app to take control of the video streaming until such time Labview tells the DLL to relinquish control of the USB camera, when Labview takes over once again.
Any suggestions or help will be much appreciated befor emy hair goes much greyer!
regards,
David
07-12-2013 04:22 PM
Hello David,
As far as using ipads to communicate with LabVIEW we usually suggest using Data Dashboard, but it has a limited amount of shared variable types to communicate over the network. Generally if you wanted to create an html UI that communicates with LabVIEW you would need to create deploy a webservice from LabVIEW. However, the IMAQ vision display would not be able to be included in the webservice.
Another option for remote viewing of the IMAQ image display is to deploy a Remote Front panel and use a web browser to view the panel. This works with PC web browsers but is not a normal cofiguration for ipad applications. In order to display a hosted remote front panel with an IMAQ image display the browser PC must have Vision Common Resources installed which is only supported on Windows PCs.
01-02-2014 02:33 PM
With LabVIEW 2013 you can use Web Services to serve a webpage to Safari on the iPad. With a little JavaScript you can bind controls on the webpage to AJAX calls made to LabVIEW Web Service. I have started documenting the process here http://chrislarson.me/blog/labview-web-services-vertical-progress-bar-created-html-and-css and here http://chrislarson.me/blog/labview-web-services-create-web-resource
The web server runs within LabVIEW, so there isn't any extra software to manage.
01-03-2014 04:05 AM
I'm not sure about the video side of things - how you'd embed a video stream into the web-page which is provided by the LabVIEW application? One method is to have LabVIEW generate an image file from the camera and then serve that from the application (perhaps using javascript to reload the image periodically?) but I'm not sure what kind of refresh rate you could get with that (0.5s?). The other option would be to use a third party application (or perhaps library?) that serves the video stream over an appropriate connection - you'd probably need to investigate what video streaming methods the iPad supports in the browser (i.e. I don't think you could use a flash video player)
As for the buttons - another option would be to use WebSockets - it allows you to run a two-way TCP-like connection to a web browser using javascript. I had a go at it using my Android Phone as a game controller (arrow key buttons on a web-page and a score display). You can bind events to the buttons (or html elements...) to send TCP data to a WebSockets server running in LabVIEW. Once you have the API, you use it in a very similar way to the TCP/IP palette in LabVIEW, but with one additional function when the connection is established to perform the handshaking.
01-03-2014 01:05 PM
Webpanel implements a LabVIEW to web browser link via websockets. Webpanel
Data interchange is in JSON format, which makes it quite easy to parse it in LabVIEW (There are at least two different free libraries out there that handle JSON).
01-05-2014 05:41 PM
Thanks for the replies.
We ended up solving the problem - we abandoned using HTML front end on the iPad after all. We wrote an iPad application in Objective C (Apple's development language). The iPad controls and indicators used in Objective C looked really nice. We developed a protocol between the PC's Labview and the iPad. It works perfectly and has message error handling built it. Included in this was that the PC end would grab camera images, compress them, convert them to bimaps, add some preable information and transmit frame after frame on an ad-hoc TCP network. Even though they were bitmaps, latency is not an issue. So, bitmap after bitmap provided a smooth video. It worked quite well.