// ************************************************************************************* static public int GetWriteRequestData(UnmanagedMemoryStream s, long memOffset, ref Value value, ref WORD quality, ref FILETIME timeStamp) { VALTYPE tType = GetDataValueType(s, memOffset); if (!Value.IsValidValueType(tType)) { return (TagData.SMRC_BAD_VALTYPE); } quality = Register.GetDataQuality(s, memOffset); timeStamp = Register.GetDataTimestamp(s, memOffset + DATA_VALUE_OFFSET); GetDataValue(s, memOffset, ref value); return (TagData.SMRC_NO_ERROR); }
// ************************************************************************************* public static int SetWriteResponseData(UnmanagedMemoryStream s, long memOffset, bool error, DWORD errorCode, WORD quality, FILETIME timeStamp) { VALTYPE tType = GetDataValueType(s, memOffset); if (!Value.IsValidValueType(tType)) { return (TagData.SMRC_BAD_VALTYPE); } if (error) { SetDataError(s, memOffset, errorCode, true); } else { SetDataError(s, memOffset, errorCode, false); } SetDataQuality(s, memOffset, quality); SetDataTimestamp(s, memOffset, timeStamp); return (TagData.SMRC_NO_ERROR); }
// ************************************************************************************* static public int GetWriteRequest(UnmanagedMemoryStream s, long memOffset, ref Value value, ref WORD quality, ref FILETIME timeStamp) { if (GetRegisterWriteOffset(s, memOffset) == 0) { return TagData.SMRC_NO_DATA; } int nRC = GetWriteRequestData(s, memOffset + GetRegisterWriteOffset(s, memOffset), ref value, ref quality, ref timeStamp); SetDataRequestPending(s, memOffset + GetRegisterWriteOffset(s, memOffset), false); return (nRC); }
// ************************************************************************************* public static void SetWriteResponse(UnmanagedMemoryStream s, long memOffset, bool error, DWORD errorCode, WORD quality, FILETIME timeStamp) { if (GetRegisterWriteOffset(s, memOffset) != 0) { SetWriteResponseData(s, memOffset + GetRegisterWriteOffset(s, memOffset), error, errorCode, quality, timeStamp); } SetDataResponsePending(s, memOffset + GetRegisterWriteOffset(s, memOffset), true); }