Showing results for 
Search instead for 
Did you mean: 

Reading network shared variables from web

Hi All,


I'm trying to access and read network shared variables from web using the instructions given in LV help.


I'm send the request as follows, but cannot get the value.'ni.var.psp://')/Val...


I've created couple of variables, deployed them and continuously updating their values on the target. I can successfully read those variable in LV host application, but cannot get them as described in the corresponding help instructions.


Any help is appreciated.




0 Kudos
Message 1 of 12

Does anybody know some other solution to get data without websocket from RT target in the Web?




0 Kudos
Message 2 of 12

You can use Open Variable Connection, Read Variable, Close Variable Connection.


Not sure if that uses websockets? What is the goal?

0 Kudos
Message 3 of 12

Thank you for for your reply.


Actually I need to get shared variable data not in the LabVIEW environment, but web.


I need to get the value with HTTP Get command. In the help the command is described as follows, but I cannot get it to work.




I'm using Postman to send the request and get response, but never get it. 




0 Kudos
Message 4 of 12

You can give curl a try. I think it's build in, at least in my Windows 10, but probably earlier as well.


Although I don't see why the results would be different, it would be a 2nd opinion.


You should also be able to use that URL in a browser. IIRC, you can remove parts from the end of the URL, and get a higher level response. So you might be able to remove from the URL until you get anything, and than build up the URL small steps at a time.


A ping would rule out any network problems.


I'll do some digging, I'm sure I did this a while ago. But most recently I did it for SystemLink, which is similar but with variation on the URL. I'd think the URL is the biggest problem here. I'm sure I put a link to useful info somewhere...

0 Kudos
Message 5 of 12

I have tried with the browser as well, but got the same result.


Also the Postman is running Curl inside, so it is also not helping.


I'm getting the following response:


<!DOCTYPE html>
<html><head><title>Not Found</title></head>
<h2>Access Error: 404 -- Not Found</h2>
<pre>Cannot open document for: /nivariable/VariableValues(%27ni.var.psp://</pre>

0 Kudos
Message 6 of 12

I used (from localhost) this in the past:

http://localhost:3580/nivariable/VariableValues('ni.var.psp://localhost/EtherCAT Master/Mod3/DI1')/Value


So IIRC, port 8080 is used for HTTP, but not for the shared variable engine. 3580 is probably default.

0 Kudos
Message 7 of 12

I have tried to create and deploy shared variables on Host PC as well, and tried to get their values as:


GET http://localhost:3580/nivariable/VariableValues('ni.var.psp://localhost/NSV/Status')/Value


But again the same error, both with the Postman and browser. Still cannot figure out what is the issue.

0 Kudos
Message 8 of 12

Are there any settings for the shared variable that maybe I'm missing, or perhaps some software on the target?

0 Kudos
Message 9 of 12

Do you get anything with:


curl "http://Admin:@localhost:3580/nivariable/"

(Admin, "" as credentials) or

curl "http://localhost:3580/nivariable/"


I get XML:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://localhost:3580/nivariable/" xmlns:atom="" xmlns:app="" xmlns="">
    <collection href="VariableObjects">
    <collection href="VariableValues">
     <collection href="VariableValueGroups">


Any other request I get "&quot;&quot; does not have permission to read VariableValues".

0 Kudos
Message 10 of 12