Exemplo n.º 1
0
        protected override int OnWriteSumEntityData(SumDataEntity entity, BinaryWriter writer)
        {
            int num = 0;

            if (base.mode == TwinCAT.Ads.SumCommand.SumCommand.SumAccessMode.IndexGroupIndexOffset)
            {
                IgIoSumEntity entity2 = (IgIoSumEntity)entity;
                num += base.MarshalSumWriteHeader(entity2.IndexGroup, entity2.IndexOffset, entity.WriteLength, writer);
            }
            else if (base.mode == TwinCAT.Ads.SumCommand.SumCommand.SumAccessMode.ValueByHandle)
            {
                HandleSumEntity entity3 = (HandleSumEntity)entity;
                num += base.MarshalSumWriteHeader(0xf005, entity3.Handle, entity.WriteLength, writer);
            }
            else
            {
                if (base.mode != TwinCAT.Ads.SumCommand.SumCommand.SumAccessMode.ReleaseHandle)
                {
                    throw new NotSupportedException();
                }
                HandleSumEntity entity4 = (HandleSumEntity)entity;
                num += base.MarshalSumWriteHeader(0xf006, entity4.Handle, entity.WriteLength, writer);
            }
            return(num);
        }
Exemplo n.º 2
0
        protected override IList <SumDataEntity> CreateSumEntityInfos()
        {
            List <SumDataEntity> list = new List <SumDataEntity>();

            foreach (Symbol symbol in base.UnwrappedSymbols)
            {
                IgIoSumEntity item = new IgIoSumEntity(symbol.IndexGroup, symbol.IndexOffset, symbol.ByteSize, 0);
                list.Add(item);
            }
            return(list);
        }