The AddComment Method is used to apply a comment to a specific state of a Condition instance. Normally, the NodeId of the Object instance is passed as the ObjectId to the Call Service. However, some Servers do not expose Condition instances in the AddressSpace. Therefore, all Servers shall also allow Clients to call the AddComment Method by specifying ConditionId as the ObjectId. The Method cannot be called with an ObjectId of the ConditionType Node.
AddComment( [in] ByteString EventId [in] LocalizedText Comment );
The parameters are defined in Table 15
Table 15 – AddComment arguments
|EventId||EventId identifying a particular Event Notification where a state was reported for a Condition.|
|Comment||A localized text to be applied to the Condition.|
Method result codes in Table 16 (defined in Call Service)
Table 16 – AddComment result codes
|Bad_MethodInvalid||The MethodId provided does not correspond to the ObjectId provided. See OPC 10000-4 for the general description of this result code.|
|Bad_EventIdUnknown||See Table 103 for the description of this result code.|
|Bad_NodeIdInvalid||Used to indicate that the specified ObjectId is not valid or that the Method was called on the ConditionType Node.
See OPC 10000-4 for the general description of this result code.
Comments are added to Event occurrences identified via an EventId. EventIds where the related EventType is not a ConditionType (or subtype of it) and thus does not support Comments are rejected.
A ConditionEvent – where the Comment Variable contains this text – will be sent for the identified state. If a comment is added to a previous state (i.e. a state for which the Server has created a branch), the BranchId and all Condition values of this branch will be reported.
Table 17 specifies the AddressSpace representation for the AddComment Method.
Table 17 – AddComment Method AddressSpace definition
|AlwaysGeneratesEvent||ObjectType||AuditConditionCommentEventType||Defined in 5.10.4|