G Web Development Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary websocket + image indicator

Dear all,

 

I'm looking for a way to handle binary web socket other than importing my own JS code.

In the same line I'd like to display the blob (received via the above binary was) in an image indicator, but only found URL image indicator.

 

Does binary WS and image indicator exist in G web ?

 

Thanks


Christophe

0 Kudos
Message 1 of 7
(2,534 Views)

Hey!

 

If you take a look at the "Write String.gvi" from the Websocket Palette, open it and take a look at the websocket.jsli you can see that there is an WSSendByteArray function. This should allow you to send binary data so all you need to do is create a "Write Byte Array.gvi" with this .jsli. Right now I don't have the time to dig deeper into this but maybe this is a good starting point for you.

 

To show you picture you might be able to use the URL image indicator. Just place an empty picture in you project link it to the image indicator and at runtime replace the file with you new data (maybe a refresh of the page/ indicator is required).

0 Kudos
Message 2 of 7
(2,500 Views)

Hi Christophe,

 

WebVIs do support binary WebSockets. You can use both WebSocket Read and WebSocket Write in binary mode. When the node is dropped from the palette you have the option to configure string or binary mode. For nodes that are already dropped you can configure the mode from the properties pane. See the following:

 

websocketreadbinary.gif

 

The URL image indicator does not support a binary buffer directly. One option is to use the community library File for WebVI which includes the Base64.gcomp >> Create Data Url VI which can take a byte array and content type and create a data url formatted string to pass to the URL Image control. See the following:

urlimage3.PNG

 

 

 


Milan
Message 3 of 7
(2,487 Views)

Hi Milan, Hi Jens,

 

Thanks for your replies.

 

@Milan thanks for taking the time to build small animation.

I'm still in the "NXG" style adaption stage for the G Web module... 

 

Best

 

Christophe

 

0 Kudos
Message 4 of 7
(2,467 Views)

Hi Christophe,

 

The above discussion applies to NXG 5 Web Module as well 👍


Milan
0 Kudos
Message 5 of 7
(2,458 Views)

Too many years (30+) with current/future G to adapt well to NXG!

Thanks for your help, my remote experimentation client previously written in JS is now written in LV 🙂

Hopefully the G Web module is eventually migrated to current G.


Ch.

0 Kudos
Message 6 of 7
(2,455 Views)

@_Chris wrote:

Hopefully the G Web module is eventually migrated to current G.


That seems very unlikely to me. If you think about all the functionality to render the website in NXG/ G Web with all the new HTML class and CSS stuff. I'm kinda new to LabVIEW but was very disappointed about the end of NXG. I still don't believe that there will be functionality like a zoomable Blockdiagram in LV.

0 Kudos
Message 7 of 7
(2,428 Views)