HeaderPacketWithErrorCode.cs 595 B

123456789101112131415161718192021
  1. using PlcSiemens.O;
  2. using PlcSiemens.Protocol.Common;
  3. namespace PlcSiemens.Protocol.Header
  4. {
  5. public class HeaderPacketWithErrorCode : HeaderPacket
  6. {
  7. public ResultCode Error { get; set; } // Error code
  8. public override void Build(ByteBuffer buffer)
  9. {
  10. P = buffer.PopByte();
  11. PduType = buffer.PopByte();
  12. AbEx = buffer.PopUshort();
  13. Sequence = buffer.PopUshort();
  14. ParLen = buffer.PopUshort();
  15. DataLen = buffer.PopUshort();
  16. Error = (ResultCode)buffer.PopUshort();
  17. }
  18. }
  19. }