Hello everyone,
OPC UA allows you to qualify a Variable or Tag with a status code.
Similar as explained for OPC-DA in the B&R Automation Studio Help.
I’m wondering if there’s a way to leverage these status codes at runtime to provide contextual information to OPC clients. For instance, if I’m forwarding data from a CAN bus into an OPC structure, I’d like to signal to clients that a zero value is invalid because it was caused by a sensor failure.
In our specific scenario, we encounter invalid data in our data logging during machine startup. This happens because we haven’t found a solution for:
- Utilizing OPC-UA StatusCodes to mark invalid data,
- Forcing certain values to NaN on the OPC server, or
- Delaying the OPC server startup until all peripherals are fully initialized.
Any best practices or elegant solutions on this topic?
Any insights would be greatly appreciated!
P.S.: Setting EU ranges dynamically to trigger a RangeViolation status is not what I am looking for… - I think.
best regards.
S.
Hi,
I’m don’t know if the’re any of the possibilities available you’re looking for, sorry.
But looking into direction of preventing the servers startup until the application is ready, I could imagine the following workaround:
you can’t prevent the startup, but you could use the AR firewall to block the OPC UA server incoming port, until your application startup is finished.
After startup is finished, unblock the port by using ArFirewall.
Best regards!
3 Likes
The variables could also be placed in a subscription (monitored) by the client and this subscription can be enabled or disabled by the client.
Thank you for your reply.
We tried the suggested solution of using Firewall Rules to delay the OPC-UA data logging client’s access to the server structures, and it worked successfully. Although this remains a workaround, our initial tests indicate that it is both stable and relatively straightforward.
For completeness, I would also like to mention that we tried delaying access by not assigning the necessary role to the user at boot up, but a later. However, this approach did not work properly because the client did not “resubscribe” to the variables after the role was assigned.
Best regards.
1 Like
Thank you for your suggestion but in this case we would need additional logic at the client side to verify when data is considered valid and should get logged to the data base.
This is not what we want to do.