01-13-2021 06:05 PM
I'm trying to build a web app using the NXG web module. I understand that NXG is being discontinued but the web module will live on and it seems to be a decent investment of my time. If that's a dumb idea, I'd be happy to hear about it. The concept is to have a Labview VI acting as a server accumulating and processing a bunch of data. Anyone with the right credentials would be able to fire up a web vi in a browser on a remote computer. The remote client would display the data and allow user interaction e.g, panning and zooming graphs, saving the data locally and so on. My idea is for the server to do all the processing and package the data in a cluster. When new data comes in, the server will process it, add it to the cluster and send it out to whatever clients have subscribed.
My questions are what Labview functionality is appropriate for this and can someone point me at an example? Here's the options I'm aware of.
1) Websockets
2) HTTP
3) Systemlink
4) TCP
5) UDP
6) Network streams
and probably others
Data comes in very slowly, like once every couple of hours. In the short term, the cluster will be less than 1kByte to start and less than 100 kBytes or so max. So it seems reasonable to just send all the data when required. In the long run, the cluster will become larger and I'll have to figure out a way to deal with that but for now, I'd just like to get the simple case running.
Thanks
Solved! Go to Solution.
01-14-2021 09:16 AM
My recommendation would be to flatten the cluster to JSON and publish it using a SystemLink Message. Any WebVI that is running and subscribed to the same message topic will receive the data and can then unflatten from JSON back into the cluster.
01-14-2021 11:32 AM
JSON is a great idea. I was aware of Systemlink but didn't really know much about it. I went through some tutorials and it looks great also. But I can't find any Systemlink VIs in the NXG web module. In the Data Communications menu there's just HTTP, Websockets and queues. There are a bunch of Systemlink VIs available in my Labview server. Am I missing something.
01-14-2021 02:37 PM - edited 01-14-2021 02:42 PM
I would recommend installing the LabVIEW SystemLink Toolkit. It should include support for LabVIEW 2017-2020 and NXG 5.0.
01-14-2021 02:49 PM
If the data is being published really slow you could also look at using tags. They don't support clusters, but again you can flatten the data to a JSON string and store it as a string tag.
Here is some more information to help get started.
https://github.com/ni/webvi-examples/tree/master/CallSystemLinkDataServices/
01-14-2021 04:04 PM
@JoshuaP - I've downloaded the stuff you pointed me at and it looks like an excellent solution for my immediate job and also for some jobs down the road. I've got lots of reading and experimenting to do but it looks great.
Many thanks - Gene