02-05-2013 09:33 AM
I have a cRIO 9074 on a private network with my PC.
I am able to see all cRIO input sensor values in the Distributed System Manager without a problem.
In my project, I use the "AllVariables[]" property to acquire a 1-D array of variable refs.
I input a string like "ni.var.io://192.168.85.70/Mod1" as an input to the "AllVariables[]" property and I get a valid list of variable refs out. I do this for each cRIO card (i.e. Mod1, Mod2, Mod3, etc.).
This works well.
Later, I use this array of variable refs as an indexing input into a For loop and attempt to use the "Read Variable" function from the "Shared Variable Palette".
This does not work.
I have also attempted to insert an "Open Variable Connection" function before the read; this also fails.
The "Open Variable Connection" function gives the following error:
Error -1950678962 occurred at Open Variable Connection
LabVIEW: The specified variable does not support the specified read, write, or open operation.
I will attach (2) quick photos.
1. A pic of the Distributed System Manager showing the data that I can not seem to access programmatically
2. A pic of the BD and FP of the VI that is failing. The FP portion shows the form of the input "Variable Refs".
I am new to the world of cRIO and LV network comm, so any assistance you guys/gals could give me would be invaluable.
Thanks!!!!
02-06-2013 12:46 PM
Hi ckc8302,
It sounds like you're running into the issue detailed in case 2 of the KnowledgeBase linked below. As the document recommends, I would change the format of your addresses to hopefully take care of the error.
http://digital.ni.com/public.nsf/allkb/93DAD747810CFD41862578FC00800EFE?OpenDocument
Have a great day!
02-06-2013 01:37 PM
_Tim,
Kudos! Kudos! Thank you so much for that. That worked just as I needed.
However, HOW did you find that? I was ripping my hair out trying to find this solution.
It seems very counter-intuitive that there is literally NO way for me to use the "Read Variable" function without changing that portion of a programatically-found reference.
If i put the Read Variable function on my BD, I can do a Right click -- Create Constant on the variable reference input and there is NO way to browse to a variable that works.
I can browse to a ".io" version of my variable, but I have to write code to change it to ".psp" before I can read it.
Very counter-intuitive.
02-07-2013 12:00 PM
Glad that took care of your problem! I found that document by searching for your error code on ni.com. The KnowledgeBases on the site cover many common error messages and are generally a good place to start looking for information on a particular issue.
The action you’re looking to implement is essentially a two step process. You are first using the AllVariables property to check all the available channels on the module. Since we are still looking at the properties of the module, we’re getting an address with the .io extension that directs us to each of the available channels. Once we have this reference, we then need to alter it to the .psp extension so it is pointing to the actual network stream for that channel. I agree that it’s slightly counter-intuitive, but I hope we’ve been able to clear up any confusion.