PLCAccessorsCreater.cs 550 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WCS.Core;
  7. using WCS.Entity;
  8. using HslCommunication.Profinet.Melsec;
  9. namespace WCS.Service.PLCAccessors
  10. {
  11. public class PLCAccessorsCreater : IPLCAccessorCreater
  12. {
  13. public IPLCAccessor Create(WCS_PLC data)
  14. {
  15. if (data.TYPE == PLCType.三菱)
  16. return new MelsecPLC(data.IP, data.PORT);
  17. else
  18. throw new Exception("不支持此PLC");
  19. }
  20. }
  21. }