BlockItem.cs 513 B

12345678910111213141516171819
  1. using PlcSiemens.O;
  2. using PlcSiemens.Protocol.Common;
  3. namespace PlcSiemens.Protocol.ListBlocks
  4. {
  5. public class BlockItem
  6. {
  7. public byte Zero { get; set; } // always 0x30 -> Ascii 0
  8. public BlockType Type { get; set; } // Block Type
  9. public ushort Count { get; set; } // Block count
  10. public void Build(ByteBuffer buffer)
  11. {
  12. Zero = buffer.PopByte();
  13. Type = (BlockType)buffer.PopByte();
  14. Count = buffer.PopUshort();
  15. }
  16. }
  17. }