The COM UA Wrapper supports performing Write operations to DA servers of versions 2.05a and 3.
For version 2.05a, the COM UA wrapper creates a Group using the IOPCServer::AddGroup method and adds the items whose data is to be written using IOPCItemMgmt::AddItems method. The value is written for the items using the IOPCSyncIO::Write method. Note that if the StatusCode or TimeStamps (Source or Server) is specified to be written for the item then the COM UA Wrapper returns a BadWriteNotSupported Status code for the item.
For version 3, the COM UA Wrapper uses the IOPCItemIO::WriteVQT data including StatusCode and TimeStamp. If a SourceTimeStamp is provided, this timestamp is used for the Write else the ServerTimeStamp is used.
If there are errors for the items in the Write from the DA server, then these are mapped to the StatusCode for the corresponding item.
The mapping of the OPC COM DA Write Errors code to OPC UA Status code (in the COM UA Wrapper) is shown in Table A.63:
Table A.63 – OPC DA Write error code mapping
OPC DA Error ID |
OPC UA Status Code |
E_BADRIGHTS |
Bad_NotWritable |
DISP_E_TYPEMISMATCH |
Bad_TypeMismatch |
E_BADTYPE |
Bad_TypeMismatch |
E_RANGE |
Bad_OutOfRange |
DISP_E_OVERFLOW |
Bad_OutOfRange |
E_OUTOFMEMORY |
Bad_OutOfMemory |
E_INVALIDHANDLE |
Bad_NodeIdUnknown |
E_UNKNOWNITEMID |
Bad_NodeIdUnknown |
E_INVALIDITEMID |
Bad_NodeIdInvalid |
E_INVALID_PID |
Bad_NodeIdInvalid |
E_NOTSUPPORTED |
Bad_WriteNotSupported |
S_CLAMP |
Good_Clamped |
Others |
Bad_UnexpectedError |