Example #1
0
        public static void SetTagReady(this UCView.TAGLIST list, IntPtr pos, bool bVal)
        {
            UInt16 DataReady = bVal ? (UInt16)1 : (UInt16)0;

            UCView.TAGLISTNODE node             = pos.GetStructure <UCView.TAGLISTNODE>();
            const int          offset_dataready = 0;                                  //(int)Marshal.OffsetOf(typeof(UCView.TAGREG), "wDataReady");

            node.data.SetValueOnOfssetOfStructure(DataReady, offset_dataready, true); //node.data is TAGREG, 0(offset of wDataReady)
        }
Example #2
0
        public static void SetTagValue(this UCView.TAGLIST list, IntPtr pos, float fVal)
        {
            UInt16 regdatatype = UCView.FLOAT_DATATYPE;

            UCView.TAGLISTNODE node = pos.GetStructure <UCView.TAGLISTNODE>();
            const int          offset_regdatatype = 20;                                   //(int)Marshal.OffsetOf(typeof(UCView.TAGREG), "devReg") + (int)Marshal.OffsetOf(typeof(UCView.DEVREG), "RegDataType");
            const int          offset_regvalue    = 24;                                   //(int)Marshal.OffsetOf(typeof(UCView.TAGREG), "RegValue");

            node.data.SetValueOnOfssetOfStructure(regdatatype, offset_regdatatype, true); //node.data is TAGREG, 20(offset of RegDataType)
            node.data.SetValueOnOfssetOfStructure(fVal, offset_regvalue, true);           //node.data is TAGREG, 24(offset of value)
        }