using System; using HslCommunication.Profinet.AllenBradley; using HslCommunication.Profinet.Siemens; namespace Tool { public class PlcConnect { private static readonly Lazy lazy = new Lazy(() => new PlcConnect().CreateAb()); public static AllenBradleyNet Instance => lazy.Value; private PlcConnect() { } private AllenBradleyNet CreateAb() { var rfidSetting = RfidSetting.Current; AllenBradleyNet ab = new AllenBradleyNet(); ab.IpAddress = rfidSetting.PlcIp; ab.Port = rfidSetting.Port; ab.ConnectServer(); return ab; } } }