If there is an application-specific error in the Method execution, the Method should return an Uncertain StatusCode and the application calling the Method shall only consider the Status output argument of the Method providing the application-specific error code.
Signature
<SomeMethod> (
[in] String <SomeInput>,
[out] UInt32 <SomeOutput>,
[out] Int32 Status);
Table 1 – <SomeMethod> Method Arguments
Argument |
Description |
<SomeInput> |
<description> |
<SomeOutput> |
<description> |
Status |
This is an example where the Method needs to return special status information. 0 – OK – Everything is OK -1 – E_FirstError – Error FirstError occurred -2 – E_SecondError – Error SecondError occurred |
Method Result Codes (defined in Call Service)
Result Code |
Description |
Uncertain |
The value is uncertain. A concrete reason is defined in the Status Output-Argument. |
Table 2 – <SomeMethod> Method AddressSpace definition
Attribute |
Value |
||||
BrowseName |
<SomeMethod> |
||||
References |
NodeClass |
BrowseName |
DataType |
TypeDefinition |
Others |
HasProperty |
Variable |
InputArguments |
Argument[] |
PropertyType |
M |
HasProperty |
Variable |
OutputArguments |
Argument[] |
PropertyType |
M |
HasArgumentDescription |
Variable |
Status |
Int32 |
MultiStateValueDiscreteType |
M |
The InstanceDeclarations of the <some>Type have additional Attributes defined in Table 3.
Table 3 – <some>Type Additional Attributes
Source Path |
Value |
|||
|
[{"value":0, "displayName":{"locale":"en", "text":"OK"}, "description":{"locale":"en", "text":"Everything is OK"}}, {"value":-1, "displayName":{"locale":"en", "text":"E_FirstError"}, "description":{"locale":"en", "text":"Error FirstError occurred"}}, {"value":-2, "displayName":{"locale":"en", "text":"E_SecondError"}, "description":{"locale":"en", "text":"Error SecondError occurred"}}] |
Note that the last table is defined in the context of the ObjectType <some>Type containing the Method <SomeMethod>.