Jump to content


Photo
* * * * * 5 votes

LabVIEW, Websockets, and SVG


  • Please log in to reply
63 replies to this topic

#61 ShaunR

ShaunR

    LabVIEW Archetype

  • Members
  • PipPipPipPipPipPip
  • 2,623 posts
  • Version:LabVIEW 2009
  • Since:1994

Posted 07 October 2012 - 04:38 PM

Hi there!
So I tried this Websocket on a cRio.
The only thing that needs to be changed is the EOF,
I used the \r\n constant instead of CR\LF.

But theres one more problem that I am currently facing,
I cant access the svg file via web publish in the cRio. The svg file looks fine if I access to it via ftp.
But if I put it in the www folder and access via http, it comes out as text instead of graphics.
I tried a lot of method including creating a html file that calls the svg.
So far, none of them worked.

Currently using LabVIEW 2011 and Chrome ver 22.

He also has a website dedicated to this at http://blog.evexiall...=37#comment-54.
Might be worth asking the question there also.

A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort. (Herm Albright 1876-1944).

Founder and general mischief maker on www.lvs-tools.co.uk.
SQlite aficionado and websocket zealot.
If it 'aint in LabVIEW, then you 'aint got a clue!


#62 madtofan

madtofan

    I've come back for more.

  • Members
  • 2 posts
  • Version:LabVIEW 2011
  • Since:2010

Posted 08 October 2012 - 09:40 AM

my bad.
I didnt notice the mime.types part

so i went into the cRio ni-rt/system/webserver/ folder and added "image/svg+xml svg svgz" into the mime.types file.
now it pops up fine.

thanks! :D

#63 sharkera

sharkera

    One hit wonder!

  • Members
  • 1 posts
  • Version:LabVIEW 2013
  • Since:2005

Posted 11 August 2014 - 08:04 AM

Hi smarlow,
 
I know this is a really old thread, but I am intrigued by the use of WebSockets and LabVIEW.  Lately I found a library that NI released:
https://decibel.ni.c.../docs/DOC-38927 and I found the code to be very similar to yours.  I was just curious if you knew about this ... basically this library combines WebSockets and NI's CVT so that CVT tags get pushed out and exposed through Websocket connections.  Still have write your own UI web code, tho.  There's another package that's fascinating lately: http://labsocket.com/.  This commercial software supposedly "scrapes" your front panel generates a thin-client webpage for you.  Haven't tried it but looks promising.  Cheers!


#64 smithd

smithd

    Active

  • NI
  • 12 posts
  • Version:LabVIEW 2013
  • Since:2011

Posted 11 August 2014 - 11:16 PM

 

Hi smarlow,
 
I know this is a really old thread, but I am intrigued by the use of WebSockets and LabVIEW.  Lately I found a library that NI released:
https://decibel.ni.c.../docs/DOC-38927 and I found the code to be very similar to yours.  I was just curious if you knew about this ... basically this library combines WebSockets and NI's CVT so that CVT tags get pushed out and exposed through Websocket connections.  Still have write your own UI web code, tho.  There's another package that's fascinating lately: http://labsocket.com/.  This commercial software supposedly "scrapes" your front panel generates a thin-client webpage for you.  Haven't tried it but looks promising.  Cheers!

 

 

Hey sharkera,

 

That toolset actually consists of a few things.

 

The first package, tagwebclient, is a javascript+HTML web page along with some LabVIEW type definitions which are intended to allow you to create new web services which provide tag-oriented data to the web using a standard interface. At present it needs some work, but the basic concept is down. For example, there is a "tag browse" page which requests the available list of tags from a correctly-formatted web service.

 

The second package, cvt web addon, is a LabVIEW web service which uses the CVT and aims to meet the contract required for the tagwebclient. Originally, these packages were combined but we are interested in making a web service which supports the new tag bus library (which is basically CVT on a wire): https://decibel.ni.c.../docs/DOC-36995

 

Finally, the cvt web addon does have a sample websocket server. However, to the best of my knowledge it currently just supports sending strings back and forth. It is not used to transfer tag data -- standard labview web service functions are used for that.

 

Thanks,

Daniel