node-red-contrib-opcua
node-red-contrib-opcua copied to clipboard
Handle Errors / no status
Hi,
maybe I can't see the solution but how can I handle if there are no items in the opcua client for multiple reading:
The Error which is thrown is not catchable I think and no bedug messages is sent and the status isn't changed too.
If the error is catchable or the status will change to "Error Nr 123" I can handle an injections of items and the flow would be fail save or am I on the wrong way ??
Greetings
Hmm, latest client node has two output. Second one is for the errors. Test again with the latest version, please.
Thx for your immediate reply.
Youre right the latest version has 2 outputs, but the "No Items Error" doesn't start a message either:
Ok,
I looked at the source: in Line 1507 of 102-opcuaclient.js the problem is handled:
if (multipleItems.length === 0) {
node_error(node.name + " no items to read");
return;
If there is a
if (multipleItems.length === 0) {
node_error(node.name + " no items to read");
set_node_status_to("No items to read");
return;
Then it could be handled by the "status" node
I think it should be a design question: Make unhandeled erros --> Errors on the second output and kill all "node_errors" in the code which are "normal errors" or bring the errors to the node "status" and make them catchable by the status node
Ack, I will fix this to next release and check other places at the same time.
Just one extra comment: if you clear items then you should not try to read anything as there is no items to read...
At least same with write multiple items.
Thx.
Yes normally I would say "That's right", but in the flow "programming" I have two or three times seen, that the OPCUA has no item's without been cleared. I think this is from partially restarting the flow.
To solve this issue permanent, my idea was: If no items are there --> add them and start the reading some seconds later.
Therefore the message "No items" has to be readable by the flow.
Or am I wrong ??
OK, this clarifies problem for me. I will be travelling this week. So most probably I will have time next week to fix & test this.
No problem.... You make great work and it runs stable and flawless.
I'm really happy for your short time reaction and therefore it is no problem waiting 1 week.
I found some other similar cases and fixed other set status cases.
I will do some testing before publishing new version...
Hi, Do you know, when a new version will be published ???
Thanks to remind me. Have been busy and bit sick.
Thx for the direct reply.
Get well soon, and I hope your not too sick ?? My children often bring some strange things home.
I just made & published new version. Not fully tested, so I will fix if there is something...
It runs good.
If status = no items to read --> add items --> start 5 s later new read.
I think there will be no bug within deploying and getting the itemlist cleared, cause then it automatically add the items after the error occurs
Thx
I will close this now...