コード例 #1
0
        /// <summary>
        /// CIM에서 설비로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : cmdName
        /// parameters[1] : 1st parameter
        /// parameters[2] : 2nd parameter
        /// parameters[3] : 3rd parameter
        /// parameters[4] : 4th parameter
        /// parameters[5] : 5th Parameter
        /// </remarks>
        public void funProcessCIMEvent(object[] parameters)
        {
            try
            {
                string dstrStartBitAddress = "B1017";
                string dstrRPCWordAddress  = "W100D";
                string dstrGlassID         = parameters[0].ToString();

                //RPC Word 정보 Write
                InfoAct.clsRPC pRpcInfo = pInfo.RPC(dstrGlassID);
                string         EQPPPID  = pInfo.Unit(0).SubUnit(0).HOSTPPID(pRpcInfo.RPC_PPID).EQPPPID;

                //if (pInfo.All.GlassUpperJobFlag)
                //{
                //    EQPPPID = pInfo.Unit(0).SubUnit(0).MappingEQPPPID(EQPPPID).UP_EQPPPID;
                //}
                //else
                //{
                //    EQPPPID = pInfo.Unit(0).SubUnit(0).MappingEQPPPID(EQPPPID).LOW_EQPPPID;
                //}

                pEqpAct.funWordWrite("W100D", EQPPPID, CommonAct.EnuEQP.PLCRWType.Int_Data);

                pEqpAct.funBitWrite(dstrStartBitAddress, "1");
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
コード例 #2
0
ファイル: subfrmInfoView.cs プロジェクト: k2un/k2un
        private void subExpirationReport(ArrayList darrExpiration, clsInfo.ProcessDataType pdType)
        {
            string dstrLogData = "";

            try
            {
                foreach (string str in darrExpiration)
                {
                    switch (pdType)
                    {
                    case clsInfo.ProcessDataType.APC:
                        InfoAct.clsAPC CurrentAPC = pInfo.APC(str);
                        CurrentAPC.SetTime = DateTime.Now;

                        pInfo.subPLCCommand_Set(clsInfo.PLCCommand.ProcessDataDel, clsInfo.ProcessDataType.APC, "3", "3!" + CurrentAPC.GLSID, true);
                        //// APC Log 작성
                        //dstrLogData += "APC Data 만료!! => ";
                        //dstrLogData += "GLASSID : " + CurrentAPC.GLSID;
                        //this.pInfo.subLog_Set(InfoAct.clsInfo.LogType.APC, CurrentAPC.SetTime.ToString("yyyyMMddHHmmss"), dstrLogData);
                        //dstrLogData = "";
                        this.pInfo.All.APCDBUpdateCheck = true;
                        break;

                    case clsInfo.ProcessDataType.PPC:
                        InfoAct.clsPPC CurrentPPC = this.pInfo.PPC(str);
                        CurrentPPC.SetTime = DateTime.Now;

                        pInfo.subPLCCommand_Set(clsInfo.PLCCommand.ProcessDataDel, clsInfo.ProcessDataType.PPC, "3", "3!" + CurrentPPC.HGLSID, true);
                        //// PPC Log 작성
                        //dstrLogData += "PPC Data 만료!! => ";
                        //dstrLogData += "GLASSID : " + CurrentPPC.HGLSID;
                        //this.pInfo.subLog_Set(InfoAct.clsInfo.LogType.PPC, CurrentPPC.SetTime.ToString("yyyyMMddHHmmss"), dstrLogData);
                        //dstrLogData = "";
                        this.pInfo.All.PPCDBUpdateCheck = true;
                        break;

                    case clsInfo.ProcessDataType.RPC:
                        InfoAct.clsRPC CurrentRPC = this.pInfo.RPC(str);
                        CurrentRPC.SetTime = DateTime.Now;

                        pInfo.subPLCCommand_Set(clsInfo.PLCCommand.ProcessDataDel, clsInfo.ProcessDataType.RPC, "3", "3!" + CurrentRPC.HGLSID, true);
                        //// RPC Log 작성
                        //dstrLogData += "RPC Data 만료!! => ";
                        //dstrLogData += "GLASSID : " + CurrentRPC.HGLSID;
                        //this.pInfo.subLog_Set(InfoAct.clsInfo.LogType.RPC, CurrentRPC.SetTime.ToString("yyyyMMddHHmmss"), dstrLogData);
                        this.pInfo.All.RPCDBUpdateCheck = true;
                        break;

                    default:
                        return;
                    }
                }

                darrExpiration.Clear();
            }
            catch (Exception ex)
            {
                this.pInfo.subLog_Set(clsInfo.LogType.CIM, ex.ToString());
            }
        }
コード例 #3
0
        /// <summary>
        /// Primary Message에 대해 처리한 후 Secondary Message를 Biuld하여 Driver에 전송한다.
        /// </summary>
        /// <param name="msgTran">Primary Message의 Transaction</param>
        public void funPrimaryReceive(Transaction msgTran)
        {
            string dstrModuleID = string.Empty;
            int    dintGLSCNT   = 0;
            int    dintACKC16   = 0;


            InfoAct.clsRPC[] dclsReceivedRPC = null;
            InfoAct.clsRPC[] dclsBackupedRPC = null;


            bool dbolPPIDsynchronized = false;

            DateTime dtSetTime = DateTime.Now;

            int dintCreateCNT   = 0;
            int dintOverrideCNT = 0;

            string strRPCData = "";

            try
            {
                #region "S16F123 수신 및 Reply"
                dstrModuleID = msgTran.Primary().Item("MODULEID").Getvalue().ToString().Trim();

                msgTran.Secondary().Item("MODULEID").Putvalue(dstrModuleID);

                if (pInfo.All.RPCUSE == false)
                {
                    dintACKC16 = 1;
                }
                else if (!dstrModuleID.Equals(this.pInfo.Unit(3).SubUnit(0).ModuleID))
                {
                    dintACKC16 = 3;
                }
                //else
                //{
                dintGLSCNT = Convert.ToInt32(dstrModuleID = msgTran.Primary().Item("GLSCNT").Getvalue().ToString().Trim());

                msgTran.Secondary().Item("GLSCNT").Putvalue(dintGLSCNT);

                dclsReceivedRPC = new InfoAct.clsRPC[dintGLSCNT];
                dclsBackupedRPC = new InfoAct.clsRPC[dintGLSCNT];

                for (int dintLoop = 0; dintLoop < dintGLSCNT; dintLoop++)
                {
                    InfoAct.clsRPC tempRPC = new InfoAct.clsRPC(msgTran.Primary().Item("H_GLASSID" + dintLoop).Getvalue().ToString().Trim());
                    tempRPC.SetTime  = dtSetTime.AddMilliseconds(dintLoop * 10);
                    tempRPC.JOBID    = msgTran.Primary().Item("JOBID" + dintLoop).Getvalue().ToString().Trim();
                    tempRPC.RPC_PPID = msgTran.Primary().Item("RPC_PPID" + dintLoop).Getvalue().ToString().Trim();

                    msgTran.Secondary().Item("H_GLASSID" + dintLoop).Putvalue(tempRPC.HGLSID);
                    msgTran.Secondary().Item("JOBID" + dintLoop).Putvalue(tempRPC.JOBID);
                    msgTran.Secondary().Item("RPC_PPID" + dintLoop).Putvalue(tempRPC.RPC_PPID);
                    msgTran.Secondary().Item("SET_TIME" + dintLoop).Putvalue(tempRPC.SetTime.ToString("yyyyMMddHHmmssff"));

                    #region "HOST PPID Check"
                    //if (!dbolPPIDsynchronized && this.pInfo.Unit(0).SubUnit(0).HOSTPPID(tempRPC.RPC_PPID) == null)
                    //{
                    //    pInfo.All.isReceivedFromHOST = true;
                    //    //pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.SetUpPPID, 2);
                    //    //pHost.subWaitDuringReadFromPLC();
                    //    //pInfo.All.isReceivedFromHOST = false;

                    //    dbolPPIDsynchronized = true;
                    //}

                    if (this.pInfo.Unit(0).SubUnit(0).HOSTPPID(tempRPC.RPC_PPID) == null)
                    {
                        if (dintACKC16 == 0)
                        {
                            dintACKC16 = 4;
                        }
                    }
                    #endregion

                    #region "SetMode Check"
                    if (this.pInfo.RPC(tempRPC.HGLSID) != null)
                    {
                        dintOverrideCNT++;
                        dclsBackupedRPC[dintLoop] = this.pInfo.RPC(tempRPC.HGLSID);

                        if (this.pInfo.RPC(tempRPC.HGLSID).RPC_STATE == 2)
                        {
                            if (dintACKC16 == 0)
                            {
                                dintACKC16 = 2;
                            }
                            tempRPC.RPC_STATE = 2;
                        }
                        else
                        {
                            tempRPC.Mode      = 4;
                            tempRPC.RPC_STATE = 1;
                        }
                    }
                    else
                    {
                        dintCreateCNT++;
                        dclsBackupedRPC[dintLoop] = null;
                        tempRPC.RPC_STATE         = tempRPC.Mode;
                    }
                    #endregion

                    dclsReceivedRPC[dintLoop] = tempRPC;

                    strRPCData += tempRPC.Mode + "!" + tempRPC.HGLSID + "=";
                }
                //}
                if (strRPCData.Length > 0)
                {
                    strRPCData = strRPCData.Substring(0, strRPCData.Length - 1);
                }
                msgTran.Secondary().Item("ACKC16").Putvalue(dintACKC16);

                funSendReply(msgTran);

                #endregion

                #region "ProcessDataSet 처리"
                if (dintACKC16 != 0)
                {
                    return;
                }

                //string[] strParams = new string[dclsReceivedRPC.Length * 2];

                for (int dintLoop = 0; dintLoop < dclsReceivedRPC.Length; dintLoop++)
                {
                    InfoAct.clsRPC CurrentRPC = dclsReceivedRPC[dintLoop];

                    //pInfo.funDBUpdate(clsInfo.ProcessDataType.RPC, CurrentRPC.HGLSID);

                    if (CurrentRPC.Mode == 4)
                    {
                        //this.pInfo.RemoveRPC(CurrentRPC.HGLSID);
                        CurrentRPC.JOBID_Old    = dclsBackupedRPC[dintLoop].JOBID;
                        CurrentRPC.RPC_PPID_Old = dclsBackupedRPC[dintLoop].RPC_PPID;
                        CurrentRPC.SetTime_Old  = dclsBackupedRPC[dintLoop].SetTime;

                        InfoAct.clsRPC CurrentRPC2 = pInfo.RPC(CurrentRPC.HGLSID);
                        CurrentRPC2.JOBID_Old    = CurrentRPC2.JOBID;
                        CurrentRPC2.RPC_PPID_Old = CurrentRPC2.RPC_PPID;
                        CurrentRPC2.SetTime_Old  = CurrentRPC2.SetTime;

                        CurrentRPC2.JOBID    = CurrentRPC.JOBID;
                        CurrentRPC2.RPC_PPID = CurrentRPC.RPC_PPID;
                        CurrentRPC2.SetTime  = CurrentRPC.SetTime;
                    }
                    else
                    {
                        pInfo.AddRPC(CurrentRPC);
                    }

                    //pInfo.subPLCCommand_Set(clsInfo.PLCCommand.ProcessDataLog, InfoAct.clsInfo.ProcessDataType.RPC, CurrentRPC.Mode.ToString(), CurrentRPC.HGLSID, dclsBackupedRPC[dintLoop], CurrentRPC);

                    //strParams[dintLoop * 2] = CurrentRPC.Mode.ToString();
                    //strParams[dintLoop * 2 + 1] = CurrentRPC.HGLSID;

                    //pInfo.subPLCCommand_Set(clsInfo.PLCCommand.ProcessDataSet, clsInfo.ProcessDataType.RPC, CurrentRPC.Mode.ToString(), CurrentRPC.HGLSID, dclsBackupedRPC[dintLoop], CurrentRPC);
                }

                if (string.IsNullOrEmpty(strRPCData) == false)
                {
                    pInfo.subPLCCommand_Set(clsInfo.PLCCommand.ProcessDataSet, clsInfo.ProcessDataType.RPC, "", strRPCData, "", "");
                }

                //this.pInfo.subSendSF_Set(clsInfo.SFName.S16F135RPCDataCMD, strParams);
                #endregion
            }
            catch (Exception error)
            {
                funSetLog(InfoAct.clsInfo.LogType.CIM, error.ToString());
                return;
            }
        }