Exemplo n.º 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
        /// (int intPPIDTYPE, string dstrPPID)
        /// </remarks>
        public void funProcessCIMEvent(object[] parameters)
        {
            int    intPPIDTYPE = Convert.ToInt32(parameters[0].ToString());
            string dstrPPID    = parameters[1].ToString();

            string dstrWordAddress = "";
            string dstrBitAddress  = "B1036";

            try
            {
                dstrWordAddress = "W1210";
                if (intPPIDTYPE == 1)
                {
                    pEqpAct.funWordWrite(dstrWordAddress, dstrPPID, EnuEQP.PLCRWType.Int_Data);
                    dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, 11);

                    pEqpAct.funWordWrite(dstrWordAddress, "1", EnuEQP.PLCRWType.Int_Data);
                    dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, 1);
                }
                else
                {
                    //dstrPPID = FunStringH.funStringData(dstrPPID, 20);        //20자로 맞춘다.
                    //pEqpAct.funWordWrite(dstrWordAddress, dstrPPID, EnuEQP.PLCRWType.ASCII_Data);

                    //dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, 21);
                    //pEqpAct.funWordWrite(dstrWordAddress, intPPIDTYPE.ToString(), EnuEQP.PLCRWType.Int_Data);
                }


                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("OnePPIDRead 조회!! PPID = {0}", dstrPPID));

                //시물레이션 Test시 사용
                if (pInfo.EQP("Main").DummyPLC == true)
                {
                    pInfo.All.SimulReadPPIDType = intPPIDTYPE;
                    pInfo.All.SimulReadPPID     = dstrPPID;

                    pInfo.All.simulB1036_Flag = true;
                    pInfo.All.simul_EQPPPID   = dstrPPID;
                    pInfo.All.simulB1036_Data = 1;
                }
                else
                {
                    pEqpAct.funBitWrite(dstrBitAddress, "1");
                }
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 설비에서 CIM으로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : strCompBit
        /// parameters[1] : dstrACTVal
        /// parameters[2] : dintActFrom
        /// parameters[3] : dstrACTFromSub
        /// parameters[4] : intBitVal
        /// parameters[5] : Special Parameter
        /// </remarks>
        public void funProcessEQPEvent(string[] parameters)
        {
            string strCompBit = parameters[0];

            try
            {
                int intUnitID    = Convert.ToInt32(parameters[2]);
                int intSubUnitID = 0;
                int.TryParse(parameters[3].ToString(), out intSubUnitID);
                int dintACTVal = 0;
                int.TryParse(parameters[1], out dintACTVal);
                int intBitVal = 0;
                int.TryParse(parameters[4].ToString(), out intBitVal);
                int      intPortID        = 0;
                int      intSlotNo        = 0;
                string   strAddress       = "";
                string   strLOTID         = "";
                string   strGLSID         = "";
                string   strJudgeID       = "";
                int      Arr_dintSlotNo   = 0;
                int      Dep_dintSlotNo   = 0;
                bool     Arrive_CheckFlag = false;
                bool     Dep_CheckFlag    = false;
                string   strLogMSG        = "";
                DateTime dtNow            = DateTime.Now;
                string   strPortID        = "";
                string   strLotStartFlag  = "";
                string   strLotEndFlag    = "";

                DateTime dtDVTime   = new DateTime();
                string   strDVValue = "";

                switch (intUnitID)
                {
                case 1:
                    switch (dintACTVal)
                    {
                    case 1:         //Port In - Port에 Glass가 들어옴.

                        strPortID = m_pEqpAct.funWordRead("W3040", 2, EnuEQP.PLCRWType.ASCII_Data);
                        intPortID = Convert.ToInt32(strPortID.Substring(1));
                        intSlotNo = Convert.ToInt32(m_pEqpAct.funWordRead("W3042", 1, EnuEQP.PLCRWType.Int_Data));

                        strGLSID = m_pEqpAct.funWordRead("W3043", 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                        strLOTID = pInfo.Port(intPortID).LOTID.Trim();


                        strLotStartFlag = m_pEqpAct.funWordRead("W304D", 1, EnuEQP.PLCRWType.Int_Data);
                        strLotEndFlag   = m_pEqpAct.funWordRead("W304E", 1, EnuEQP.PLCRWType.Int_Data);

                        pInfo.LOTID(strLOTID).GLSID(strGLSID).RunState = "E";
                        pInfo.LOTID(strLOTID).EndGLSCount++;

                        //Component in by Indexer 보고
                        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 322, intUnitID, pInfo.LOTID(strLOTID).InPortID, strLOTID, strGLSID);
                        pInfo.Port(intPortID).Slot(intSlotNo).SLOTINFO = "P";

                        bool dbolWaitGLSCheck = false;
                        for (int dintLoop = 0; dintLoop < pInfo.Port(intPortID).SlotCount; dintLoop++)
                        {
                            if (pInfo.Port(intPortID).Slot(dintLoop + 1).SLOTINFO == "W" || pInfo.Port(intPortID).Slot(dintLoop + 1).SLOTINFO == "R")
                            {
                                dbolWaitGLSCheck = true;
                                break;
                            }
                        }

                        if (dbolWaitGLSCheck == false)
                        {
                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F3_DVReport, 501, 0, 0, strLOTID, strGLSID);
                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F103, strLOTID);
                            if (pInfo.Port(intPortID).AbortFlag == true)
                            {
                                pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ProcessReport, 303, intUnitID, pInfo.LOTID(strLOTID).InPortID, strLOTID, strGLSID);
                            }
                            else if (pInfo.Port(intPortID).OffineChangeFlag == true)
                            {
                                pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ProcessReport, 303, intUnitID, pInfo.LOTID(strLOTID).InPortID, strLOTID, strGLSID);
                            }
                            else
                            {
                                pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ProcessReport, 302, intUnitID, pInfo.LOTID(strLOTID).InPortID, strLOTID, strGLSID);
                            }

                            pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.UnloadReqCMD, intPortID);

                            if (pInfo.Port(intPortID).LOTST == "3")
                            {
                                pInfo.Port(intPortID).LOTST = "4";
                            }
                        }

                        //bool dbolGLSCheckFlag = false;

                        //if (pInfo.Port(intPortID).AbortFlag == true)
                        //{
                        //    foreach (string str in pInfo.LOTID(strLOTID).GLS())
                        //    {
                        //        InfoAct.clsGLS CurrentGLS = pInfo.LOTID(strLOTID).GLSID(str);
                        //        if (CurrentGLS.RunState == "S")
                        //        {
                        //            dbolGLSCheckFlag = true;
                        //            break;
                        //        }
                        //    }

                        //    if (dbolGLSCheckFlag == false)
                        //    {
                        //        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F103, strLOTID);

                        //        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F3_DVReport, 501, 0, 0, strLOTID, strGLSID);

                        //        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ProcessReport, 303, intUnitID, pInfo.LOTID(strLOTID).InPortID, strLOTID, strGLSID);

                        //    }
                        //}
                        //else if (pInfo.LOTID(strLOTID).EndGLSCount == pInfo.LOTID(strLOTID).StartGLSCount + pInfo.LOTID(strLOTID).ScrapCount) //Lot의 마지막 Glass일때
                        //{
                        //    pInfo.LOTID(strLOTID).EndFlag = true;

                        //    //Lot Summary DV Data
                        //    pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F3_DVReport, 501, 0, 0, strLOTID, strGLSID);

                        //    //Lot Information Upload
                        //    pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F103, strLOTID);

                        //    //Process END 보고
                        //    pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ProcessReport, 302, intUnitID, pInfo.LOTID(strLOTID).InPortID, strLOTID, strGLSID);
                        //}

                        //for (int dintLoop = 0; dintLoop < pInfo.PortCount(); dintLoop++)
                        //{
                        //    for (int dintLoop2 = 0; dintLoop2 < pInfo.Port(dintLoop + 1).SlotCount; dintLoop2++)
                        //    {
                        //        if (pInfo.Port(dintLoop + 1).Slot(dintLoop2 + 1).GLSID.Trim() == strGLSID.Trim())
                        //        {
                        //            Dep_CheckFlag = true;
                        //            Dep_dintSlotNo = dintLoop2 + 1;
                        //            break;
                        //        }
                        //    }

                        //    if (Dep_CheckFlag)
                        //    {
                        //        break;
                        //    }
                        //}

                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "Out", "Index -> P0" + intPortID);
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);

                        break;

                    case 2:         //Port Out - Port에서 Glass를 꺼냄.
                        strPortID = m_pEqpAct.funWordRead("W3050", 2, EnuEQP.PLCRWType.ASCII_Data);
                        intPortID = Convert.ToInt32(strPortID.Substring(1));
                        intSlotNo = Convert.ToInt32(m_pEqpAct.funWordRead("W3052", 1, EnuEQP.PLCRWType.Int_Data));

                        strGLSID = m_pEqpAct.funWordRead("W3053", 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                        strLOTID = pInfo.Port(intPortID).LOTID.Trim();

                        pInfo.Port(intPortID).Slot(intSlotNo).SLOTINFO = "R";

                        strLotStartFlag = m_pEqpAct.funWordRead("W305D", 1, EnuEQP.PLCRWType.Int_Data);
                        strLotEndFlag   = m_pEqpAct.funWordRead("W305E", 1, EnuEQP.PLCRWType.Int_Data);

                        if (strLotStartFlag == "1" || pInfo.LOTID(strLOTID).StartFlag)
                        {
                            pInfo.LOTID(strLOTID).StartFlag = false;
                            //Process Start 보고
                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ProcessReport, 301, intUnitID, intPortID, strLOTID, strGLSID);         //Process Start
                        }

                        //Component Out by Indexer 보고
                        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 321, intPortID, 0, strLOTID, strGLSID);

                        pInfo.LOTID(strLOTID).GLSID(strGLSID).RunState = "S";
                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "In", "P0" + intPortID + " -> Index");
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);

                        break;

                    case 3:        //index in - sky C/V에서 Glass를 받음.
                        strPortID = m_pEqpAct.funWordRead("W3060", 2, EnuEQP.PLCRWType.ASCII_Data);
                        intPortID = Convert.ToInt32(strPortID.Substring(1));
                        intSlotNo = Convert.ToInt32(m_pEqpAct.funWordRead("W3062", 1, EnuEQP.PLCRWType.Int_Data));

                        strLOTID = pInfo.Port(intPortID).LOTID.Trim();
                        strGLSID = m_pEqpAct.funWordRead("W3063", 10, EnuEQP.PLCRWType.ASCII_Data).Trim();

                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "In", "Sky C/V -> Index");
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                        break;

                    case 4:        //index out - Index가 Cleaner에게 Glass를 줌.
                        strPortID = m_pEqpAct.funWordRead("W3070", 2, EnuEQP.PLCRWType.ASCII_Data);
                        intPortID = Convert.ToInt32(strPortID.Substring(1));
                        intSlotNo = Convert.ToInt32(m_pEqpAct.funWordRead("W3072", 1, EnuEQP.PLCRWType.Int_Data));

                        strLOTID = pInfo.Port(intPortID).LOTID.Trim();
                        strGLSID = m_pEqpAct.funWordRead("W3073", 10, EnuEQP.PLCRWType.ASCII_Data).Trim();

                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "Out", "Index -> Cleaner");
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                        break;

                    default:            //다른 이벤트는 보고하지 않음.
                        break;
                    }
                    break;

                case 2:     // Cleaner
                    string strCleanerWordAddress = "W4400";
                    strCleanerWordAddress = FunTypeConversion.funAddressAdd(strCleanerWordAddress, 32 * (intSubUnitID - 1));
                    strLOTID = m_pEqpAct.funWordRead(strCleanerWordAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                    strCleanerWordAddress = FunTypeConversion.funAddressAdd(strCleanerWordAddress, 10);
                    strGLSID = m_pEqpAct.funWordRead(strCleanerWordAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                    strCleanerWordAddress = FunTypeConversion.funAddressAdd(strCleanerWordAddress, 10);
                    strJudgeID            = m_pEqpAct.funWordRead(strCleanerWordAddress, 1, EnuEQP.PLCRWType.Int_Data);

                    if (intBitVal == 1)
                    {
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = strGLSID;
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = strLOTID;
                        if (pInfo.Unit(intUnitID).SubUnit(0).CurrGLS(strGLSID) == null)
                        {
                            pInfo.Unit(intUnitID).SubUnit(0).AddCurrGLS(strGLSID);
                            pInfo.Unit(intUnitID).SubUnit(0).CurrGLS(strGLSID).LOTID = strLOTID;
                        }

                        if (pInfo.Unit(intUnitID).SubUnit(intSubUnitID).CurrGLS(strGLSID) == null)
                        {
                            pInfo.Unit(intUnitID).SubUnit(intSubUnitID).AddCurrGLS(strGLSID);
                            pInfo.Unit(intUnitID).SubUnit(intSubUnitID).CurrGLS(strGLSID).LOTID = strLOTID;
                        }


                        if (intSubUnitID == 1)
                        {
                            //Component In By Cleaner
                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 324, intUnitID, 0, strLOTID, strGLSID);

                            strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "In", "");
                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                        }
                    }
                    else
                    {
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = "";
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = "";

                        if (intSubUnitID == 10)
                        {
                            string address          = "W4200";
                            string strCleanerDVData = "";
                            try
                            {
                                dtDVTime    = DateTime.Now;
                                strDVValue  = dtDVTime.ToString("yyyy-MM-dd HH:mm:ss") + ",";
                                strDVValue += strGLSID + ",";
                                strDVValue += "U01,";
                                //DVReport
                                for (int dintLoop = 0; dintLoop < pInfo.Unit(2).SubUnit(0).GLSAPDCount; dintLoop++)
                                {
                                    if (dintLoop != 0)
                                    {
                                        address = CommonAct.FunTypeConversion.funAddressAdd(address, 2);
                                    }

                                    //if (pInfo.Unit(2).SubUnit(0).GLSAPD(dintLoop + 1).Length == 1 || pInfo.Unit(2).SubUnit(0).GLSAPD(dintLoop + 1).Length == 2)
                                    //{
                                    strCleanerDVData = m_pEqpAct.funWordRead(address, 2, EnuEQP.PLCRWType.Int_Data);
                                    strCleanerDVData = CommonAct.FunStringH.funPoint(strCleanerDVData, pInfo.Unit(2).SubUnit(0).GLSAPD(dintLoop + 1).Format);
                                    pInfo.Unit(2).SubUnit(0).GLSAPD(dintLoop + 1).Value = Convert.ToSingle(strCleanerDVData);
                                    pInfo.LOTID(strLOTID).LOTAPD(dintLoop + 1).Value   += pInfo.Unit(2).SubUnit(0).GLSAPD(dintLoop + 1).Value;
                                    strDVValue += pInfo.Unit(2).SubUnit(0).GLSAPD(dintLoop + 1).Value + ",";
                                    //}
                                }
                                strDVValue = strDVValue.Substring(0, strDVValue.Length - 1);
                                pInfo.subLog_Set(InfoAct.clsInfo.LogType.Clenaer_DV, strDVValue);
                            }
                            catch (Exception ex)
                            {
                                try
                                {
                                    for (int dintLoop = 0; dintLoop < pInfo.Unit(2).SubUnit(0).GLSAPDCount; dintLoop++)
                                    {
                                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("Cleaner DV Data List {0} : {1}", dintLoop + 1, m_pEqpAct.funWordRead("W4200", pInfo.Unit(2).SubUnit(0).GLSAPD(dintLoop + 1).Length, EnuEQP.PLCRWType.Int_Data)));
                                    }
                                }
                                catch (Exception ex2)
                                {
                                    pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "Cleaner DVData Read Error!!");
                                    pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex2.ToString());
                                }

                                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
                            }

                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F3_DVReport, 500, intUnitID, 0, strLOTID, strGLSID);

                            //Component Out By Clenaer
                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 323, intUnitID, 0, strLOTID, strGLSID);

                            pInfo.Unit(intUnitID).SubUnit(0).RemoveCurrGLS(strGLSID);

                            strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "Out", "");
                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                        }

                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).RemoveCurrGLS(strGLSID);
                    }
                    break;

                case 3:     //Sky C/V
                    intBitVal = Convert.ToInt32(parameters[4]);

                    string strOvenWordAddress = "W5400";
                    strOvenWordAddress = FunTypeConversion.funAddressAdd(strOvenWordAddress, 32 * (intSubUnitID - 1));
                    strLOTID           = m_pEqpAct.funWordRead(strOvenWordAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                    strOvenWordAddress = FunTypeConversion.funAddressAdd(strOvenWordAddress, 10);
                    strGLSID           = m_pEqpAct.funWordRead(strOvenWordAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                    strOvenWordAddress = FunTypeConversion.funAddressAdd(strOvenWordAddress, 10);
                    strJudgeID         = m_pEqpAct.funWordRead(strOvenWordAddress, 1, EnuEQP.PLCRWType.Int_Data);

                    if (intBitVal == 1)
                    {
                        //strLOTID = m_pEqpAct.funWordRead("W5400", 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                        //strGLSID = m_pEqpAct.funWordRead("W540A", 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                        //strJudgeID = m_pEqpAct.funWordRead("W5414", 1, EnuEQP.PLCRWType.Int_Data);
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = strGLSID;
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = strLOTID;

                        if (pInfo.Unit(intUnitID).SubUnit(0).CurrGLS(strGLSID) == null)
                        {
                            pInfo.Unit(intUnitID).SubUnit(0).AddCurrGLS(strGLSID);
                            pInfo.Unit(intUnitID).SubUnit(0).CurrGLS(strGLSID).LOTID = strLOTID;
                        }

                        if (pInfo.Unit(intUnitID).SubUnit(intSubUnitID).CurrGLS(strGLSID) == null)
                        {
                            pInfo.Unit(intUnitID).SubUnit(intSubUnitID).AddCurrGLS(strGLSID);
                            pInfo.Unit(intUnitID).SubUnit(intSubUnitID).CurrGLS(strGLSID).LOTID = strLOTID;
                        }

                        if (intSubUnitID == 1)
                        {
                            //pInfo.Unit(intUnitID).SubUnit(intSubUnitID).AddCurrGLS(strGLSID);
                            //pInfo.Unit(intUnitID).SubUnit(0).AddCurrGLS(strGLSID);
                            //Component In By Cleaner
                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 324, intUnitID, 0, strLOTID, strGLSID);
                            strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "In", "");
                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                        }
                    }
                    else
                    {
                        //strLOTID = m_pEqpAct.funWordRead("W5460", 10, EnuEQP.PLCRWType.ASCII_Data);
                        //strGLSID = m_pEqpAct.funWordRead("W546A", 10, EnuEQP.PLCRWType.ASCII_Data);
                        //strJudgeID = m_pEqpAct.funWordRead("W5474", 1, EnuEQP.PLCRWType.Int_Data);
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = "";
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = "";

                        if (intSubUnitID == 4)
                        {
                            //Component Out By Clenaer
                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 323, intUnitID, 0, strLOTID, strGLSID);

                            pInfo.Unit(intUnitID).SubUnit(0).RemoveCurrGLS(strGLSID);

                            strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "Out", "");
                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                        }

                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).RemoveCurrGLS(strGLSID);
                    }
                    break;

                case 4:    //Robot
                    strAddress = "W6200";
                    strAddress = CommonAct.FunTypeConversion.funAddressAdd(strAddress, 32 * (dintACTVal - 1));

                    strLOTID   = m_pEqpAct.funWordRead(strAddress, 10, EnuEQP.PLCRWType.ASCII_Data);
                    strAddress = CommonAct.FunTypeConversion.funAddressAdd(strAddress, 10);
                    strGLSID   = m_pEqpAct.funWordRead(strAddress, 10, EnuEQP.PLCRWType.ASCII_Data);


                    InfoAct.clsGLS CurrentGLS = null;

                    if (pInfo.Unit(4).SubUnit(0).CurrGLS(strGLSID) == null)
                    {
                        pInfo.Unit(4).SubUnit(0).AddCurrGLS(strGLSID);
                    }

                    switch (dintACTVal)
                    {
                    case 1:
                        CurrentGLS       = pInfo.Unit(4).SubUnit(0).CurrGLS(strGLSID);
                        CurrentGLS.LOTID = strLOTID;
                        strLogMSG        = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, "Oven Robot", "In", "Cleaner -> Oven Robot");
                        break;

                    case 2:
                        pInfo.Unit(4).SubUnit(0).RemoveCurrGLS(strGLSID);
                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, "Oven Robot", "Out", "Oven Robot -> Sky C/V");
                        break;

                    case 3:
                        pInfo.Unit(4).SubUnit(0).RemoveCurrGLS(strGLSID);
                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, "Oven Robot", "Out", "Oven Robot -> Oven1");
                        break;

                    case 4:
                        CurrentGLS       = pInfo.Unit(4).SubUnit(0).CurrGLS(strGLSID);
                        CurrentGLS.LOTID = strLOTID;
                        strLogMSG        = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, "Oven Robot", "In", "Oven1 -> Oven Robot");
                        break;

                    case 5:
                        pInfo.Unit(4).SubUnit(0).RemoveCurrGLS(strGLSID);
                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, "Oven Robot", "Out", "Oven Robot -> Oven2");
                        break;

                    case 6:
                        CurrentGLS       = pInfo.Unit(4).SubUnit(0).CurrGLS(strGLSID);
                        CurrentGLS.LOTID = strLOTID;
                        strLogMSG        = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, "Oven Robot", "In", "Oven2 -> Oven Robot");
                        break;
                    }

                    pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);


                    break;

                case 5:    //OVEN#01
                    intBitVal = Convert.ToInt32(parameters[4]);

                    strAddress = CommonAct.FunTypeConversion.funAddressAdd("W7500", (intSubUnitID - 1) * 32);
                    strLOTID   = m_pEqpAct.funWordRead(strAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();

                    strAddress = CommonAct.FunTypeConversion.funAddressAdd(strAddress, 10);
                    strGLSID   = m_pEqpAct.funWordRead(strAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();

                    strAddress = CommonAct.FunTypeConversion.funAddressAdd(strAddress, 10);
                    strJudgeID = m_pEqpAct.funWordRead(strAddress, 1, EnuEQP.PLCRWType.Int_Data);

                    if (intBitVal == 1)
                    {
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = strGLSID;
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = strLOTID;

                        if (pInfo.Unit(intUnitID).SubUnit(0).CurrGLS(strGLSID) == null)
                        {
                            pInfo.Unit(intUnitID).SubUnit(0).AddCurrGLS(strGLSID);
                            pInfo.Unit(intUnitID).SubUnit(0).CurrGLS(strGLSID).LOTID = strLOTID;
                        }

                        if (pInfo.Unit(intUnitID).SubUnit(intSubUnitID).CurrGLS(strGLSID) == null)
                        {
                            pInfo.Unit(intUnitID).SubUnit(intSubUnitID).AddCurrGLS(strGLSID);
                            pInfo.Unit(intUnitID).SubUnit(intSubUnitID).CurrGLS(strGLSID).LOTID = strLOTID;
                        }

                        //Component In By Cleaner
                        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 324, intUnitID, 0, strLOTID, strGLSID);

                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "In", "");
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                    }
                    else
                    {
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = "";
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = "";
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).RemoveCurrGLS(strGLSID);
                        pInfo.Unit(intUnitID).SubUnit(0).RemoveCurrGLS(strGLSID);

                        try
                        {
                            string address       = "W7300";
                            string strOvenDVData = "";


                            dtDVTime    = DateTime.Now;
                            strDVValue  = dtDVTime.ToString("yyyy-MM-dd HH:mm:ss") + ",";
                            strDVValue += strGLSID + ",";
                            strDVValue += "U02,";

                            int dintOven01UnitID = 5;

                            //DVReport
                            for (int dintLoop = 0; dintLoop < pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPDCount; dintLoop++)
                            {
                                if (dintLoop != 0)
                                {
                                    address = CommonAct.FunTypeConversion.funAddressAdd(address, pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop).Length);
                                }
                                if (pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Length == 1)
                                {
                                    strOvenDVData = m_pEqpAct.funWordRead(address, pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Length, EnuEQP.PLCRWType.Int_Data);
                                    strOvenDVData = CommonAct.FunStringH.funPoint(strOvenDVData, pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Format);
                                    pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Value = Convert.ToSingle(strOvenDVData);
                                    strDVValue += strOvenDVData + ",";
                                    pInfo.LOTID(strLOTID.Trim()).LOTAPD(pInfo.Unit(2).SubUnit(0).GLSAPDCount + dintLoop).Value += pInfo.Unit(intUnitID).SubUnit(0).GLSAPD(dintLoop + 1).Value;
                                }
                                else if (pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Length == 6)
                                {
                                    string Oven01_DateTime = "";
                                    Oven01_DateTime += m_pEqpAct.funWordRead(address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    address          = CommonAct.FunTypeConversion.funAddressAdd(address, 1);
                                    Oven01_DateTime += m_pEqpAct.funWordRead(address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    address          = CommonAct.FunTypeConversion.funAddressAdd(address, 1);
                                    Oven01_DateTime += m_pEqpAct.funWordRead(address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    address          = CommonAct.FunTypeConversion.funAddressAdd(address, 1);
                                    Oven01_DateTime += m_pEqpAct.funWordRead(address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    address          = CommonAct.FunTypeConversion.funAddressAdd(address, 1);
                                    Oven01_DateTime += m_pEqpAct.funWordRead(address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    address          = CommonAct.FunTypeConversion.funAddressAdd(address, 1);
                                    Oven01_DateTime += m_pEqpAct.funWordRead(address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    address          = CommonAct.FunTypeConversion.funAddressAdd(address, 1);
                                    //Oven01_DateTime += m_pEqpAct.funWordRead(address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    //address = CommonAct.FunTypeConversion.funAddressAdd(address, 1);


                                    if (pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Name == "Oven01_LOADING_TIME")
                                    {
                                        pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop + 1).LoadingTIME = Oven01_DateTime;
                                        strDVValue += Oven01_DateTime + ",";
                                    }
                                    else
                                    {
                                        pInfo.Unit(dintOven01UnitID).SubUnit(0).GLSAPD(dintLoop + 1).UnloadingTIME = Oven01_DateTime;
                                        strDVValue += Oven01_DateTime + ",";
                                    }

                                    address = CommonAct.FunTypeConversion.funAddressAdd(address, -6);
                                }
                            }
                            strDVValue = strDVValue.Substring(0, strDVValue.Length - 1);

                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F3_DVReport, 500, intUnitID, 0, strLOTID, strGLSID);
                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.Oven_DV, strDVValue);
                        }
                        catch (Exception ex)
                        {
                            try
                            {
                                for (int dintLoop = 0; dintLoop < pInfo.Unit(intUnitID).SubUnit(0).GLSAPDCount; dintLoop++)
                                {
                                    pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("Oven01 DVData List {0} : {1}", dintLoop + 1, m_pEqpAct.funWordRead("W7300", pInfo.Unit(intUnitID).SubUnit(0).GLSAPD(dintLoop + 1).Length, EnuEQP.PLCRWType.Int_Data)));
                                }
                            }
                            catch (Exception ex2)
                            {
                                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "Oven01 DVData Read Error!!");
                                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex2.ToString());
                            }

                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
                        }


                        //Component In By Cleaner
                        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 323, intUnitID, 0, strLOTID, strGLSID);

                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "Out", "");
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                    }
                    break;

                case 6:    //OVEN#02
                    intBitVal = Convert.ToInt32(parameters[4]);

                    strAddress = CommonAct.FunTypeConversion.funAddressAdd("W8500", (intSubUnitID - 1) * 32);
                    strLOTID   = m_pEqpAct.funWordRead(strAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();

                    strAddress = CommonAct.FunTypeConversion.funAddressAdd(strAddress, 10);
                    strGLSID   = m_pEqpAct.funWordRead(strAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();

                    strAddress = CommonAct.FunTypeConversion.funAddressAdd(strAddress, 10);
                    strJudgeID = m_pEqpAct.funWordRead(strAddress, 1, EnuEQP.PLCRWType.Int_Data);

                    if (intBitVal == 1)
                    {
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = strGLSID;
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = strLOTID;
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).AddCurrGLS(strGLSID);
                        pInfo.Unit(intUnitID).SubUnit(0).AddCurrGLS(strGLSID);

                        //Component In By Cleaner
                        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 324, intUnitID, 0, strLOTID, strGLSID);

                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "In", "");
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                    }
                    else
                    {
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = "";
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = "";
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).RemoveCurrGLS(strGLSID);
                        pInfo.Unit(intUnitID).SubUnit(0).RemoveCurrGLS(strGLSID);

                        string Oven02_address = "W8300";
                        string strOven2DVData = "";
                        dtDVTime    = DateTime.Now;
                        strDVValue  = dtDVTime.ToString("yyyy-MM-dd HH:mm:ss") + ",";
                        strDVValue += strGLSID + ",";
                        strDVValue += "U03,";

                        try
                        {
                            int dintOven02UnitID = 5;

                            //DVReport
                            for (int dintLoop = 0; dintLoop < pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPDCount; dintLoop++)
                            {
                                if (dintLoop != 0)
                                {
                                    Oven02_address = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop).Length);
                                }
                                if (pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Length == 1)
                                {
                                    strOven2DVData = m_pEqpAct.funWordRead(Oven02_address, pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Length, EnuEQP.PLCRWType.Int_Data);
                                    strOven2DVData = CommonAct.FunStringH.funPoint(strOven2DVData, pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Format);
                                    pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Value = Convert.ToSingle(strOven2DVData);
                                    strDVValue += strOven2DVData + ",";

                                    //pInfo.LOTID(strLOTID.Trim()).LOTAPD(pInfo.Unit(2).SubUnit(0).GLSAPDCount + pInfo.Unit(5).SubUnit(0).GLSAPDCount + dintLoop).Value += pInfo.Unit(intUnitID).SubUnit(0).GLSAPD(dintLoop + 1).Value;
                                    pInfo.LOTID(strLOTID.Trim()).LOTAPD(pInfo.Unit(2).SubUnit(0).GLSAPDCount + dintLoop).Value += pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Value;
                                }
                                else if (pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Length == 6)
                                {
                                    string Oven02_DateTime = "";
                                    Oven02_DateTime += m_pEqpAct.funWordRead(Oven02_address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    Oven02_address   = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, 1);
                                    Oven02_DateTime += m_pEqpAct.funWordRead(Oven02_address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    Oven02_address   = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, 1);
                                    Oven02_DateTime += m_pEqpAct.funWordRead(Oven02_address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    Oven02_address   = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, 1);
                                    Oven02_DateTime += m_pEqpAct.funWordRead(Oven02_address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    Oven02_address   = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, 1);
                                    Oven02_DateTime += m_pEqpAct.funWordRead(Oven02_address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    Oven02_address   = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, 1);
                                    Oven02_DateTime += m_pEqpAct.funWordRead(Oven02_address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    Oven02_address   = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, 1);
                                    //Oven02_DateTime += m_pEqpAct.funWordRead(Oven02_address, 1, EnuEQP.PLCRWType.Int_Data).PadLeft(2, '0');
                                    //Oven02_address = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, 1);


                                    if (pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).Name == "Oven02_LOADING_TIME")
                                    {
                                        pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).LoadingTIME = Oven02_DateTime;
                                        strDVValue += Oven02_DateTime + ",";
                                    }
                                    else
                                    {
                                        pInfo.Unit(dintOven02UnitID).SubUnit(0).GLSAPD(dintLoop + 1).UnloadingTIME = Oven02_DateTime;
                                        strDVValue += Oven02_DateTime + ",";
                                    }
                                    Oven02_address = CommonAct.FunTypeConversion.funAddressAdd(Oven02_address, -6);
                                }
                            }
                            strDVValue = strDVValue.Substring(0, strDVValue.Length - 1);

                            pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F3_DVReport, 500, intUnitID, 0, strLOTID, strGLSID);
                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.Oven_DV, strDVValue);
                        }
                        catch (Exception ex)
                        {
                            try
                            {
                                for (int dintLoop = 0; dintLoop < pInfo.Unit(5).SubUnit(0).GLSAPDCount; dintLoop++)
                                {
                                    pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("Oven02 DVData List {0} : {1}", dintLoop + 1, m_pEqpAct.funWordRead("W8300", pInfo.Unit(5).SubUnit(0).GLSAPD(dintLoop + 1).Length, EnuEQP.PLCRWType.Int_Data)));
                                }
                            }
                            catch (Exception ex2)
                            {
                                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "Oven02 DVData Read Error!!");
                                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex2.ToString());
                            }

                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
                        }

                        //Component In By Cleaner
                        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_ComponentReport, 323, intUnitID, 0, strLOTID, strGLSID);

                        strLogMSG = string.Format("{0},{1},{2},{3},{4},{5}", dtNow.ToString("HH:mm:ss.ff"), strLOTID, strGLSID, pInfo.Unit(intUnitID).SubUnit(0).ReportUnitID, "Out", "");
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSInOut, strLogMSG);
                    }
                    break;
                }

                if (intUnitID == 1 || intUnitID == 4)
                {
                    intSubUnitID = 0;
                }
                if (intBitVal == 1)
                {
                    try
                    {
                        pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSExist = true;
                    }
                    catch (Exception ex)
                    {
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("IntUnitID : {0}, intSubUnitID : {1}", intUnitID, intSubUnitID));
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
                    }

                    //pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSID = "";
                    //pInfo.Unit(intUnitID).SubUnit(intSubUnitID).LOTID = "";
                }
                else
                {
                    pInfo.Unit(intUnitID).SubUnit(intSubUnitID).GLSExist = false;
                }

                //if(strCompBit != null) m_pEqpAct.subSetConfirmBit(strCompBit);
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
                //m_pEqpAct.subSetConfirmBit(strCompBit);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 설비에서 CIM으로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : strCompBit
        /// parameters[1] : dstrACTVal
        /// parameters[2] : dintActFrom
        /// parameters[3] : dstrACTFromSub
        /// parameters[4] : intBitVal
        /// parameters[5] : Special Parameter
        /// </remarks>
        public void funProcessEQPEvent(string[] parameters)
        {
            string dstrHGLSID       = "";
            string dstrWordAddress  = "W1440";
            string dstrBitAddress   = "";
            bool   dbolItemCheck    = false;
            string strAPCEQPPPID    = "";
            string dstrValue        = "";
            int    APCItemIndex     = 0;
            string JobRecipe        = "";
            string strWordWriteData = "";

            try
            {
                #region 임시

                dstrHGLSID      = "TEST";
                dstrWordAddress = "W1440";
                dstrBitAddress  = "B1018";

                for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).EQPPPID(strAPCEQPPPID).PPIDBodyCount; dintLoop++)
                {
                    dbolItemCheck = false;
                    for (int dintLoop2 = 0; dintLoop2 < pInfo.APC(dstrHGLSID).ParameterName.Length; dintLoop2++)
                    {
                        if (pInfo.APC(dstrHGLSID).ParameterName[dintLoop2] == pInfo.Unit(0).SubUnit(0).EQPPPID(strAPCEQPPPID).PPIDBody(dintLoop).Name)
                        {
                            APCItemIndex  = dintLoop2;
                            dbolItemCheck = true;
                            break;
                        }
                    }

                    if (dbolItemCheck)
                    {
                        dstrValue = Convert.ToInt32(FunStringH.funMakePLCData(pInfo.APC(dstrHGLSID).ParameterValue[APCItemIndex].ToString())).ToString();
                    }
                    else
                    {
                        dstrValue = FunStringH.funMakePLCData(pInfo.Unit(0).SubUnit(0).EQPPPID(strAPCEQPPPID).PPIDBody(dintLoop).Value);
                    }

                    //if (pInfo.Unit(0).SubUnit(0).EQPPPID(strAPCEQPPPID).PPIDBody(dintLoop).Length > 1)
                    //{
                    //    pEqpAct.funDoubleWordWrite(dstrWordAddress, dstrValue, EnuEQP.PLCRWType.Int_Data);
                    //}
                    //else
                    //{
                    //    pEqpAct.funWordWrite(dstrWordAddress, dstrValue, EnuEQP.PLCRWType.Int_Data);
                    //}

                    //dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);
                    if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length == 2)
                    {
                        if (dstrValue.Contains("-"))
                        {
                            strWordWriteData = m_pEqpAct.funWordWriteString(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, dstrValue.ToString(), EnuEQP.PLCRWType.Int_Data);
                            //m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData, EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                        }
                        else
                        {
                            strWordWriteData = m_pEqpAct.funWordWriteString(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, dstrValue.ToString(), EnuEQP.PLCRWType.Int_Data).Substring(4, 4) + m_pEqpAct.funWordWriteString(2, dstrValue.ToString(), EnuEQP.PLCRWType.Int_Data).Substring(0, 4);
                        }

                        m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData.Substring(4, 4), EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                        dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, 1);
                        m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData.Substring(0, 4), EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                        //m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData, EnuEQP.PLCRWType.Hex_Data);
                        dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length - 1);
                    }
                    else
                    {
                        strWordWriteData = m_pEqpAct.funWordWriteString(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, dstrValue, EnuEQP.PLCRWType.ASCII_Data);
                        dstrWordAddress  = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);
                    }
                }


                //pEqpAct.funBitWrite(dstrBitAddress, "1");

                //pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S16F111APCStart, dstrHGLSID);

                #endregion

                //int dintTest = 124;
                //for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount; dintLoop++)
                //{
                //    if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length == 2)
                //    {
                //        dintTest -= 1;

                //        if (dintTest < 0)
                //        {
                //            strWordWriteData = m_pEqpAct.funWordWriteString(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, dintTest.ToString(), EnuEQP.PLCRWType.Int_Data);
                //            //m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData, EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터

                //        }
                //        else
                //        {
                //            strWordWriteData = m_pEqpAct.funWordWriteString(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, dintTest.ToString(), EnuEQP.PLCRWType.Int_Data).Substring(4, 4) + m_pEqpAct.funWordWriteString(2, dintTest.ToString(), EnuEQP.PLCRWType.Int_Data).Substring(0, 4);
                //        }

                //        m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData.Substring(4, 4), EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                //        dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, 1);
                //        m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData.Substring(0, 4), EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                //        //m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData, EnuEQP.PLCRWType.Hex_Data);
                //        dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length - 1);
                //    }
                //    else
                //    {
                //        strWordWriteData = m_pEqpAct.funWordWriteString(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, dintTest.ToString(), EnuEQP.PLCRWType.ASCII_Data);
                //        dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);

                //    }

                //    //m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData.Substring(4, 4), EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                //    //dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, 1);

                //    //m_pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData.Substring(0, 4), EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                //    //dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length - 1);
                //}
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 설비에서 CIM으로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : strCompBit
        /// parameters[1] : dstrACTVal
        /// parameters[2] : dintActFrom
        /// parameters[3] : dstrACTFromSub
        /// parameters[4] : intBitVal
        /// parameters[5] : Special Parameter
        /// </remarks>
        public void funProcessEQPEvent(string[] parameters)
        {
            string strCompBit = parameters[0];

            string[]  dstrValue;
            int       dintPPID    = 0;
            ArrayList arrCon      = new ArrayList();
            string    dstrAddress = "";

            try
            {
                m_pEqpAct.subWordReadSave("W2040", 1, EnuEQP.PLCRWType.Int_Data);       //EQP PPID
                m_pEqpAct.subWordReadSave("", 10, EnuEQP.PLCRWType.Int_Data);           //Spare
                m_pEqpAct.subWordReadSave("", 1, EnuEQP.PLCRWType.Int_Data);            //PPID Type
                //for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount; dintLoop++)
                //{
                //    dintLength = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                //    m_pEqpAct.subWordReadSave("", dintLength, EnuEQP.PLCRWType.Int_Data);   //Body
                //}

                dstrValue = m_pEqpAct.funWordReadAction(true);

                //PLC Req에 대한 CIM의 Confirm Bit를 준다.
                dintPPID = Convert.ToInt32(dstrValue[0]);

                foreach (string strEQPPPID in pInfo.Unit(0).SubUnit(0).MappingEQPPPID())
                {
                    InfoAct.clsMappingEQPPPID CurrentPPID = pInfo.Unit(0).SubUnit(0).MappingEQPPPID(strEQPPPID);
                    if (CurrentPPID.LOW_EQPPPID == dstrValue[0] || CurrentPPID.UP_EQPPPID == dstrValue[0])
                    {
                        if (arrCon.Contains(CurrentPPID) == false)
                        {
                            arrCon.Add(CurrentPPID);
                        }
                    }
                }

                dstrAddress = "W1800";
                m_pEqpAct.funWordWrite(dstrAddress, arrCon.Count.ToString(), EnuEQP.PLCRWType.Int_Data);
                InfoAct.clsMappingEQPPPID CurrentMappingPPID;
                dstrAddress = FunTypeConversion.funAddressAdd(dstrAddress, 1);

                for (int dintLoop = 0; dintLoop < arrCon.Count; dintLoop++)
                {
                    CurrentMappingPPID = (InfoAct.clsMappingEQPPPID)arrCon[dintLoop];

                    m_pEqpAct.funWordWrite(dstrAddress, CurrentMappingPPID.EQPPPID.PadRight(16), EnuEQP.PLCRWType.ASCII_Data);
                    dstrAddress = FunTypeConversion.funAddressAdd(dstrAddress, 8);

                    m_pEqpAct.funWordWrite(dstrAddress, CurrentMappingPPID.UP_EQPPPID, EnuEQP.PLCRWType.Int_Data);
                    dstrAddress = FunTypeConversion.funAddressAdd(dstrAddress, 1);
                    m_pEqpAct.funWordWrite(dstrAddress, CurrentMappingPPID.LOW_EQPPPID, EnuEQP.PLCRWType.Int_Data);
                    dstrAddress = FunTypeConversion.funAddressAdd(dstrAddress, 1);
                }

                m_pEqpAct.subSetConfirmBit(strCompBit);
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Exemplo n.º 5
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)
        {
            string dstrHGLSID       = "";
            string dstrWordAddress  = "";
            string dstrBitAddress   = "";
            bool   dbolItemCheck    = false;
            string strAPCEQPPPID    = "";
            string dstrValue        = "";
            int    APCItemIndex     = 0;
            string JobRecipe        = "";
            string strWordWriteData = "";

            try
            {
                //dstrHGLSID = parameters[0].ToString();
                dstrHGLSID = parameters[0].ToString(); //Test

                dstrWordAddress = "W1440";
                dstrBitAddress  = "B1018";
                strAPCEQPPPID   = pInfo.APC(dstrHGLSID).EQPPPID;

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

                for (int dintLoop = 0; dintLoop < 574; dintLoop++)
                {
                    pEqpAct.funWordWrite(dstrWordAddress, "0", EnuEQP.PLCRWType.Int_Data);
                    dstrWordAddress = CommonAct.FunTypeConversion.funAddressAdd(dstrWordAddress, 1);
                }

                dstrWordAddress = "W1440";

                for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).EQPPPID(strAPCEQPPPID).PPIDBodyCount; dintLoop++)
                {
                    dbolItemCheck = false;
                    for (int dintLoop2 = 0; dintLoop2 < pInfo.APC(dstrHGLSID).ParameterName.Length; dintLoop2++)
                    {
                        if (pInfo.APC(dstrHGLSID).ParameterName[dintLoop2] == pInfo.Unit(0).SubUnit(0).EQPPPID(strAPCEQPPPID).PPIDBody(dintLoop).Name)
                        {
                            APCItemIndex  = dintLoop2;
                            dbolItemCheck = true;
                            break;
                        }
                    }

                    if (dbolItemCheck)
                    {
                        dstrValue = Convert.ToInt32(FunStringH.funMakePLCData(pInfo.APC(dstrHGLSID).ParameterValue[APCItemIndex].ToString())).ToString();
                    }
                    else
                    {
                        dstrValue = FunStringH.funMakePLCData(pInfo.Unit(0).SubUnit(0).EQPPPID(strAPCEQPPPID).PPIDBody(dintLoop).Value);
                    }

                    //if (pInfo.Unit(0).SubUnit(0).EQPPPID(strAPCEQPPPID).PPIDBody(dintLoop).Length > 1)
                    //{
                    //    pEqpAct.funDoubleWordWrite(dstrWordAddress, dstrValue, EnuEQP.PLCRWType.Int_Data);
                    //}
                    //else
                    //{
                    //    pEqpAct.funWordWrite(dstrWordAddress, dstrValue, EnuEQP.PLCRWType.Int_Data);
                    //}

                    //dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);

                    if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length == 2)
                    {
                        if (dstrValue.Contains("-"))
                        {
                            strWordWriteData = pEqpAct.funWordWriteString(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, dstrValue, EnuEQP.PLCRWType.Int_Data);
                        }
                        else
                        {
                            strWordWriteData = pEqpAct.funWordWriteString(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, dstrValue, EnuEQP.PLCRWType.Int_Data).Substring(4, 4) + pEqpAct.funWordWriteString(2, dstrValue, EnuEQP.PLCRWType.Int_Data).Substring(0, 4);
                        }

                        pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData.Substring(4, 4), EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                        dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, 1);
                        pEqpAct.funWordWrite(dstrWordAddress, strWordWriteData.Substring(0, 4), EnuEQP.PLCRWType.Hex_Data);        //변경할 ECID 데이터
                        dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length - 1);
                    }
                    else
                    {
                        pEqpAct.funWordWrite(dstrWordAddress, dstrValue.PadRight(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length), EnuEQP.PLCRWType.ASCII_Data);
                        dstrWordAddress = FunTypeConversion.funAddressAdd(dstrWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);
                    }
                }
                pEqpAct.funWordWrite("W167E", strAPCEQPPPID, EnuEQP.PLCRWType.Int_Data);
                pEqpAct.funBitWrite(dstrBitAddress, "1");

                //pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S16F111APCStart, dstrHGLSID);
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 설비에서 CIM으로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : strCompBit
        /// parameters[1] : dstrACTVal
        /// parameters[2] : dintActFrom
        /// parameters[3] : dstrACTFromSub
        /// parameters[4] : intBitVal
        /// parameters[5] : Special Parameter
        /// </remarks>
        public void funProcessEQPEvent(string[] parameters)
        {
            string strCompBit = parameters[0];

            StringBuilder dstrLog        = new StringBuilder();
            string        dstrEQPPPID    = "";
            int           dintPPIDType   = 0;
            string        dstrTemp       = "";
            string        strWordAddress = "";

            try
            {
                dstrEQPPPID  = m_pEqpAct.funWordRead("W2540", 1, EnuEQP.PLCRWType.Int_Data);
                dintPPIDType = 1;
                pInfo.Unit(0).SubUnit(0).RemoveEQPPPID(dstrEQPPPID);
                #region 수정 전
                //strWordAddress = "W254C";
                //if (pInfo.Unit(0).SubUnit(0).AddEQPPPID(dstrEQPPPID) == true)
                //{
                //    for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount; dintLoop++)
                //    {
                //        //EQPPPID에 Body 저장
                //        if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop) == true)
                //        {
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                //            if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length == 2)
                //            {
                //                dstrTemp = FunStringH.funPoint(m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.Int_Data), pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                //                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                //            }
                //            else
                //            {
                //                dstrTemp = m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.ASCII_Data);
                //                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                //            }
                //            strWordAddress = CommonAct.FunTypeConversion.funAddressAdd(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);
                //        }
                //    }
                //}
                #endregion

                #region 수정 후
                int    dintReadcount  = (pInfo.Unit(0).SubUnit(0).PPIDBodyCount - 5) * 2;
                string dstrReadData   = "";
                int    dintLength     = 0;
                string strValue       = "";
                int    dintStartIndex = 0;
                strWordAddress = "W254C";
                if (pInfo.Unit(0).SubUnit(0).AddEQPPPID(dstrEQPPPID) == true)
                {
                    //if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBodyCount == 0)
                    //{
                    //[2015/04/20] PPID Body 값 Block으로 한번에(Add by HS)
                    dstrReadData = m_pEqpAct.funWordRead("W254C", dintReadcount, EnuEQP.PLCRWType.Hex_Data, false).Trim();
                    #region EQPPPID에 Body 저장
                    for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount - 5; dintLoop++)
                    {
                        if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop) == true)
                        {
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range    = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode  = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                            dintLength = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length * 4;   //Length에 맞게 자를 문자열 개수를 가져온다.
                            dstrTemp   = dstrReadData.Substring(dintStartIndex, dintLength);

                            if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length > 1)
                            {
                                string dstrTemp1 = dstrTemp.Substring(0, 4);
                                string dstrTemp2 = dstrTemp.Substring(4, 4);
                                dstrTemp = dstrTemp2 + dstrTemp1;

                                strValue = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.Decimal);
                                dstrTemp = FunStringH.funPoint(strValue, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                            }
                            else
                            {
                                strValue = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.ASCString);
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = strValue;
                            }

                            dintStartIndex += dintLength;

                            #region 변경전 [2015.04.20] Modify by HS
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                            //if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length == 2)
                            //{
                            //    dstrTemp = FunStringH.funPoint(m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.Int_Data), pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                            //    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                            //}
                            //else
                            //{
                            //    dstrTemp = m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.ASCII_Data);
                            //    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                            //}
                            //strWordAddress = CommonAct.FunTypeConversion.funAddressAdd(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);
                            #endregion
                        }
                    }
                    #endregion

                    strWordAddress = CommonAct.FunTypeConversion.funAddressAdd(strWordAddress, dintReadcount);

                    dstrReadData   = m_pEqpAct.funWordRead(strWordAddress, 80, EnuEQP.PLCRWType.ASCII_Data, false);
                    dintStartIndex = 0;
                    #region EQPPPID에 Film Code 저장
                    for (int dintLoop = 251; dintLoop <= 255; dintLoop++)
                    {
                        if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop) == true)
                        {
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range    = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode  = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                            dintLength = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length * 2;   //Length에 맞게 자를 문자열 개수를 가져온다.
                            dstrTemp   = dstrReadData.Substring(dintStartIndex, dintLength);


                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp.Trim();
                        }

                        dintStartIndex += dintLength;
                    }
                    #endregion
                    //}
                }
                #endregion

                //PLC Req에 대한 CIM의 Confirm Bit를 준다.
                m_pEqpAct.subSetConfirmBit(strCompBit);

                switch (dintPPIDType)
                {
                case 1:             //EQP PPID
                    //Parameter.log에 로그 출력
                    m_pEqpAct.subSetParameterLog("EQP PPID 생성", "", null, dstrEQPPPID, dstrEQPPPID);

                    int[]  arrData = new int[16];
                    string strData = "";
                    if (pInfo.EQP("Main").DummyPLC)
                    {
                        foreach (string strEQPPID in pInfo.Unit(0).SubUnit(0).EQPPPID())
                        {
                            arrData[Convert.ToInt32(strEQPPID) - 1] = 1;
                        }

                        for (int dintLoop = 16; dintLoop > 0; dintLoop--)
                        {
                            strData += arrData[dintLoop - 1].ToString();
                        }

                        strData = CommonAct.FunTypeConversion.funBinConvert(strData, EnuEQP.StringType.Hex);
                        m_pEqpAct.funWordWrite("W2A00", strData, EnuEQP.PLCRWType.Hex_Data);
                    }

                    pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S7F107PPIDCreatDeleteAndPPBodyChangedReport, "1", "1", "", dstrEQPPPID);
                    break;
                }

                //최종 수정된 날짜 Ini에 변경
                FunINIMethod.subINIWriteValue("ETCInfo", "RECIPELastModified", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), pInfo.All.SystemINIFilePath);
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 설비에서 CIM으로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : strCompBit
        /// parameters[1] : dstrACTVal
        /// parameters[2] : dintActFrom
        /// parameters[3] : dstrACTFromSub
        /// parameters[4] : intBitVal
        /// parameters[5] : Special Parameter
        /// </remarks>
        public void funProcessEQPEvent(string[] parameters)
        {
            string strCompBit = parameters[0];

            StringBuilder dstrLog        = new StringBuilder();
            string        dstrEQPPPID    = "";
            int           dintPPIDType   = 0;
            string        dstrTemp       = "";
            string        strWordAddress = "";

            try
            {
                //m_pEqpAct.subWordReadSave("W2040", 10, EnuEQP.PLCRWType.ASCII_Data);    //HOST PPID
                dstrEQPPPID  = m_pEqpAct.funWordRead("W2540", 1, EnuEQP.PLCRWType.Int_Data);
                dintPPIDType = 1;
                #region 수정 전
                //pInfo.Unit(0).SubUnit(0).RemoveEQPPPID(dstrEQPPPID);
                //strWordAddress = "W254C";
                //if (pInfo.Unit(0).SubUnit(0).AddEQPPPID(dstrEQPPPID) == true)
                //{
                //    for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount; dintLoop++)
                //    {
                //        //EQPPPID에 Body 저장
                //        if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop) == true)
                //        {
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                //            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;
                //            if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length == 2)
                //            {
                //                dstrTemp = FunStringH.funPoint(m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.Int_Data), pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                //                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                //            }
                //            else
                //            {
                //                dstrTemp = m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.ASCII_Data);
                //                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                //            }
                //            strWordAddress = CommonAct.FunTypeConversion.funAddressAdd(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);
                //        }
                //    }
                //}
                # endregion
                #region 수정 후
                int    dintReadcount  = (pInfo.Unit(0).SubUnit(0).PPIDBodyCount - 5) * 2;
                string dstrReadData   = "";
                int    dintLength     = 0;
                string strValue       = "";
                int    dintStartIndex = 0;
                strWordAddress = "W254C";
                if (pInfo.Unit(0).SubUnit(0).AddEQPPPID(dstrEQPPPID) == true)
                {
                    //if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBodyCount == 0)
                    //{
                    //[2015/04/20] PPID Body 값 Block으로 한번에(Add by HS)
                    dstrReadData = m_pEqpAct.funWordRead("W254C", dintReadcount, EnuEQP.PLCRWType.Hex_Data, false).Trim();
                    #region EQPPPID에 Body 저장
                    for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount - 5; dintLoop++)
                    {
                        if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop) == true)
                        {
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range    = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode  = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                            dintLength = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length * 4;       //Length에 맞게 자를 문자열 개수를 가져온다.
                            dstrTemp   = dstrReadData.Substring(dintStartIndex, dintLength);

                            if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length > 1)
                            {
                                string dstrTemp1 = dstrTemp.Substring(0, 4);
                                string dstrTemp2 = dstrTemp.Substring(4, 4);
                                dstrTemp = dstrTemp2 + dstrTemp1;

                                strValue = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.Decimal);
                                dstrTemp = FunStringH.funPoint(strValue, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                            }
                            else
                            {
                                strValue = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.ASCString);
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = strValue;
                            }

                            dintStartIndex += dintLength;

                            #region 변경전 [2015.04.20] Modify by HS
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                            //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                            //if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length == 2)
                            //{
                            //    dstrTemp = FunStringH.funPoint(m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.Int_Data), pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                            //    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                            //}
                            //else
                            //{
                            //    dstrTemp = m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.ASCII_Data);
                            //    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                            //}
                            //strWordAddress = CommonAct.FunTypeConversion.funAddressAdd(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);
                            #endregion
                        }
                    }
                    #endregion

                    strWordAddress = CommonAct.FunTypeConversion.funAddressAdd(strWordAddress, dintReadcount);

                    dstrReadData   = m_pEqpAct.funWordRead(strWordAddress, 80, EnuEQP.PLCRWType.ASCII_Data, false);
                    dintStartIndex = 0;
                    #region EQPPPID에 Film Code 저장
                    for (int dintLoop = 251; dintLoop <= 255; dintLoop++)
                    {
                        if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop) == true)
                        {
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range    = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode  = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                            dintLength = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length * 2;       //Length에 맞게 자를 문자열 개수를 가져온다.
                            dstrTemp   = dstrReadData.Substring(dintStartIndex, dintLength);


                            pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp.Trim();
                        }

                        dintStartIndex += dintLength;
                    }
                    #endregion
                    //}
                }
                #endregion

                //PLC Req에 대한 CIM의 Confirm Bit를 준다.
                m_pEqpAct.subSetConfirmBit(strCompBit);

                switch (dintPPIDType)
                {
                case 1:             //EQP PPID
                {
                    pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S7F107PPIDCreatDeleteAndPPBodyChangedReport, "3", "1", "", dstrEQPPPID);

                    ArrayList           arrCon = new ArrayList();
                    InfoAct.clsHOSTPPID CurrentPPID;
                    foreach (string strPPID in pInfo.Unit(0).SubUnit(0).HOSTPPID())
                    {
                        CurrentPPID = pInfo.Unit(0).SubUnit(0).HOSTPPID(strPPID);
                        if (CurrentPPID.EQPPPID == dstrEQPPPID)
                        {
                            arrCon.Add(strPPID);
                        }
                    }

                    string dstrSQL = "";
                    for (int dintLoop = 0; dintLoop < arrCon.Count; dintLoop++)
                    {
                        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S7F107PPIDCreatDeleteAndPPBodyChangedReport, "3", "2", arrCon[dintLoop].ToString(), dstrEQPPPID);

                        //pInfo.Unit(0).SubUnit(0).RemoveHOSTPPID(arrCon[dintLoop].ToString());

                        dstrSQL = string.Format("Update `tbHOSTPPID` set EQPPPID='{0}', DTime='{1}' Where HOSTPPID='{2}';", dstrEQPPPID, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), arrCon[dintLoop].ToString());
                        DBAct.clsDBAct.funExecuteQuery(dstrSQL);
                    }
                }
                break;
                }

                //최종 수정된 날짜 Ini에 변경
                FunINIMethod.subINIWriteValue("ETCInfo", "RECIPELastModified", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), pInfo.All.SystemINIFilePath);
            }
Exemplo n.º 8
0
        /// <summary>
        /// Glass APD를 읽어서 파일/구조체에 저장
        /// </summary>
        /// <param name="strLOTID"></param>
        /// <param name="intSlotID"></param>
        private void subGLSAPDRead(string strGLSID, int intSlotID)
        {
            string dstrWriteData   = "";
            string dstrTemp        = "";
            string dstrWordAddress = "W2780";
            string dstrValue       = "";
            string dstrDateTime    = "";
            string dstrReadData    = "";
            int    dintLength      = 0;
            int    dintStartIndex  = 0;


            try
            {
                //LOT이 존재하지 않거나 SlotID가 0이면 에러 로그를 출력하고 빠져나간다.
                if (pInfo.GLSID(strGLSID) == null || intSlotID == 0)
                {
                    pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "subGLSAPDRead: strGlassID:" + strGLSID + ", intSlotID:" + intSlotID.ToString());
                    return;
                }

                ////기본 Data를 구성한다.(6개)
                //dstrTemp = strGLSID;                                                           //LOTID
                //pInfo.LOTID(strLOTID).Slot(intSlotID).GLSAPD(1).Value = dstrTemp;

                //dstrWriteData = dstrWriteData + dstrTemp + ",";                                 //파일로 쓰기 위해 결합

                //dstrTemp = pInfo.LOTID(strLOTID).Slot(intSlotID).HOSTPPID;                    //PPID
                //pInfo.LOTID(strLOTID).Slot(intSlotID).GLSAPD(2).Value = dstrTemp;
                //dstrWriteData = dstrWriteData + dstrTemp + ",";                                 //파일로 쓰기 위해 결합

                //dstrTemp = pInfo.LOTID(strLOTID).Slot(intSlotID).H_PANELID;               //H_PANELID
                //pInfo.LOTID(strLOTID).Slot(intSlotID).GLSAPD(3).Value = dstrTemp;
                //dstrWriteData = dstrWriteData + dstrTemp + ",";                                 //파일로 쓰기 위해 결합

                //dstrTemp = FunStringH.funMakeLengthStringFirst(intSlotID.ToString(), 2);       //SLOTNO
                //pInfo.LOTID(strLOTID).Slot(intSlotID).GLSAPD(4).Value = dstrTemp;
                //dstrWriteData = dstrWriteData + dstrTemp + ",";                                 //파일로 쓰기 위해 결합

                //dstrTemp = pInfo.LOTID(strLOTID).Slot(intSlotID).STEPID;                  //STEPID
                //pInfo.LOTID(strLOTID).Slot(intSlotID).GLSAPD(5).Value = dstrTemp;
                //dstrWriteData = dstrWriteData + dstrTemp + ",";                                 //파일로 쓰기 위해 결합

                //dstrTemp = pInfo.Unit(0).SubUnit(0).EQPState;
                //pInfo.LOTID(strLOTID).Slot(intSlotID).GLSAPD(6).Value = dstrTemp;
                //dstrWriteData = dstrWriteData + dstrTemp + ",";                                 //파일로 쓰기 위해 결합

                //Word를 Block으로 한번에 읽는다.
                dstrReadData = m_pEqpAct.funWordRead(dstrWordAddress, pInfo.All.GLSAPDPLCReadLength * 4, EnuEQP.PLCRWType.Hex_Data).Trim();

                for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).GLSAPDCount; dintLoop++)
                {
                    try
                    {
                        dintLength = pInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).Length * 4;   //Length에 맞게 자를 문자열 개수를 가져온다.
                        dstrTemp   = dstrReadData.Substring(dintStartIndex, dintLength);     //문자열을 자른다.

                        //if (pInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).HaveMinusValue == false)
                        //{
                        //날짜 데이터일 경우 읽은 값을 4자리로 끊어서 구조체에 저장
                        if (pInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).Format.ToUpper() == "YY/MM/DD/HH/MM/SS")
                        {
                            dstrValue = dstrTemp;

                            for (int dintStep = 1; dintStep <= dintLength / 4; dintStep++)
                            {
                                dstrTemp = dstrValue.Substring((dintStep - 1) * 4, 4);                           //문자열을 잘라온다.
                                dstrTemp = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.Decimal); //PLC로 읽은 Hex를 10진수(Int)로 변환한다.
                                if (dintStep != 1)
                                {
                                    dstrTemp = FunStringH.funMakeLengthStringFirst(dstrTemp, 2);     //월, 일, 시, 분, 초를 2자리로 맞춘다.
                                }
                                dstrDateTime = dstrDateTime + dstrTemp + "/";
                            }
                            dstrDateTime = dstrDateTime.Substring(0, dstrDateTime.Length - 1);

                            dstrValue    = dstrDateTime;    //최종 변환한 값
                            dstrDateTime = "";              //초기화
                        }
                        else
                        {
                            //2 Word일때 처리
                            if (pInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).Length > 1)
                            {
                                if (pInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).Length == 8)
                                {
                                    string strTemp = "";

                                    for (int dintLoop2 = 0; dintLoop2 < 7; dintLoop2++)
                                    {
                                        string strTemp2 = dstrTemp.Substring(dintLoop2 * 4, 4);
                                        strTemp2 = strTemp2.Substring(2, 2) + strTemp2.Substring(0, 2);
                                        strTemp += FunTypeConversion.funHexConvert(strTemp2, EnuEQP.StringType.ASCString);
                                    }
                                    dstrTemp = strTemp;
                                    //dstrTemp = FunTypeConversion.funHexConvert(strTemp, EnuEQP.StringType.ASCString);
                                }
                                else
                                {
                                    dstrTemp = dstrTemp.Substring(4, 4) + dstrTemp.Substring(0, 4);
                                    dstrTemp = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.Decimal);
                                }

                                dstrValue = dstrTemp;           //최종 변환된 값
                            }
                            else
                            {
                                //1 Word임.
                                dstrValue = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.Decimal);      //PLC로 읽은 Hex를 10진수(Int)로 변환한다.
                            }
                        }
                        //}
                        //else
                        //{
                        //    //항목의 값에 음수값이 있는 경우 음수 값 처리
                        //    dstrValue = FunTypeConversion.funPlusMinusAPDCalc(dstrTemp);
                        //}

                        //소수점을 붙인다.
                        dstrValue = CommonAct.FunStringH.funPoint(dstrValue, pInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).Format);
                    }
                    catch
                    {
                        dstrValue = "0";
                    }
                    finally
                    {
                        pInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).Value = dstrValue;   //구조체에 저장
                        dstrWriteData = dstrWriteData + dstrValue + ",";               //파일로 쓰기 위해 결합

                        //읽을 Index 증가
                        dintStartIndex = dintStartIndex + dintLength;

                        #region LOTAPD
                        //LOT APD에 data를 저장한다.(후에 LOT APD 보고시 사용)
                        //switch (pInfo.Unit(0).SubUnit(0).LOTAPD(dintLoop).Type)
                        //{
                        //    case "DateTime":
                        //        break;

                        //    case "Other":       //Overwrite함.
                        //        pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = dstrValue;
                        //        break;

                        //    case "Boolean":     //하나라도 1인 값이 있으면 1로 설정한다.(0 혹은 1의 값 경우)
                        //        if (pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value == "1")
                        //        {
                        //        }
                        //        else
                        //        {
                        //            pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = dstrValue;
                        //        }
                        //        break;

                        //    case "Numeric":     //값을 누적한다.

                        //        dstrTemp = pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Name.Substring(pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Name.LastIndexOf("_") + 1).ToUpper();

                        //        if (dstrTemp == "MIN")
                        //        {
                        //            if (pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value == "")        //첫번째 값이 들어올때는 그 값을 Min으로 한다.
                        //            {
                        //                pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = dstrValue;
                        //            }
                        //            else
                        //            {
                        //                //기존의 값 > 새로 들어온값 ---> 새로들오온 값을 Min으로 저장
                        //                if (Convert.ToSingle(pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value) > Convert.ToSingle(dstrValue))
                        //                {
                        //                    pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = dstrValue;
                        //                }
                        //            }
                        //        }
                        //        else if (dstrTemp == "MAX")
                        //        {
                        //            if (pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value == "")        //첫번째 값이 들어올때는 그 값을 Max으로 한다.
                        //            {
                        //                pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = dstrValue;
                        //            }
                        //            else
                        //            {
                        //                //기존의 값 < 새로 들어온값 ---> 새로들오온 값을 Max으로 저장
                        //                if (Convert.ToSingle(pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value) < Convert.ToSingle(dstrValue))
                        //                {
                        //                    pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = dstrValue;
                        //                }
                        //            }
                        //        }
                        //        else if (dstrTemp == "AVG")
                        //        {
                        //            if (pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value == "") pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = "0";

                        //            //기존의 값 + 새로 들어온 값을 계속 더한다.(평균은 subLOTAPDRead()에서 한다.)
                        //            pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = Convert.ToString(Convert.ToSingle(pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value) + Convert.ToSingle(dstrValue));
                        //        }
                        //        else
                        //        {
                        //            if (pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value == "") pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = "0";

                        //            //기존의 값 + 새로 들어온 값을 계속 더한다.(평균은 subLOTAPDRead()에서 한다.)
                        //            pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = Convert.ToString(Convert.ToSingle(pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value) + Convert.ToSingle(dstrValue));
                        //        }

                        //        break;

                        //    //case "Numeric":     //값을 누적한다.
                        //    //    if (m_pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value == "") m_pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = "0";

                        //    //    m_pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value = Convert.ToString(Convert.ToSingle(m_pInfo.LOTID(strLOTID).LOTAPD(dintLoop).Value) + Convert.ToSingle(dstrValue));

                        //    //    break;
                        //}
                        #endregion
                    }
                }

                //마지막의 콤마는 제거
                dstrWriteData = dstrWriteData.Remove(dstrWriteData.Length - 1);

                //파일에 저장
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.GLSPDC, dstrWriteData);

                //HOST로 보고(S6F11, CEID=81, Process Data(GLS))
                pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F13GLSAPD, strGLSID, intSlotID, strGLSID);
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString() + ", strGLSID:" + strGLSID + ", intSlotID:" + intSlotID.ToString());
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 설비에서 CIM으로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : strCompBit
        /// parameters[1] : dstrACTVal
        /// parameters[2] : dintActFrom
        /// parameters[3] : dstrACTFromSub
        /// parameters[4] : intBitVal
        /// parameters[5] : Special Parameter
        /// </remarks>
        public void funProcessEQPEvent(string[] parameters)
        {
            string strCompBit = parameters[0];
            string strAddress = "W3100";
            int    dintCEID   = 0;

            try
            {
                int intUnitID = Convert.ToInt32(parameters[2]);
                int intPortNo = Convert.ToInt32(parameters[3]);
                int intBitVal = Convert.ToInt32(parameters[4]);
                int intACTVal = Convert.ToInt32(parameters[1]);

                strAddress = FunTypeConversion.funAddressAdd(strAddress, (intPortNo - 1) * 16);

                if (intBitVal != 1)
                {
                    return;
                }

                string strMappingData1 = "";
                string strMappingData2 = "";
                string strMappingData  = "";

                pInfo.Port(intPortNo).CSTID = m_pEqpAct.funWordRead(strAddress, 10, EnuEQP.PLCRWType.ASCII_Data).Trim();
                strAddress      = FunTypeConversion.funAddressAdd(strAddress, 10);
                strMappingData1 = m_pEqpAct.funWordRead(strAddress, 1, EnuEQP.PLCRWType.Binary_Data);
                strAddress      = FunTypeConversion.funAddressAdd(strAddress, 1);
                strMappingData2 = m_pEqpAct.funWordRead(strAddress, 1, EnuEQP.PLCRWType.Binary_Data);
                strMappingData  = strMappingData2 + strMappingData1;

                string strReversMappingData = "";
                for (int dintLoop = strMappingData.Length; dintLoop > 0; dintLoop--)
                {
                    strReversMappingData += strMappingData.Substring(dintLoop - 1, 1);
                }

                if (intACTVal != 4 && intACTVal != 5)
                {
                    pInfo.Port(intPortNo).PTST = intACTVal.ToString();
                }

                switch (intACTVal)
                {
                case 0:     //Port Load Request
                    ArrayList arrCon = new ArrayList();
                    foreach (string strLotID in pInfo.LOT())
                    {
                        if (pInfo.LOTID(strLotID).InPortID == intPortNo)
                        {
                            arrCon.Add(strLotID);
                        }
                    }

                    for (int dintLoop = 0; dintLoop < arrCon.Count; dintLoop++)
                    {
                        pInfo.RemoveLotID(arrCon[dintLoop].ToString());
                    }

                    pInfo.Port(intPortNo).PortMapping = "E".PadRight(25, 'E');
                    pInfo.Port(intPortNo).LCTime      = "";
                    dintCEID = 200;
                    pInfo.Port(intPortNo).SLOTINFO         = "E".PadLeft(25, 'E');
                    pInfo.Port(intPortNo).SLOTMAP          = "X".PadLeft(25, 'X');
                    pInfo.Port(intPortNo).S9F13MSGSendFlag = false;
                    break;

                case 1:     //Port Load Complete
                    //Pre Load 보고
                    //pInfo.Port(intPortNo).PortStatus = "";
                    pInfo.Port(intPortNo).S9F13MSGSendFlag = false;
                    pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_PortOccupationStatusChange, 201, intPortNo);

                    pInfo.Port(intPortNo).PortMapping = strReversMappingData.Substring(0, 25);

                    for (int dintLoop = 0; dintLoop < pInfo.Port(intPortNo).PortMapping.Length; dintLoop++)
                    {
                        if (pInfo.Port(intPortNo).PortMapping.Substring(dintLoop, 1) == "1")
                        {
                            pInfo.Port(intPortNo).Slot(dintLoop + 1).SLOTMAP  = "O";
                            pInfo.Port(intPortNo).Slot(dintLoop + 1).SLOTINFO = "W";
                        }
                        else
                        {
                            pInfo.Port(intPortNo).Slot(dintLoop + 1).SLOTMAP  = "X";
                            pInfo.Port(intPortNo).Slot(dintLoop + 1).SLOTINFO = "E";
                        }
                    }

                    pInfo.Port(intPortNo).LCTime = DateTime.Now.ToString("yyyyMMddHHmmss");
                    dintCEID = 202;

                    if (pInfo.All.ControlState == "0")
                    {
                        //Lot Information 창을 띄운다.
                        pInfo.subOPCall_Set(InfoAct.clsInfo.OPCall.LOTInformation, intPortNo, "", "");
                    }
                    else
                    {
                        pInfo.Port(intPortNo).bolLotInfoDownloadCheck = true;
                    }

                    break;

                case 2:     //Port Unload Requset
                    pInfo.Port(intPortNo).PortMapping = strReversMappingData.Substring(0, 25);
                    dintCEID = 203;

                    pInfo.RemoveLotID(pInfo.Port(intPortNo).LOTID);
                    break;

                case 3:     //Port Unload Complete
                    dintCEID = 204;
                    pInfo.Port(intPortNo).PortMapping = "E".PadRight(25, '0');
                    pInfo.Port(intPortNo).UCTime      = DateTime.Now.ToString("yyyyMMddHHmmss");
                    break;

                case 4:
                    //pInfo.Port(intPortNo).PTST = "4";
                    //pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_PortStatusChange, 213, intPortNo);
                    break;

                case 5:
                    //pInfo.Port(intPortNo).PTST = "5";
                    //pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_PortStatusChange, 213, intPortNo);
                    break;
                }

                if (intACTVal != 4 && intACTVal != 5)
                {
                    pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11_PortOccupationStatusChange, dintCEID, intPortNo);
                }

                //pInfo.subPortDataRecovery();
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Exemplo n.º 10
0
        private void subLotInfomationData(int intPortID, string strCSTID, string strLOTID)
        {
            string strAddress = "W9000";

            try
            {
                InfoAct.clsPort CurrentPort = pInfo.Port(intPortID);
                InfoAct.clsLOT  CurrentLot  = pInfo.LOTID(strLOTID);

                strAddress = FunTypeConversion.funAddressAdd(strAddress, 1024 * (intPortID - 1));

                pEqpAct.funWordWrite(strAddress, ("P0" + intPortID).PadRight(4, ' '), EnuEQP.PLCRWType.ASCII_Data);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 2);

                pEqpAct.funWordWrite(strAddress, strLOTID.PadRight(20, ' '), EnuEQP.PLCRWType.ASCII_Data);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 10);

                pEqpAct.funWordWrite(strAddress, strCSTID.PadRight(20, ' '), EnuEQP.PLCRWType.ASCII_Data);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 10);

                pEqpAct.funWordWrite(strAddress, CurrentLot.LOTJudge.PadRight(2, ' '), EnuEQP.PLCRWType.ASCII_Data);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                pEqpAct.funWordWrite(strAddress, CurrentLot.LSORTTYPE.PadRight(2, ' '), EnuEQP.PLCRWType.ASCII_Data);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                pEqpAct.funWordWrite(strAddress, CurrentLot.OPERID.PadRight(10, ' '), EnuEQP.PLCRWType.ASCII_Data);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 5);

                pEqpAct.funWordWrite(strAddress, CurrentLot.PRODID.PadRight(20, ' '), EnuEQP.PLCRWType.ASCII_Data);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 10);

                pEqpAct.funWordWrite(strAddress, CurrentLot.QTY.PadRight(2, ' '), EnuEQP.PLCRWType.ASCII_Data);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);
                strAddress = FunTypeConversion.funAddressAdd(strAddress, 24);

                string[] arrData = new string[25];
                for (int dintLoop = 0; dintLoop < pInfo.Port(intPortID).SlotCount; dintLoop++)
                {
                    if (string.IsNullOrEmpty(CurrentPort.Slot(dintLoop + 1).GLSID))
                    {
                        pEqpAct.funWordWrite(strAddress, "0".PadLeft(128, '0'), EnuEQP.PLCRWType.Hex_Data);
                        pEqpAct.funWordWrite(strAddress, (dintLoop + 1).ToString(), EnuEQP.PLCRWType.Int_Data);
                        strAddress = FunTypeConversion.funAddressAdd(strAddress, 32);
                    }
                    else
                    {
                        if (CurrentLot.GLSID(CurrentPort.Slot(dintLoop + 1).GLSID) == null)
                        {
                            pEqpAct.funWordWrite(strAddress, "0".PadLeft(128, '0'), EnuEQP.PLCRWType.Hex_Data);
                            pEqpAct.funWordWrite(strAddress, (dintLoop + 1).ToString(), EnuEQP.PLCRWType.Int_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 32);
                        }
                        else
                        {
                            pEqpAct.funWordWrite(strAddress, (dintLoop + 1).ToString(), EnuEQP.PLCRWType.Int_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                            pEqpAct.funWordWrite(strAddress, CurrentLot.GLSID(CurrentPort.Slot(dintLoop + 1).GLSID).GLSID.PadRight(20, ' '), EnuEQP.PLCRWType.ASCII_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 10);

                            pEqpAct.funWordWrite(strAddress, CurrentLot.GLSID(CurrentPort.Slot(dintLoop + 1).GLSID).HostPPID.PadRight(20, ' '), EnuEQP.PLCRWType.ASCII_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 10);

                            pEqpAct.funWordWrite(strAddress, CurrentLot.GLSID(CurrentPort.Slot(dintLoop + 1).GLSID).GLSJudge.PadRight(2, ' '), EnuEQP.PLCRWType.ASCII_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                            pEqpAct.funWordWrite(strAddress, CurrentLot.GLSID(CurrentPort.Slot(dintLoop + 1).GLSID).SMPLFLAG.PadRight(2, ' '), EnuEQP.PLCRWType.ASCII_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                            pEqpAct.funWordWrite(strAddress, CurrentLot.GLSID(CurrentPort.Slot(dintLoop + 1).GLSID).RWKCNT.PadRight(2, ' '), EnuEQP.PLCRWType.ASCII_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                            string strPPID = CurrentLot.GLSID(CurrentPort.Slot(dintLoop + 1).GLSID).HostPPID;
                            pEqpAct.funWordWrite(strAddress, pInfo.Unit(0).SubUnit(0).HOSTPPID(strPPID).CLEANER_EQPPPID, EnuEQP.PLCRWType.Int_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                            pEqpAct.funWordWrite(strAddress, pInfo.Unit(0).SubUnit(0).HOSTPPID(strPPID).Oven1_EQPPPID, EnuEQP.PLCRWType.Int_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                            pEqpAct.funWordWrite(strAddress, (Convert.ToSingle(pInfo.Unit(0).SubUnit(0).HOSTPPID(strPPID).Tickness) * 100).ToString(), EnuEQP.PLCRWType.Int_Data);
                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 1);

                            strAddress = FunTypeConversion.funAddressAdd(strAddress, 5);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 설비에서 CIM으로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : strCompBit
        /// parameters[1] : dstrACTVal
        /// parameters[2] : dintActFrom
        /// parameters[3] : dstrACTFromSub
        /// parameters[4] : intBitVal
        /// parameters[5] : Special Parameter
        /// </remarks>
        public void funProcessEQPEvent(string[] parameters)
        {
            string[]      dstrValue;
            string        dstrWordAddress = "W2540";
            StringBuilder dstrLog         = new StringBuilder();
            string        dstrHOSTPPID    = "";
            string        dstrEQPPPID     = "";
            int           dintPPIDType    = 0;
            string        dstrTemp        = "";
            int           dintLength      = 0;
            int           dintBodyIndex   = 3; //PPID Body Index
            string        APCType         = "";
            string        strWordAddress  = "";
            //[2015/04/20](Add by HS)
            string dstrReadData   = "";
            int    dintStartIndex = 0;
            string strValue       = "";
            int    dintReadcount  = 0;

            try
            {
                //[2015/04/20]임시add by HS)
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("actOnePPIDInfoRequest Start. Time = {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));
                dstrEQPPPID  = m_pEqpAct.funWordRead("W2540", 1, EnuEQP.PLCRWType.Int_Data);
                dintPPIDType = 1;
                //150429 고석현 수정
                //매번 읽으면 늦어지므로  EQPPPID가 존재하면 그대로 보고 EQPPPID가
                //pInfo.Unit(0).SubUnit(0).RemoveEQPPPID(dstrEQPPPID);

                dintReadcount  = (pInfo.Unit(0).SubUnit(0).PPIDBodyCount - 5) * 2;
                strWordAddress = "W254C";
                if (pInfo.Unit(0).SubUnit(0).AddEQPPPID(dstrEQPPPID) == true)
                {
                    if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBodyCount == 0)
                    {
                        //[2015/04/20] PPID Body 값 Block으로 한번에(Add by HS)
                        dstrReadData = m_pEqpAct.funWordRead("W254C", dintReadcount, EnuEQP.PLCRWType.Hex_Data, false).Trim();
                        #region EQPPPID에 Body 저장
                        for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount - 5; dintLoop++)
                        {
                            if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop) == true)
                            {
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range    = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode  = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                                dintLength = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length * 4;       //Length에 맞게 자를 문자열 개수를 가져온다.
                                dstrTemp   = dstrReadData.Substring(dintStartIndex, dintLength);

                                if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length > 1)
                                {
                                    string dstrTemp1 = dstrTemp.Substring(0, 4);
                                    string dstrTemp2 = dstrTemp.Substring(4, 4);
                                    dstrTemp = dstrTemp2 + dstrTemp1;

                                    strValue = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.Decimal);
                                    dstrTemp = FunStringH.funPoint(strValue, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                                    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                                }
                                else
                                {
                                    strValue = FunTypeConversion.funHexConvert(dstrTemp, EnuEQP.StringType.ASCString);
                                    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = strValue;
                                }

                                dintStartIndex += dintLength;

                                #region 변경전 [2015.04.20] Modify by HS
                                //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                                //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                                //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                                //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                                //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                                //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                                //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                                //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                                //if (pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length == 2)
                                //{
                                //    dstrTemp = FunStringH.funPoint(m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.Int_Data), pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                                //    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                                //}
                                //else
                                //{
                                //    dstrTemp = m_pEqpAct.funWordRead(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length, EnuEQP.PLCRWType.ASCII_Data);
                                //    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                                //}
                                //strWordAddress = CommonAct.FunTypeConversion.funAddressAdd(strWordAddress, pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length);
                                #endregion
                            }
                        }
                        #endregion

                        strWordAddress = CommonAct.FunTypeConversion.funAddressAdd(strWordAddress, dintReadcount);

                        dstrReadData   = m_pEqpAct.funWordRead(strWordAddress, 80, EnuEQP.PLCRWType.ASCII_Data, false);
                        dintStartIndex = 0;
                        #region EQPPPID에 Film Code 저장
                        for (int dintLoop = 251; dintLoop <= 255; dintLoop++)
                        {
                            if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop) == true)
                            {
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length   = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range    = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit     = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).UseMode  = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).UseMode;

                                dintLength = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length * 2;       //Length에 맞게 자를 문자열 개수를 가져온다.
                                dstrTemp   = dstrReadData.Substring(dintStartIndex, dintLength);


                                pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp.Trim();
                            }

                            dintStartIndex += dintLength;
                        }
                        #endregion
                    }
                }



                ////dstrHOSTPPID = dstrValue[0];
                //dstrEQPPPID = dstrValue[0];
                //dintPPIDType = Convert.ToInt32(dstrValue[2]);

                ////로그를 남긴다.
                //switch (dintPPIDType)
                //{
                //    case 1:
                //        dstrTemp = "EQP PPID 정보 요청(One)";
                //        break;

                //    case 2:
                //        dstrTemp = "HOST PPID 정보 요청(One)";
                //        break;

                //    default:        //여기로 들어오면 Error임.
                //        dstrTemp = "PPID 정보 요청(One)";
                //        break;
                //}

                //dstrLog.Append(FunStringH.funPaddingStringData("-", 30, '-') + "\r\n");
                //dstrLog.Append(dstrTemp + "\r\n");
                //dstrLog.Append("HOSTPPID:" + dstrHOSTPPID + ",");
                //dstrLog.Append("EQPPPID:" + dstrEQPPPID + ",");
                //dstrLog.Append("PPIDType:" + dintPPIDType.ToString() + "\r\n");
                //for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount; dintLoop++)
                //{
                //    dstrTemp = FunStringH.funPoint(dstrValue[dintBodyIndex + dintLoop - 1], pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                //    dstrLog.Append(pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name + ":" + dstrTemp + "\r\n");
                //}
                //dstrLog.Append(FunStringH.funPaddingStringData("-", 30, '-'));
                //pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, dstrLog.ToString());

                switch (dintPPIDType)
                {
                case 1:             //EQP PPID

                    //기존에 EQPPPID가 존재하면 지운다.
                    //pInfo.Unit(0).SubUnit(0).RemoveEQPPPID(dstrEQPPPID);

                    //if (pInfo.Unit(0).SubUnit(0).AddEQPPPID(dstrEQPPPID) == true)
                    //{
                    //    pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).EQPPPID = dstrEQPPPID;

                    //    for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount; dintLoop++)
                    //    {
                    //        //EQPPPID에 Body 저장
                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).AddPPIDBody(dintLoop);

                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).DESC = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).DESC;
                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Format = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format;
                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Length = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Length;
                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).ModuleID = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).ModuleID;
                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Name = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Name;
                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Range = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Range;
                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Unit = pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Unit;
                    //        dstrTemp = FunStringH.funPoint(dstrValue[dintBodyIndex + dintLoop - 1], pInfo.Unit(0).SubUnit(0).PPIDBody(dintLoop).Format);
                    //        pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBody(dintLoop).Value = dstrTemp;
                    //    }
                    //}
                    //pInfo.Unit(0).SubUnit(0).EQPPPID(dstrEQPPPID).PPIDBodyCheck = true;

                    break;

                case 2:             //HOST PPID

                    if (pInfo.Unit(0).SubUnit(0).HOSTPPID(dstrHOSTPPID) == null)
                    {
                        //기존에 HOSTPPID가 존재하지 않으면 새로 생성한다.
                        pInfo.Unit(0).SubUnit(0).AddHOSTPPID(dstrHOSTPPID);
                    }

                    pInfo.Unit(0).SubUnit(0).HOSTPPID(dstrHOSTPPID).EQPPPID  = dstrEQPPPID;
                    pInfo.Unit(0).SubUnit(0).HOSTPPID(dstrHOSTPPID).HostPPID = dstrHOSTPPID;


                    break;

                default:
                    break;
                }

                //if (pInfo.All.APCStartEQPPPIDCheck)
                //{
                //    pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.APCStart, pInfo.All.DataCheckGLSID);
                //}
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
            finally
            {
                pInfo.All.isReceivedFromHOST = false;  //초기화
                pInfo.All.PLCActionEnd       = true;   //PLC로 부터 값을 읽었음을 저장
                pInfo.All.PLCActionEnd2      = true;
                pInfo.All.APCPPIDReadFlag    = true;
                //[2015/04/20]임시add by HS)
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("actOnePPIDInfoRequest End. Time = {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 설비에서 CIM으로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : strCompBit
        /// parameters[1] : dstrACTVal
        /// parameters[2] : dintActFrom
        /// parameters[3] : dstrACTFromSub
        /// parameters[4] : intBitVal
        /// parameters[5] : Special Parameter
        /// </remarks>
        public void funProcessEQPEvent(string[] parameters)
        {
            string strCompBit = parameters[0];
            int    dintIndex  = 0;
            //int dintIndex2 = 0;
            string dstrWordAddress = "";
            string dstrECIDReport  = "";
            string dstrECSLL       = "";
            string dstrECWLL       = "";
            string dstrECDEF       = "";
            string dstrECWUL       = "";
            string dstrECSUL       = "";
            string dstrLog         = "";
            string dstrSQL         = "";

            string[] dstrValue        = null;
            int      dintECID         = 0;
            string   dstrECIDReadData = "";
            string   strData          = "";
            string   dstrECID         = "";

            try
            {
                dstrWordAddress = "W2A00";

                dstrECIDReadData = m_pEqpAct.funWordRead(dstrWordAddress, pInfo.Unit(0).SubUnit(0).ECIDCount * 7, EnuEQP.PLCRWType.Hex_Data);
                //PLC Req에 대한 CIM의 Confirm Bit를 준다.
                m_pEqpAct.subSetConfirmBit(strCompBit);

                // 디비트랜젝션... 해야지..
                if (DBAct.clsDBAct.funOleDbTransaction() == null)
                {
                    DBAct.clsDBAct.funBeginTransaction();
                }

                OleDbTransaction odbTransaction = DBAct.clsDBAct.funOleDbTransaction();


                for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).ECIDCount; dintLoop++)
                {
                    strData  = dstrECIDReadData.Substring((dintLoop - 1) * 28, 28);
                    dstrECID = strData.Substring(0, 4);
                    dintECID = Convert.ToInt32(FunTypeConversion.funHexConvert(dstrECID, EnuEQP.StringType.Decimal));  //ECID

                    //dstrECSLL = strData.Substring(4, 8); // ECSLL
                    dstrECWLL = strData.Substring(4, 8);
                    dstrECWLL = dstrECWLL.Substring(4, 4) + dstrECWLL.Substring(0, 4);
                    dstrECDEF = strData.Substring(12, 8); // ECDEF
                    dstrECDEF = dstrECDEF.Substring(4, 4) + dstrECDEF.Substring(0, 4);
                    //dstrECSUL = strData.Substring(20, 8); // ECSUL
                    dstrECWUL = strData.Substring(20, 8);
                    dstrECWUL = dstrECWUL.Substring(4, 4) + dstrECWUL.Substring(0, 4);

                    //dstrECSLL = FunTypeConversion.funDecimalConvert(dstrECSLL, EnuEQP.StringType.Hex);
                    //dstrECDEF = FunTypeConversion.funDecimalConvert(dstrECDEF, EnuEQP.StringType.Hex);
                    //dstrECSUL = FunTypeConversion.funDecimalConvert(dstrECSUL, EnuEQP.StringType.Hex);

                    dstrECWLL = FunTypeConversion.funHexConvert(dstrECWLL, EnuEQP.StringType.Decimal);
                    dstrECDEF = FunTypeConversion.funHexConvert(dstrECDEF, EnuEQP.StringType.Decimal);
                    dstrECWUL = FunTypeConversion.funHexConvert(dstrECWUL, EnuEQP.StringType.Decimal);

                    ////dstrECSLL = FunTypeConversion.funPlusMinusAPDCalc(dstrECSLL);
                    //dstrECWLL = FunTypeConversion.funPlusMinusAPDCalc(dstrECWLL);
                    //dstrECDEF = FunTypeConversion.funPlusMinusAPDCalc(dstrECDEF);
                    ////dstrECSUL = FunTypeConversion.funPlusMinusAPDCalc(dstrECSUL);
                    //dstrECWUL = FunTypeConversion.funPlusMinusAPDCalc(dstrECWUL);

                    //dstrECSLL = FunStringH.funPoint(dstrECSLL, pInfo.Unit(0).SubUnit(0).ECID(dintLoop).Format);
                    dstrECWLL = FunStringH.funPoint(dstrECWLL, pInfo.Unit(0).SubUnit(0).ECID(dintLoop).Format);
                    dstrECDEF = FunStringH.funPoint(dstrECDEF, pInfo.Unit(0).SubUnit(0).ECID(dintLoop).Format);
                    //dstrECSUL = FunStringH.funPoint(dstrECSUL, pInfo.Unit(0).SubUnit(0).ECID(dintLoop).Format);
                    dstrECWUL = FunStringH.funPoint(dstrECWUL, pInfo.Unit(0).SubUnit(0).ECID(dintLoop).Format);



                    if (pInfo.Unit(0).SubUnit(0).ECID(dintECID) != null)
                    {
                        if (pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECDEF != dstrECDEF ||
                            pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECWLL != dstrECWLL ||
                            pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECWUL != dstrECWUL)
                        // pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECSLL != dstrECSLL ||
                        //pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECSUL != dstrECSUL)
                        {
                            dstrECIDReport += dintLoop.ToString() + ";";

                            //로그 출력
                            //dstrLog = dstrLog + "ECID" + ",";
                            //dstrLog = dstrLog + DateTime.Now.ToString("yyyyMMddHHmmss") + ",";
                            //dstrLog = dstrLog + "변경" + ",";
                            //dstrLog = dstrLog + pInfo.All.UserID + ",";
                            //dstrLog = dstrLog + "ECID(" + dintLoop.ToString() + "): " + pInfo.Unit(0).SubUnit(0).ECID(dintLoop).DESC + ",";
                            //dstrLog = dstrLog + pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSLL + ",";
                            //dstrLog = dstrLog + pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECDEF + ",";
                            //dstrLog = dstrLog + pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSUL + ",";

                            //dstrLog = dstrLog + dstrECSLL + ",";
                            //dstrLog = dstrLog + dstrECWLL + ",";
                            //dstrLog = dstrLog + dstrECDEF + ",";
                            //dstrLog = dstrLog + dstrECWUL + ",";
                            //dstrLog = dstrLog + dstrECSUL;


                            dstrLog = string.Format("ECID,{0},변경,{1},ECID({2}): {3},{4} -> {5}, {6} -> {7}, {8} -> {9}",
                                                    DateTime.Now.ToString("yyyyMMddHHmmss"),
                                                    pInfo.All.UserID,
                                                    dintLoop.ToString(),
                                                    pInfo.Unit(0).SubUnit(0).ECID(dintLoop).DESC,
                                                    pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECWLL,
                                                    dstrECWLL,
                                                    pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECDEF,
                                                    dstrECDEF,
                                                    pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECWUL,
                                                    dstrECWUL
                                                    );

                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.Parameter, dstrLog); //로그 출력
                            dstrLog = "";                                                 //초기화

                            //구조체 업데이트

                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSLL = dstrECWLL;
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECWLL = dstrECWLL;
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECDEF = dstrECDEF;
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECWUL = dstrECWUL;
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSUL = dstrECWUL;

                            dstrSQL = "Update tbECID set ECSLL=" + pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSLL + ", ECWLL=" + dstrECWLL + ", ECDEF=" + dstrECDEF +
                                      ", ECWUL=" + dstrECWUL + ", ECSUL=" + pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSUL + " Where ECID=" + dintLoop.ToString();

                            if (DBAct.clsDBAct.funExecuteNonQuery(dstrSQL) == false)
                            {
                                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "DB Update Fail(subLoadECID): ECID: " + dintLoop.ToString());
                            }
                        }
                    }
                }

                if (DBAct.clsDBAct.funOleDbTransaction() != null)
                {
                    DBAct.clsDBAct.funCommitTransaction();
                }


                // 디비내용 업데이트는 한번만 하면 되지.. 이게 뭐니...
                pInfo.DeleteTable("ECID");
                dstrSQL = "SELECT * FROM tbECID order by ECID";
                DataTable dt = DBAct.clsDBAct.funSelectQuery(dstrSQL);
                pInfo.AddDataTable("ECID", dt);
                pInfo.AddViewEvent(InfoAct.clsInfo.ViewEvent.ECIDUpdate);

                if (pInfo.All.ECIDChangeBYWHO == "1" || pInfo.All.ECIDChangeBYWHO == "2")
                {
                    //HOST나 OP에서 발생한것임
                    dstrECIDReport = pInfo.All.ECIDChangeFromHost;
                    pInfo.All.ECIDChangeFromHost = "";
                    //m_pInfo.All.ECIDChangeBYWHO = "";
                }
                else
                {
                    pInfo.All.ECIDChangeBYWHO = "2";  //By Equipment
                }


                pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11RelatedEquipmentParameterEvent, 102, dstrECIDReport); //마지막 인자는 ECID임
                pInfo.All.ECIDChangeBYWHO = "";

                //최종 수정된 날짜 Ini에 변경
                FunINIMethod.subINIWriteValue("ETCInfo", "ECIDLastModified", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), pInfo.All.SystemINIFilePath);
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
                if (!DBAct.clsDBAct.funIsNullTransaction())
                {
                    DBAct.clsDBAct.funCommitTransaction();
                }
            }
        }