Example #1
0
        /// <summary>
        /// CIM에서 설비로 발생하는 Event에 대한 처리
        /// </summary>
        /// <param name="parameters">Parameter Array</param>
        /// <remarks>
        /// parameters[0] : cmdName
        /// parameters[1] : 1st parameter
        /// parameters[2] : 2nd parameter
        /// parameters[3] : 3rd parameter
        /// parameters[4] : 4th parameter
        /// parameters[5] : 5th Parameter
        /// </remarks>
        public void funProcessCIMEvent(object[] parameters)
        {
            string        dstrWordAddress = "";
            StringBuilder dstrLog         = new StringBuilder();

            string[] dstrValue = null;
            int      dintIndex = 0;
            string   dstrECSLL = "";
            string   dstrECWLL = "";
            string   dstrECDEF = "";
            string   dstrECWUL = "";
            string   dstrECSUL = "";
            string   dstrSQL   = "";
            int      dintECID  = 0;

            try
            {
                dstrWordAddress = "W2A00";
                for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).ECIDCount; dintLoop++)
                {
                    if (dintLoop == 1)
                    {
                        pEqpAct.subWordReadSave(dstrWordAddress, 1, EnuEQP.PLCRWType.Int_Data);             //ECID
                    }
                    else
                    {
                        pEqpAct.subWordReadSave("", 1, EnuEQP.PLCRWType.Int_Data);                      //ECID
                    }
                    pEqpAct.subWordReadSave("", 2, EnuEQP.PLCRWType.Int_Data);                          //ECSLL
                    pEqpAct.subWordReadSave("", 2, EnuEQP.PLCRWType.Int_Data);                          //ECDEF
                    pEqpAct.subWordReadSave("", 2, EnuEQP.PLCRWType.Int_Data);                          //ECSUL
                }
                dstrValue = pEqpAct.funWordReadAction(true);

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

                OleDbTransaction odbTransaction = DBAct.clsDBAct.funOleDbTransaction();

                //변경된 ECID 값을 구조체에 저장, DB Update, HOST로 보고
                for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).ECIDCount; dintLoop++)
                {
                    dintECID = Convert.ToInt32(dstrValue[dintIndex++]);

                    if (dintLoop == dintECID)
                    {
                        dstrECSLL = dstrValue[dintIndex++];
                        dstrECDEF = dstrValue[dintIndex++];
                        dstrECSUL = dstrValue[dintIndex++];

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

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

                        dstrECSLL = FunStringH.funPoint(dstrECSLL, 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);

                        //if (pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECSLL != dstrECSLL || //pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECWLL != dstrECWLL ||
                        //pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECDEF != dstrECDEF || //pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECWUL != dstrECWUL ||
                        //pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECSUL != dstrECSUL)

                        //if (
                        //     pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECWLL != dstrECSLL ||
                        //    pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECDEF != dstrECDEF ||
                        //     pInfo.Unit(0).SubUnit(0).ECID(dintECID).ECWUL != dstrECSUL
                        //    )
                        {
                            //구조체 업데이트
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSLL = dstrECSLL;
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECWLL = dstrECSLL;
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECDEF = dstrECDEF;
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECWUL = dstrECSUL;
                            pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSUL = dstrECSUL;

                            //dstrSQL = "Update tbECID set ECWLL=" + dstrECSLL + ", ECDEF=" + dstrECDEF +
                            //           ", ECWUL=" + dstrECSUL + " Where ECID=" + dintLoop.ToString();

                            dstrSQL = "Update tbECID set ECSLL=" + pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ECSLL + ", ECWLL=" + dstrECSLL + ", ECDEF=" + dstrECDEF +
                                      ", ECWUL=" + dstrECSUL + ", 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());
                            }
                        }
                    }

                    //dintIndex += 6;
                }

                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);
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
            finally
            {
                if (!DBAct.clsDBAct.funIsNullTransaction())
                {
                    DBAct.clsDBAct.funCommitTransaction();
                }

                //HOST로 부터 S2F29가 와서 PLC로 부터 모두 읽었다고 저장, 그리고 HOST Act단에서 S2F30을 응답
                if (pInfo.All.isReceivedFromHOST == true)
                {
                    pInfo.All.isReceivedFromHOST = false;      //초기화
                    pInfo.All.PLCActionEnd       = true;       //PLC로 부터 값을 읽었음을 저장
                }
            }
        }
Example #2
0
        /// <summary>
        /// Primary Message에 대해 처리한 후 Secondary Message를 Biuld하여 Driver에 전송한다.
        /// </summary>
        /// <param name="msgTran">Primary Message의 Transaction</param>
        public void funPrimaryReceive(Transaction msgTran)
        {
            string  dstrModuleID   = "";
            int     dintECIDCount  = 0;
            int     dintECID       = 0;
            Boolean dbolLayerExist = false;
            int     dintIndex      = 0;

            try
            {
                dstrModuleID = msgTran.Primary().Item("MODULEID").Getvalue().ToString().Trim();

                //for (int dintUnit = 0; dintUnit <= pInfo.UnitCount; dintUnit++)
                //{
                if (dstrModuleID == pInfo.Unit(3).SubUnit(0).ModuleID)
                {
                    dbolLayerExist = true;
                    //break;
                }
                //}

                //ModuleID가 존재하지 않는 경우(Layer2도 비교한다.)
                if (dbolLayerExist == false)
                {
                    msgTran.Secondary().Item("MODULEID").Putvalue(dstrModuleID);
                    msgTran.Secondary().Item("ECCOUNT").Putvalue(0);

                    funSendReply(msgTran);

                    return;
                }
                dintECIDCount = Convert.ToInt32(msgTran.Primary().Item("ECIDCNT").Getvalue());
                ArrayList arrCon = new ArrayList();
                //받은 ECID중에 존재하지 않는것이 하나라도 있으면 L,0으로 보고한다.
                for (int dintLoop = 1; dintLoop <= dintECIDCount; dintLoop++)
                {
                    dintECID = Convert.ToInt32(msgTran.Primary().Item("ECID" + (dintLoop - 1)).Getvalue());
                    if (pInfo.Unit(0).SubUnit(0).ECID(dintECID) == null)
                    {
                        msgTran.Secondary().Item("MODULEID").Putvalue(dstrModuleID);
                        msgTran.Secondary().Item("ECCOUNT").Putvalue(0);

                        funSendReply(msgTran);

                        return;
                    }

                    if (arrCon.Contains(dintECID) == true)
                    {
                        msgTran.Secondary().Item("MODULEID").Putvalue(dstrModuleID);
                        msgTran.Secondary().Item("ECCOUNT").Putvalue(0);

                        funSendReply(msgTran);

                        return;
                    }

                    arrCon.Add(dintECID);
                }

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

                //ECID를 PLC에서 읽는다.
                //this.PInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "시작(subS2F29): " + DateTime.Now.ToString("yyyyMMddHHmmss") + ": " + DateTime.Now.Millisecond.ToString());
                if (pInfo.EQP("Main").DummyPLC == false)
                {
                    pInfo.All.isReceivedFromHOST = true;                            //HOST로 부터 S2F29를 받았음을 저장
                    pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.ECIDRead);   //ECID를 PLC로 부터 읽는다.
                    pHost.subWaitDuringReadFromPLC();                               //바로 위에 PLC로 준 명령이 완료될때까지 이 함수에서 대기한다.
                    pInfo.All.isReceivedFromHOST = false;                           //HOST로 부터 S2F29를 받지 않았음을 저장(초기화)
                }
                //this.PInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "종료(subS2F29): " + DateTime.Now.ToString("yyyyMMddHHmmss") + ": " + DateTime.Now.Millisecond.ToString());
                //dstrModuleID = pInfo.Unit(0).SubUnit(0).ModuleID;
                //HOST로 부터 받은 List가 L, 0이면 모든 ECID 보고
                if (dintECIDCount == 0)
                {
                    int ecidCount = pInfo.Unit(0).SubUnit(0).ECIDCount;
                    msgTran.Secondary().Item("ECCOUNT").Putvalue(ecidCount);

                    for (int dintLoop = 1; dintLoop <= ecidCount; dintLoop++)
                    {
                        //ECID 중 사용하지 않는것(Spare)는 제외하고 보고한다.
                        if (pInfo.Unit(0).SubUnit(0).ECID(dintLoop).ModuleID.Contains(dstrModuleID) == true)  //&& pInfo.Unit(0).SubUnit(0).ECID(dintLoop).Use == true)
                        {
                            InfoAct.clsECID currentECID = pInfo.Unit(0).SubUnit(0).ECID(dintIndex + 1);

                            msgTran.Secondary().Item("ECID" + dintIndex).Putvalue(currentECID.Index);
                            msgTran.Secondary().Item("ECNAME" + dintIndex).Putvalue(currentECID.Name);
                            msgTran.Secondary().Item("ECDEF" + dintIndex).Putvalue(FunStringH.funPoint(currentECID.ECDEF, currentECID.Format));
                            msgTran.Secondary().Item("ECSLL" + dintIndex).Putvalue(FunStringH.funPoint(currentECID.ECSLL, currentECID.Format));
                            msgTran.Secondary().Item("ECSUL" + dintIndex).Putvalue(FunStringH.funPoint(currentECID.ECSUL, currentECID.Format));
                            msgTran.Secondary().Item("ECWLL" + dintIndex).Putvalue(FunStringH.funPoint(currentECID.ECWLL, currentECID.Format));
                            msgTran.Secondary().Item("ECWUL" + dintIndex).Putvalue(FunStringH.funPoint(currentECID.ECWUL, currentECID.Format));

                            dintIndex = dintIndex + 1;
                        }
                    }
                }
                else
                {
                    msgTran.Secondary().Item("ECCOUNT").Putvalue(dintECIDCount);

                    if (dstrModuleID == this.pInfo.Unit(0).SubUnit(0).ModuleID)         //Layer1단 모두 보고
                    {
                        for (int dintLoop = 1; dintLoop <= dintECIDCount; dintLoop++)
                        {
                            dintECID = Convert.ToInt32(msgTran.Primary().Item("ECID" + (dintLoop - 1)).Getvalue());

                            InfoAct.clsECID currentECID = pInfo.Unit(0).SubUnit(0).ECID(dintECID);

                            msgTran.Secondary().Item("ECID" + (dintLoop - 1)).Putvalue(currentECID.Index);
                            msgTran.Secondary().Item("ECNAME" + (dintLoop - 1)).Putvalue(currentECID.Name);
                            msgTran.Secondary().Item("ECDEF" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECDEF, currentECID.Format));
                            msgTran.Secondary().Item("ECSLL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECSLL, currentECID.Format));
                            msgTran.Secondary().Item("ECSUL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECSUL, currentECID.Format));
                            msgTran.Secondary().Item("ECWLL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECWLL, currentECID.Format));
                            msgTran.Secondary().Item("ECWUL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECWUL, currentECID.Format));
                        }
                    }
                    else                                    //Layer2단 해당 되는것만 보고
                    {
                        for (int dintLoop = 1; dintLoop <= dintECIDCount; dintLoop++)
                        {
                            dintECID = Convert.ToInt32(msgTran.Primary().Item("ECID" + (dintLoop - 1)).Getvalue());

                            if (dstrModuleID != this.pInfo.Unit(0).SubUnit(0).ECID(dintECID).ModuleID)
                            {
                                if (this.pInfo.Unit(0).SubUnit(0).ECID(dintECID).ModuleID.Length > 13)
                                {
                                    if (dstrModuleID != this.pInfo.Unit(0).SubUnit(0).ECID(dintECID).ModuleID.Substring(0, 13))
                                    {
                                        dintECIDCount = 0;
                                        break;
                                    }
                                    else
                                    {
                                        InfoAct.clsECID currentECID = pInfo.Unit(0).SubUnit(0).ECID(dintECID);

                                        msgTran.Secondary().Item("ECID" + (dintLoop - 1)).Putvalue(currentECID.Index);
                                        msgTran.Secondary().Item("ECNAME" + (dintLoop - 1)).Putvalue(currentECID.Name);
                                        msgTran.Secondary().Item("ECDEF" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECDEF, currentECID.Format));
                                        msgTran.Secondary().Item("ECSLL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECSLL, currentECID.Format));
                                        msgTran.Secondary().Item("ECSUL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECSUL, currentECID.Format));
                                        msgTran.Secondary().Item("ECWLL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECWLL, currentECID.Format));
                                        msgTran.Secondary().Item("ECWUL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECWUL, currentECID.Format));
                                    }
                                }
                                else
                                {
                                    dintECIDCount = 0;
                                    break;
                                }
                            }
                            else
                            {
                                InfoAct.clsECID currentECID = pInfo.Unit(0).SubUnit(0).ECID(dintECID);

                                msgTran.Secondary().Item("ECID" + (dintLoop - 1)).Putvalue(currentECID.Index);
                                msgTran.Secondary().Item("ECNAME" + (dintLoop - 1)).Putvalue(currentECID.Name);
                                msgTran.Secondary().Item("ECDEF" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECDEF, currentECID.Format));
                                msgTran.Secondary().Item("ECSLL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECSLL, currentECID.Format));
                                msgTran.Secondary().Item("ECSUL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECSUL, currentECID.Format));
                                msgTran.Secondary().Item("ECWLL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECWLL, currentECID.Format));
                                msgTran.Secondary().Item("ECWUL" + (dintLoop - 1)).Putvalue(FunStringH.funPoint(currentECID.ECWUL, currentECID.Format));
                            }
                        }
                    }
                }


                funSendReply(msgTran);
            }
            catch (Exception error)
            {
                funSetLog(InfoAct.clsInfo.LogType.CIM, error.ToString());
                return;
            }
            finally
            {
                this.pInfo.All.isReceivedFromHOST = false;      //초기화
                this.pInfo.All.PLCActionEnd       = false;      //초기화
            }
        }
Example #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 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);
            }
Example #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];

            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());
            }
        }
        /// <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")));
            }
        }
Example #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];
            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();
                }
            }
        }