My goal was to understand if it's possible to write a StatusCode for example "Bad" from the client side to the server.
Maybe the StatusCode doesn't make much sense to be written from the client side, but the SourceTimestamp for me makes sense, since once a value has been assigned a source timestamp, the source timestamp for that value instance never changes, so the SourceTimestamp of the value that I want to pass must be kept.
I had to comment this code out as some (most) servers don´t accept writing statusCode or sourceTimestamp:
nodeToWrite = {
nodeId: nodeid.toString(),
attributeId: opcua.AttributeIds.Value,
value: new opcua.DataValue({
value: new opcua.Variant(opcuaDataValue),
// sourceTimestamp: new Date(), // NOTE: Some servers do NOT accept time writing
// statusCode: opcua.StatusCodes.Good // NOTE: Same with status writing, NOT accepted always
})
};