12345678910111213141516171819202122232425 |
- using WCS.Core;
- using PLCType = WCS.Core.PLCType;
- namespace WCS.Service.PLCAccessors
- {
- /// <summary>
- /// PLC访问器创建者
- /// </summary>
- public class PLCAccessorsCreater : IPLCAccessorCreater
- {
- /// <summary>
- /// 创建PLC访问器
- /// </summary>
- /// <param name="data">PLC信息</param>
- /// <returns></returns>
- /// <exception cref="Exception"> </exception>
- public IPLCAccessor Create(PLCInfo data)
- {
- if (data.Type == PLCType.Siemens)
- return new SiemensS7PLC(data.IP, data.Port, data.Rack, data.Slot);
- else
- throw new Exception("不支持此PLC");
- }
- }
- }
|