Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public override int HalClose()
 {
     //可能有其它人在使用 Resource, 不在個別 HAL 裡釋放, 由 HalContext 統一釋放
     using (var obj = this.plcContext)
     {
         if (plcContext != null)
         {
             this.plcContext.Close();
             this.plcContext = null;
         }
     }
     return(0);
 }
Exemplo n.º 3
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 MacHalPlcMaskTransfer(MacHalPlcContext plc = null)
 {
     this.plcContext = plc;
 }
Exemplo n.º 5
0
 public MacHalPlcCleanCh(MacHalPlcContext plc = null)
 {
     this.plcContext = plc;
 }
Exemplo n.º 6
0
 public MacHalPlcLoadPort(MacHalPlcContext plc = null)
 {
     this.plcContext = plc;
 }
Exemplo n.º 7
0
 public MacHalPlcOpenStage(MacHalPlcContext plc = null)
 {
     this.plcContext = plc;
 }
 public MacHalPlcInspectionCh(MacHalPlcContext plc = null)
 {
     this.plcContext = plc;
 }
Exemplo n.º 9
0
 public MacHalPlcCabinet(MacHalPlcContext plc = null)
 {
     this.plcContext = plc;
 }