jangel22 Posted November 28, 2014 Report Share Posted November 28, 2014 Hi folks I'm working with NSV deployed in two computers (lets call them A and B), but I want to be able to make the value of the NSV in B false when the program exits in A or when this computer turns off. Any idea of how make this? PS. Excuse my english. Thanks in advance Quote Link to comment
JKSH Posted November 29, 2014 Report Share Posted November 29, 2014 Hi, There are a few ways you can do this. First way Make the program in A write "true" to the NSV when it starts, and make it write "false" before it quits. This is simple, but there is one disadvantage: If the program in A doesn't quit properly, then the value will stay "true". For example, if computer A loses power, the program stops running but it can't write "false". Second way Make the program in A write a value to the NSV every second. The program in B doesn't check the value, but it checks the timestamp. If the timestamp doesn't change for 5 seconds, then B sets a local flag to "false". Quote Link to comment
crossrulz Posted December 1, 2014 Report Share Posted December 1, 2014 If computer A is hosting the NSV and it is not running, then B should get an error when it tries to read the variable. With an error, I would expect the default values. But it may be the last read value. But you should be able to look for the error. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.