I’ve added a little extra code to my driver, where if it is disabled or disconnected, upon renabling (or recreating it) it will resubscribe to any tags returned by DeviceSubscriptionModel.getSubscriptionItems(). This seems to work fine…as long as the device name doesn’t change, the tags come back to life and go back to updating. Unfortunately, every time they refresh, there’s an odd error message in the console. The logger is “DeviceSubscriptionItem” and the message is just “No node set!”. What does this message mean, please?
Does this message continue to pop up, or just the first time you setValue() on the item?
The message means is that the UA Node the item is representing hasn’t been linked up to that item yet, for some reason. If you’re removing nodes when your device disconnects or disables this could be why.
It’s happening every time I call set value. Will I have problems if I don’t empty out node manager when I shut the driver down?
Also, if I toss them, is there a way to add them back in?
You should be removing your nodes during shutdown() and no other time than that. If you are removing them at some other point, or never building and adding them in the first place, that could cause the message from DeviceSubscriptionItem.
Also I noticed you said you have special handling for when the device is disabled… I assume you’re talking about the Enabled property that all devices have? You shouldn’t have to do anything - when a device is not enabled your driver will never be instantiated.
In the past, when we’ve had issues with tags that intermittently failed (not in my driver, but the built-in Allen Bradley drivers), we’ve disabled and reenabled the driver…that appeared to bring the tags back. I was trying to do the same thing with my driver…though ideally, it would just keep trying to reconnect in the event of a connection failure.
If tags can’t normally reconnect after the driver has been tossed and reinstantiated, then do the tags die every time the gateway is reset?
What if I forcibly rebuilt the nodes? Would this do it: Node newNode = nodeBuilder.buildAndAdd(nodeManager); ?
[quote=“lisawas”]If tags can’t normally reconnect after the driver has been tossed and reinstantiated, then do the tags die every time the gateway is reset?
What if I forcibly rebuilt the nodes? Would this do it: Node newNode = nodeBuilder.buildAndAdd(nodeManager); ?[/quote]
Well the idea is that during shutdown you remove the nodes from the node manager… so they would be gone at that point. Then you rebuild them during initialization and/or on demand in buildNode().