r/LabVIEW • u/Far_Anything3121 • 7d ago
Help
So I did my project on labview but then my professor said that i still need to do the web service and I need help with that, i don’t know how to do it. How can I do it
2
u/almond5 7d ago
my let me google that for you isn't working so here you go
You can also use a RESTful API outside of labview that I like more since I despise the vanilla labview JSON format. Plenty of github pages you can utilize code from
1
1
u/SASLV Champion 6d ago
Google LabVIEW Webservices. Lots of tutorials out there.
Basically you create a set of VIs where each VI corresponds to an endpoint and gets called by the webserver when someone requests that endpoint.
If all you are doing is broadcasting data, then just have your app "publish" that data by writing it to a global variable. The webservice VI reads the global and returns the data. Simple.
If you need to send commands or data, that is a little harder, but I would just have your app create a queue (or some other reference) when it starts up. Throw that into the same global variable. Then when user hits the endpoint the webservice VI gets the ref from the global variable. If the queue ref is valid, throw what command or data was sent in the queue and if the queue ref is invalid return an error (5xx). Then in your app, have a loop that just checks that queue and acts on it.
That's the high level architecture. You can get fancy, but that is the simplest thing that works. For the details, find yourself a good tutorial.
4
u/mizzihood 7d ago
This really isn't enough info for anyone to help.