Exemple #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);
        }
Exemple #2
0
        private IList <SumDataEntity> CreateSumEntityInfos()
        {
            List <SumDataEntity> list = new List <SumDataEntity>();

            foreach (int num2 in this._serverHandles)
            {
                HandleSumEntity item = new HandleSumEntity((uint)num2, 0, 4, this._converter);
                list.Add(item);
            }
            return(list);
        }