public static MvOmronPlcLdd GetOrCreate(string key) { if (!PlcMapper.ContainsKey(key)) { PlcMapper[key] = new MvOmronPlcLdd(); } var plc = PlcMapper[key]; return(plc); }
public static MvOmronPlcLdd Create(string key) { if (PlcMapper.ContainsKey(key)) { throw new Exception("PLC己經存在"); } var plc = PlcMapper[key] = new MvOmronPlcLdd(); return(plc); }