5.2 Example

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 2 – <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
UncertainThe value is uncertain. A concrete reason is defined in the Status Output-Argument.
Table 3 – <SomeMethod> Method AddressSpace definition
Attribute Value
BrowseName<SomeMethod>
References NodeClass BrowseName DataType TypeDefinition Others
HasPropertyVariableInputArgumentsArgument[] PropertyTypeM
HasPropertyVariableOutputArgumentsArgument[] PropertyTypeM
HasArgumentDescriptionVariableStatusInt32MultiStateValueDiscreteTypeM

The InstanceDeclarations of the <some>Type have additional Attributes defined in Table 4.

Table 4 – <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>.