Confusion about error codes|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Confusion about error codes
Avatar
Patrick Berger
Member
Members
Forum Posts: 18
Member Since:
02/22/2022
sp_UserOfflineSmall Offline
1
12/12/2025 - 02:09
sp_Permalink sp_Print

Hi all

 

Trying to implement the ISA95 Jobcontrol we are running in some problems: how to deal with method results?

The specificaiton of the method service set (https://reference.opcfoundatio...../docs/5.12) defines a "common" status code Bad_InvalidArgument for "brokes a constraint" -> most of them could only be checked/defined by an application. So this leads to the assumption, that Bad_InvalidArgument could used as service and as operation level result.

But the table 176 in https://reference.opcfoundatio.....ocs/7.38.2 restricts Bad_InvalidArgument to the communication stack, so an application is not allowed to use this. However, the introduction mentions that all status codes from Table 176 may also be used for the operation level (i.e., the application).

 

To extend the confusion:

- https://reference.opcfoundatio...../docs/5.12 defines in the table 59 "Bad_InvalidArgument" with an example for out of range -> shouldn't be Bad_OutOfRange status code used instead? Or does the application return Bad_OutOfRange and the communication stack inserts this in the inputAgrumentResults

- https://reference.opcfoundatio.....1/docs/6.7 uses mostly service level status codes for application specific topics - Bad_InvalidArgument is mentioned. What should be used if a method call is made on the wrong state (e.g. Start in state Running)?

- https://reference.opcfoundatio.....200/docs/B uses Bad_InvalidArgument in parallel with ISA95 "Invalid Job Order Status" or Bad_ArgumentMissing with "Unknown Job Order ID" without any explenations. When should what be used?

- Our developers reported, that at least the open source .NET reference implementation doesn't allow the application to set/define inputArgumentResults of the method service response (what is required for Bad_InvalidArgument by definition). So this is either a bug in the stack or this status code cannot be used by the application/operation level as documented in various places (e.g. packml, isa95).

 

Specific questions/problems: what should be reported by the server if

- a method was called on the wrong state for a state machine? Bad_InvalidState or Bad_MethodInvalid?

- at least one from the application defined mandatory element is missing (e.g. ISA95JobOrderDataType.StartTime)? Bad_ArgumentsMissing?

- at least one provided argument in a structure is out of range, supported by the application (e.g. ISA95JobOrderDataType.JobOrderParamters[RunsPlanned])? Bad_OutOfRange?

- at least one provided argument in a structure has wrong type (e.g. ISA95JobOrderDataType.JobOrderParamters[RunsPlanned] is defined as UInt32, but client provides string)? Bad_TypeMismatch?

 

Best regards

Patrick

Avatar
Randy Armstrong
Admin
Forum Posts: 1656
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
12/15/2025 - 11:29
sp_Permalink sp_Print

There are 3 levels of StatusCodes in the Call Service

https://reference.opcfoundatio.....ocs/5.12.2

You can have a Service level failure which means no individual results for methods are returned.

You can have a Method level failure which means no output arguments, however, if the Method level code is Bad_InvalidArgument then there is a separate code for each individual argument. This is usually set by SDKs if the argument does not match the expected type so many failure cases are caught by the SDK and reported. 

The .NET SDK does provide access InputArgumentResults but protected methods which are not normally overridden need to be overridden.

The codes specified by a CS are returned as Method level codes and never include output arguments.

a method was called on the wrong state for a state machine => Bad_InvalidState at Method level, no OutputArguments.

at least one from the application defined mandatory element is missing=> Bad_ArgumentsMissing at Method level, no OutputArguments.

at least one provided argument in a structure is out of range, supported by the application => Bad_InvalidArgument at Method level, Bad_OutOfRange in InputArgumentResults 

at least one provided argument in a structure has wrong type => Bad_InvalidArgument at Method level, Bad_TypeMismatch in InputArgumentResults 

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 23
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1508
Posts: 5103