123456789101112131415161718192021 |
- using HslCommunication.Core;
- using System;
- using WCS.Core.DataTrans;
- using WCS.Entity;
- namespace WCS.Service.PLCAccessors
- {
- public class PlcAccessorsCreater : IPlcAccessorCreater
- {
- public IReadWriteNet Create(WCS_PLC data)
- {
- return data.TYPE switch
- {
- PLCType.西门子 => new SiemensS7PLC((int)data.MODEL, data.IP),
- PLCType.三菱 => new MelsecPLC(data.IP, data.PORT),
- //PLCType.AB=>
- _ => throw new Exception("不支持此PLC")
- };
- }
- }
- }
|