10-03-2016 04:55 PM
Hello,
I have a project with two targets, one target is a RT Cdaq chassis and the other is a PC. I also have two network variables, let's call them "network variable 1" and "network variable 2".
"Network variable" 1 is in a library under the RT chassis, written to in a VI on the RT chassis, and read in a VI on the PC, this network variable works perfectly.
If I probe "network variable 2", writing values works w/o issue but it will only read its default value, which is false. I have noticed the following...
If "network variable 2" is in a library under the RT chassis I get no error, but if "network variable 2" is in a library under the PC i get error# -1950679027. Either way the probe on the read variable does not update but the write probe does update. What could be causing this???
10-04-2016 05:24 PM
There are a few things I'd check. First, have you taken a look at this? http://digital.ni.com/public.nsf/allkb/6E37AC5435E44F9F862570D2005FEF25 This is a good starting point for troubleshooting network shared variables. The fact that it works on a RT chassis and not on the PC makes it sound like it hasn't been deployed on the PC.
Also, a potentially good tool to use as well would be the NI Distributed Systems Manager under the Tools menu in LabVIEW. That would tell you more about the status of a variable than the probe would.
10-05-2016 03:01 PM
William,
Thanks for the info! I ran thru all the steps and didn't find an issue, so I ran another test to determine if the network variable is working.
Originaly this is how the VI worked
step 1
On the RT cdaq, in one of the loops the "time has elapsed" node value (i'll call this "Data 1") of an "elapsed time express VI" is written to a network variable (network variable 1) which is then read by a VI running on the PC. This network variable has always worked fine.
step 2
Once the VI on the PC finishes performing a task, the same "time has elapsed" value mentioned above ("Data 1") is written to another network variable (network variable 2, this is the one I'm having an issue with). This network variable is read by another loop (this is not the same loop mentioned above) on the RT cdaq and sets a case structure to a default value. This case structure never resets because (network variable 2) never updates.
Revised VI for Testing
I changed step 2 only, instead of writing the "time has elapsed" value ("Data 1") to network variable 2, I have now wired a boolean button control to network variable 2.
The case structure now resets but i have to do it manually instead of programatically.
Do you think that writing Data 1 to one network variable and then to another could cause an issue?
10-05-2016 05:14 PM
Hmmm... just out of curiousity, have you probed the value of "time has elapsed" where you are writing it to the other network variable? If you can update it from the front panel but not from your task, it sounds like the value might not ever get written to the variable, which might happen if the value gets stuck on the border of a loop.
Also, it might be helpful to see snippets of the relevant code. The whole "a picture's worth a thousand words" thing.
10-05-2016 05:38 PM
You can set a Shared Variable node as absolute or target-relative depending on how you want the node to connect to the variable. An absolute Shared Variable node connects to the shared variable on the target on which you created the variable. A target-relative Shared Variable node connects to the shared variable on the target on which you run the VI that contains the node.
If you move a VI that contains a target-relative Shared Variable node to a new target, you also must move the shared variable to the new target. Use target-relative Shared Variable nodes when you expect to move VIs and variables to other targets.
Shared Variable nodes are absolute by default. Right-click a node and select Change to Target Relative or Change to Absolute to change how the Shared Variable node connects to the shared variable. Can you explain how the shared variable node is connected to shared variable?
Ref:http://www.ni.com/white-paper/4679/en/ and https://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/sv_deploying/