Exemple #1
0
        // *************************************************************************************
        public Tag(ref Device device, TAGENTRY tTagEntry, DWORD dwRelativeOffset, DWORD dwParentOffset)
        {
            tagDevice = device;

            tagName = tTagEntry.strName;
            tagStringSize = tTagEntry.stringSize;
            tagArrayRows = tTagEntry.arrayRows;
            tagArrayCols = tTagEntry.arrayCols;
            tagDataType = tTagEntry.dataType;
            tagReadWrite = tTagEntry.Access;
            tagScanRateMS = 100;
            tagDescription = tTagEntry.description;
            tagGroupName = tTagEntry.groupName;

            tagRelativeOffset = dwRelativeOffset;
            tagSharedMemoryOffset = dwParentOffset + dwRelativeOffset;
            tagWriteRequestPending = false;
            tagReadRequestPending = false;
            tagWriteResponsePending = false;
            tagReadResponsePending = false;

            if ((tTagEntry.Access == AccessType.READONLY) ||
                (tTagEntry.Access == AccessType.READWRITE))
            {
                tagReadData = new TagData(tTagEntry.dataType,
                    tTagEntry.stringSize, tTagEntry.arrayRows, tTagEntry.arrayCols);
            }

            if ((tTagEntry.Access == AccessType.READWRITE) ||
                (tTagEntry.Access == AccessType.WRITEONLY))
            {
                tagWriteData = new TagData(tTagEntry.dataType,
                    tTagEntry.stringSize, tTagEntry.arrayRows, tTagEntry.arrayCols);
            }
        } // Tag constructor for AddTag
        public Tag(ref Device device, TAGENTRY tTagEntry, DWORD dwRelativeOffset, DWORD dwParentOffset)
        {
            tagDevice = device;

            tagName = tTagEntry.strName;
            tagStringSize = tTagEntry.stringSize;
            tagArrayRows = tTagEntry.arrayRows;
            tagArrayCols = tTagEntry.arrayCols;
            tagDataType = tTagEntry.dataType;
            tagReadWrite = tTagEntry.Access;
            tagScanRateMS = 100;
            tagDescription = tTagEntry.description;
            tagGroupName = tTagEntry.groupName;

            tagRelativeOffset = dwRelativeOffset;
            tagSharedMemoryOffset = dwParentOffset + dwRelativeOffset;
            tagWriteRequestPending = false;
            tagReadRequestPending = false;
            tagWriteResponsePending = false;
            tagReadResponsePending = false;

            if ((tTagEntry.Access == AccessType.READONLY) ||
                (tTagEntry.Access == AccessType.READWRITE))
            {
                tagReadData = new TagData(tTagEntry.dataType,
                    tTagEntry.stringSize, tTagEntry.arrayRows, tTagEntry.arrayCols);
            }

            if ((tTagEntry.Access == AccessType.READWRITE) ||
                (tTagEntry.Access == AccessType.WRITEONLY))
            {
                tagWriteData = new TagData(tTagEntry.dataType,
                    tTagEntry.stringSize, tTagEntry.arrayRows, tTagEntry.arrayCols);
            }
        }