LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access SVE outside of LabVIEW

Hey y'all,  I've been thinking about this for a while but haven't come up with anything, so I thought I might get some ideas here.  I know that LabVIEW's SVE uses TCP/IP as it's transport layer for network published variables, so I was wondering if there were any way to highjack into this connection to be able to receive, or at least just read, the data outside of LabVIEW (in python or something, for example).  It seems like it could be somewhat plausible, seeing as it uses TCP/IP, but I haven't found any mention of it anywhere else on the internet.  Thanks!

0 Kudos
Message 1 of 12
(1,269 Views)

It's actually not just TCP/IP but more correctly REST HTTP.

 

See this post about some ideas that might help.

 

The Getting Variable Updates documentation mentioned in that post has moved here.

 

So using your favorite RESTful request library in Python, C# or whatever should actually allow you to do this quite easily.

Rolf Kalbermatter
My Blog
Message 2 of 12
(1,243 Views)

This is AWESOME!  I do have a few questions about the answer that you may be able to help with.  Firstly, the article uses this as the request:

GET http://my_server:3580/nivariable/VariableValueGroups('1587dcd4a87d118ae3ddd0fce09246f6')/VariableValues?$format=json

1. I'm assuming I replace the my_server with the IP address of the machine it's deployed on (in this case a cRIO)

2.  Is the port for the SVE always the same (3580)?  I'm not sure where I'd find the port that the SVE is listening on otherwise.

3. The article uses, what I can only assume is a key, of 1587dcd4a87d118ae3ddd0fce09246f6.  Is this just a generic key to request the values, or does each server have it's own, etc... And where would I find it if it is different for each.

 

Thanks again, this is a huge stride towards getting this to work.

0 Kudos
Message 3 of 12
(1,234 Views)

1) yes (or localhost if it is the same computer)

2) it's the default value and I think standard, but there may be a specific registration in the NI Service locater service that is another HTTP request to the port number 3580 on the target server. Possible requests are GET http:/address:3580/dumpinfo?

3) If you look in the left hand side of the Getting Variable Update link, you see other topics. For instance the simple psp variable read would be actually using this: Reading the Value of a Variable 

 

The UID in the example is a Variable Group identifier. You can create that with Creating a Variable Group

Rolf Kalbermatter
My Blog
Message 4 of 12
(1,214 Views)

Oh shoot, forgot to look to the left.  I think I've got almost everything ,except that when trying to do any kind of request, I keep getting an "Remote end closed connection without response" error.  I checked the dump request you suggested and none of the entries had a mapping of 3580.  I went through and tried some of the ports listened and sometimes I would get a "Could not find File", but most were just closing or refusing connections.  I also tried using an auth tag with the login for the cRIO but to no avail.  Any ideas what could be causing it to close like this?

0 Kudos
Message 5 of 12
(1,199 Views)

You should be able to actually use the GET uri's simply in a browser. Does that work?

Rolf Kalbermatter
My Blog
Message 6 of 12
(1,193 Views)

When trying to search in web browser http://192.168.0.2:3580/nivariable/VariableValues('ni.var.psp://192.168.0.2/ControlVariables/Filter%... with a variable located at Location: \\192.168.0.2\ControlVariables\Filter Extend I get The specified URL does not exist.

0 Kudos
Message 7 of 12
(1,190 Views)

Does a LabVIEW Variable access from the same computer to "ni.var.psp://192.168.0.2/ControlVariables/Filter Extend" work?

Rolf Kalbermatter
My Blog
Message 8 of 12
(1,186 Views)

Yep, and using DSM I'm able to change the value and have it reflected in LabVIEW.  I do have to enter the Variable connection as a string, as I can't find it when browsing PSP variables.

0 Kudos
Message 9 of 12
(1,180 Views)

I'm still trying to get this to work, here's some updates I've found:

1. I realized I never showed the 3580 info dump, so here it is. Not entirely sure what it's supposed to look like so can't really say whether or not it's wrong or not

EthanHenry_0-1691684944597.png

2. I was thinking maybe it had something to do with the Web Configurations, but after trying to open it, I remembered why I'd never used it before, because I didn't have silverlight.  Do you think there's something in there that enables the server?

3. Are there any startup settings I need to have enabled/disabled?  I tried enabling all of them (other than force safe mode) and still nothing, but maybe one of them is blocking it?

4. When looking at DSM, the variables I'm trying to read are under My Systems.  Should I be trying to get them from the Network Items?

5. I tried to take a step back and deploy the variable on my local machine, and after confirming that it works in LabVIEW, I tried to use the URI in the browser again.  Using the URI http://localhost:3580/nivariable/VariableValues('ni.var.psp://localhost/Variables/TestVariable')?$fo...

I got a different response than last time, this time stating 404, Cannot open document for: 

/nivariable/VariableValues('ni.var.psp://localhost/Variables/TestVariable')

 

0 Kudos
Message 10 of 12
(1,103 Views)