Hello,
I'm linking a node to a class instance with LinkModelToNode and I want to generate a Bad status when client reads a property of the class and the underlying system is not able to retrieve the data.
Right now I'm throwing a StatusException(BadCommunicationError) in the get{} of the property but UAExpert reports just the "basic" Bad(0x80000000).
What do I need to do in order to report back to the client the specific bad status code?
Thanks in advance.
Stefano
Generate StatusException on linked Property
Moderator: uasdknet
-
- Jr. Member
- Posts: 1
- Joined: 20 Aug 2020, 09:26
- Support Team
- Hero Member
- Posts: 3064
- Joined: 18 Mar 2011, 15:09
Re: Generate StatusException on linked Property
Hello,
You can set the StatusCode at the Mappings of the nodeHandle that is returned by LinkModelToNode.
Once the communication to the data source is established, you can reset the StatusCode to Good for each Mapping,
You can set the StatusCode at the Mappings of the nodeHandle that is returned by LinkModelToNode.
Code: Select all
var handle = LinkModelToNode(boilerId, m_boiler1, null, null, 500);
foreach (var m in handle.Mappings)
{
m.StatusCode = StatusCodes.BadNoCommunication;
}
Best regards
Unified Automation Support Team
Unified Automation Support Team