LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Web Service

I am using PXI-8133 with LabView RT 2012 installed. I cant find any manuals or examples about using this functionality. Only this: http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/sv_variable_web_service/
Where can I find some more information???

0 Kudos
Message 1 of 7
(4,017 Views)

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.  

Wear
National Instruments
Product Support Engineer
0 Kudos
Message 2 of 7
(3,944 Views)

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.

0 Kudos
Message 3 of 7
(3,924 Views)

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. 

0 Kudos
Message 4 of 7
(3,890 Views)

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"):

 

snagit.gif

 

You can print all related topics by right-clicking the Reading and Writing Shared Variable with the Variable Web Service topic and selecting Print.

 

The web versions of these help topics can be found here.

Message 5 of 7
(3,887 Views)

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.

0 Kudos
Message 6 of 7
(3,857 Views)

I published demo project which allow to Read/Write shared variables through Variable Web Service with LabView Web UI builder. https://decibel.ni.com/content/docs/DOC-28981

Message 7 of 7
(3,837 Views)