示例#1
0
        // *************************************************************************************
        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);
        }
示例#2
0
        // *************************************************************************************
        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);
        }
示例#3
0
        // *************************************************************************************
        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);
        }
示例#4
0
 // *************************************************************************************
 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);
 }