public override int HalConnect() { this.ip = this.GetDevConnStr(DevConnStr_Ip); this.portid = this.GetDevConnStrInt(DevConnStr_PortId); this.plcContext = this.HalContext.ResourceGetOrRegister(this.resourceKey, () => new MacHalPlcContext() { PlcIp = this.ip, PlcPortId = this.portid, }); return(0); }
public override int HalClose() { //可能有其它人在使用 Resource, 不在個別 HAL 裡釋放, 由 HalContext 統一釋放 using (var obj = this.plcContext) { if (plcContext != null) { this.plcContext.Close(); this.plcContext = null; } } return(0); }
public static MacHalPlcContext Get(string ip, int portid) { var key = string.Format("{0}:{1}", ip, portid); if (!m_mapper.ContainsKey(key)) { m_mapper[key] = new MacHalPlcContext(); } var rtn = m_mapper[key]; rtn.PlcIp = ip; rtn.PlcPortId = portid; return(rtn); }
public MacHalPlcOpenStage(MacHalPlcContext plc = null) { this.plcContext = plc; }
public MacHalPlcInspectionCh(MacHalPlcContext plc = null) { this.plcContext = plc; }
public MacHalPlcLoadPort(MacHalPlcContext plc = null) { this.plcContext = plc; }
public MacHalPlcCabinet(MacHalPlcContext plc = null) { this.plcContext = plc; }
public MacHalPlcBoxTransfer(MacHalPlcContext plc = null) { this.plcContext = plc; }
public MacHalPlcCleanCh(MacHalPlcContext plc = null) { this.plcContext = plc; }