PlcColdStartHandle.cs 835 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using Houdar.PLC.Driver.Simenss.Protocol.Common;
  3. using Houdar.PLC.Driver.Simenss.Protocol.Control;
  4. using Houdar.PLC.Driver.Simenss.Protocol.DateTime;
  5. namespace Houdar.PLC.Driver.Simenss.ProtocolHandle
  6. {
  7. public class PlcColdStartHandle:IPacketHandle
  8. {
  9. public PlcColdStartRequest Request { get; set; }
  10. public ControlResponse Response { get; set; }
  11. public ResultCode ResultCode { get; set; }
  12. public PlcColdStartHandle()
  13. {
  14. ResultCode = ResultCode.Unknown;
  15. Request = new PlcColdStartRequest();
  16. }
  17. public void Handle(IIsoSender sender)
  18. {
  19. Response = sender.IsoSend<PlcColdStartRequest, ControlResponse>(Request);
  20. if(Response==null) return;
  21. ResultCode = Response.Header.Error;
  22. }
  23. }
  24. }