コード例 #1
0
ファイル: clsEqpActPlugIn.cs プロジェクト: k2un/k2un
        /// <summary>
        /// INI로부터 값을 읽어들여 각 PLC의 각 값을 설정하고 구조체에 저장후 PLC를 OPEN한다
        /// </summary>
        /// <returns>성공 => True, 실패 => False</returns>
        public Boolean funOpenPLC()
        {
            Boolean bolOpenPort = false;

            try
            {
                this.pEQPAct = new EQPAct.clsEQPAct();                                  //EQPAct DLL 정의

                for (int dintLoop = 1; dintLoop <= 10; dintLoop++)
                {
                    pEQPAct.PstrBitScanStart[dintLoop]   = pInfo.EQP("Main").BitScanStart[dintLoop];
                    pEQPAct.PstrBitScanEnd[dintLoop]     = pInfo.EQP("Main").BitScanEnd[dintLoop];
                    pEQPAct.PbolBitScanEnabled[dintLoop] = pInfo.EQP("Main").BitScanEnabled[dintLoop];
                }

                pEQPAct.PstrWAreaStart = pInfo.EQP("Main").WordStart;
                pEQPAct.PstrWAreaEnd   = pInfo.EQP("Main").WordEnd;

                pEQPAct.PbolDummyPLC = pInfo.EQP("Main").DummyPLC;

                pEQPAct.PstrAddressPath = pAppPath + @"\system";

                pEQPAct.PintScanTime       = this.pInfo.EQP("Main").ScanTime;               //어경태 20071119
                pEQPAct.PintWorkingSizeMin = this.pInfo.EQP("Main").WorkingSizeMin;
                pEQPAct.PintWorkingSizeMax = this.pInfo.EQP("Main").WorkingSizeMax;

                pEQPAct.PstrTCPIPAddress = "192.168.1.88";
                pEQPAct.PstrTCPIPPort    = "2048";

                //Open을 시도한다.
                bolOpenPort = this.pEQPAct.funOpenPLC(CommonAct.EnuEQP.CommunicationType.NET10);

                //리턴값이 True 이면 성공
                if (bolOpenPort == true)
                {
                    this.pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "PLC Port Open Success");
                    this.pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.MapInitial);
                    //this.pInfo.subPLCCommand_Set(clsInfo.PLCCommand.ECIDRead);
                }
                else
                {                                        //Open이 되지 않아 에러가 발생한 경우
                    this.pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "PLC Port Open Fail");
                }
            }
            catch (Exception ex)
            {
                this.pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }

            return(bolOpenPort);
        }
コード例 #2
0
        public void funSetEqpAct(EQPAct.clsEQPAct eqpAct)
        {
            try
            {
                pEqpAct = eqpAct;

                foreach (clsEQPEvent act in listEQPEvent)
                {
                    act.funSetEqpAct(eqpAct);
                }
            }
            catch (Exception error)
            {
                if (pEqpAct != null)
                {
                    pEqpAct.PInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, error.ToString());
                }
            }
        }
コード例 #3
0
ファイル: clsEQPEvent.cs プロジェクト: k2un/k2un
 public void funSetEqpAct(EQPAct.clsEQPAct eqpAct)
 {
     m_pEqpAct = eqpAct;
 }
コード例 #4
0
ファイル: Simulator.cs プロジェクト: k2un/k2un
        public Simulator(EQPAct.clsEQPAct eqpAct)
        {
            this.eqpAct                  = eqpAct;
            this.mRecipeEventThread      = new System.Threading.Thread(new System.Threading.ThreadStart(subRecipeEventThread));
            this.mRecipeEventThread.Name = "RecipeEventThread";
            this.mRecipeEventThread.Start();

            this.mainUnit.processStateChanged += new EventHandler(mainUnit_processStateChanged);
            this.mainView.recipeStateChanged  += new Info.EventHandlerProcessProgram(mainView_recipeStateChanged);

            Info.Unit LD01 = new Info.Unit("A2CLN51B_CLNU_LD01");
            Info.Unit UP01 = new Info.Unit("A2CLN51B_CLNU_UP01");
            Info.Unit UP02 = new Info.Unit("A2CLN51B_CLNU_UP02");
            Info.Unit UP03 = new Info.Unit("A2CLN51B_CLNU_UP03");
            Info.Unit UP04 = new Info.Unit("A2CLN51B_CLNU_UP04");
            Info.Unit UP05 = new Info.Unit("A2CLN51B_CLNU_UP05");
            Info.Unit IN01 = new Info.Unit("A2CLN51B_CLNU_IN01");
            Info.Unit BB01 = new Info.Unit("A2CLN51B_CLNU_BB01");
            Info.Unit HF01 = new Info.Unit("A2CLN51B_CLNU_HF01");
            Info.Unit HF02 = new Info.Unit("A2CLN51B_CLNU_HF02");
            Info.Unit BB02 = new Info.Unit("A2CLN51B_CLNU_BB02");
            Info.Unit OZ01 = new Info.Unit("A2CLN51B_CLNU_OZ01");
            Info.Unit RN01 = new Info.Unit("A2CLN51B_CLNU_RN01");
            Info.Unit AK01 = new Info.Unit("A2CLN51B_CLNU_AK01");
            Info.Unit UD01 = new Info.Unit("A2CLN51B_CLNU_UD01");

            LD01.processStateChanged += new EventHandler(LD01_processStateChanged);
            UP01.processStateChanged += new EventHandler(UP01_processStateChanged);
            UP02.processStateChanged += new EventHandler(UP02_processStateChanged);
            UP03.processStateChanged += new EventHandler(UP03_processStateChanged);
            UP04.processStateChanged += new EventHandler(UP04_processStateChanged);
            UP05.processStateChanged += new EventHandler(UP05_processStateChanged);
            IN01.processStateChanged += new EventHandler(IN01_processStateChanged);
            BB01.processStateChanged += new EventHandler(BB01_processStateChanged);
            HF01.processStateChanged += new EventHandler(HF01_processStateChanged);
            HF02.processStateChanged += new EventHandler(HF02_processStateChanged);
            BB02.processStateChanged += new EventHandler(BB02_processStateChanged);
            OZ01.processStateChanged += new EventHandler(OZ01_processStateChanged);
            RN01.processStateChanged += new EventHandler(RN01_processStateChanged);
            AK01.processStateChanged += new EventHandler(AK01_processStateChanged);
            UD01.processStateChanged += new EventHandler(UD01_processStateChanged);

            this.mainUnit.subUnit.Add(LD01);
            this.mainUnit.subUnit.Add(UP01);
            this.mainUnit.subUnit.Add(UP02);
            this.mainUnit.subUnit.Add(UP03);
            this.mainUnit.subUnit.Add(UP04);
            this.mainUnit.subUnit.Add(UP05);
            this.mainUnit.subUnit.Add(IN01);
            this.mainUnit.subUnit.Add(BB01);
            this.mainUnit.subUnit.Add(HF01);
            this.mainUnit.subUnit.Add(HF02);
            this.mainUnit.subUnit.Add(BB02);
            this.mainUnit.subUnit.Add(OZ01);
            this.mainUnit.subUnit.Add(RN01);
            this.mainUnit.subUnit.Add(AK01);
            this.mainUnit.subUnit.Add(UD01);

            this.eqpAct.bitChangedCIM += new EventHandler(eqpAct_bitChangedCIM);
            mainView.Show();
        }