03-29-2013
07:54 AM
- last edited on
01-14-2025
04:34 PM
by
Content Cleaner
I am using PXI-8133 with LabView RT 2012 installed. I cant find any manuals or examples about using this functionality. Only this: https://www.ni.com/docs/en-US/bundle/labview/page/reading-and-writing-shared-variables-with-the-vari...
Where can I find some more information???
04-03-2013 04:45 PM
Hello diman27,
When you create a web service you can read and write network shared variables with an HTTP Get method in LabVIEW. This link will show you how to build and access a LabVIEW Web Service Application. If you simply add a network shared variable and set its access mode to write and connect a control to change the value and attach the control to the connector pane you will be able to write to the variables value. You can then verify this by viewing the change in Distribute System Manager. Conversly you can read from the variable and have its value written to an XML file.
04-04-2013
08:04 AM
- last edited on
01-14-2025
04:37 PM
by
Content Cleaner
Hello Wear,
"Using the variable Web service, you can create applications that access network-published shared variables through HTTP. Any shared variables that utilize the NI Publish-Subscribe Protocol (NI-PSP) can be accessed using the variable Web service. Using Open Data Protocol (OData), the variable Web service provides responses in both XML and JSON formats."
Is this mean that I dont need to build my own Web Service Application? I only need to deploy variables on the target, install Variable Web Service and I can read ANY deployed variable directly via HTTP GET and XML.
04-07-2013 08:40 PM
Hi diman27:
You are correct, you can read variables via HTTP GET and XML after you install the variable web service on your target.
However, just by reading raw XML via HTTP GET methods isn't all that friendly. Variable Web Service is an OData web service, which means you can import the web service directly in Visual Studio to create applications (.NET applications, for example) that can read the shared variables. Importing the Variable Web Service into Visual Studio will automatically create a .NET object that handles sending HTTP requests and parsing the XML or JSON response for you.
OData is also supported in many languages via third party libraries, such as javascript, objective C (iOS apps), ruby, python, etc. You can find out more here.
You can find out more about how to exactly use the variable web service in the LV help. Search for "variable web service", there should be a list of entries related to it.
04-07-2013
08:49 PM
- last edited on
01-14-2025
04:38 PM
by
Content Cleaner
You can find documentation about the Variable Web Service in the LabVIEW Help, available in LabVIEW by selecting Help»LabVIEW Help, in the following help topics (or search the Index tab of the LabVIEW Help for "variable web service"):
You can print all related topics by right-clicking the Reading and Writing Shared Variable with the Variable Web Service topic and selecting Print.
04-11-2013 07:36 AM
Oops .. many thanks! I missed that section in LabView Help. This is exactly what I need.
I tried to play with it and it working fine! I will use it to read shared variables value from LabView Web UI builder.
04-12-2013
08:04 AM
- last edited on
01-13-2025
02:23 PM
by
Content Cleaner
I published demo project which allow to Read/Write shared variables through Variable Web Service with LabView Web UI builder. https://forums.ni.com/t5/Archive-TKB/LabView-Web-UI-reading-and-writing-shared-variables-through/ta-...