using Houdar.Core.Communication.Transport; using Houdar.PLC.Driver.Simenss.Protocol.Common; namespace Houdar.PLC.Driver.Simenss.Protocol.ListBlocks { public class BlockItemListAll { public ResultCode Ret { get; set; } public byte Size { get; set; } public ushort Length { get; set; } public BlockItem[] Items;//每个BlockItem占用4个字节 public void Build(ByteBuffer buffer) { Ret = (ResultCode) buffer.PopByte(); Size = buffer.PopByte(); Length = buffer.PopUshort(); Items = new BlockItem[Length / 4]; for (int i = 0; i < Length / 4; i++) { var tmp = new BlockItem(); tmp.Build(buffer); Items[i] = tmp; } } } }