Esempio n. 1
0
        //20141106 이원규 (SEM_UDP)
        private void btnSave_Click(object sender, EventArgs e)
        {
            string dstrUDPIP   = "";
            string dstrUDPPort = "";

            try
            {
                this.btnSave.Enabled = false;
                if (this.rdoEnable.Checked == true)
                {
                    try
                    {
                        if (PInfo.All.UDPRecvPort == null)
                        {
                            this.PInfo.All.UDP_IP       = IPAddress.Parse(this.tbxIP.Text);
                            this.PInfo.All.UDP_PORT     = Convert.ToInt32(this.tbxPort.Text);
                            this.PInfo.All.SEMAlarmTime = Convert.ToInt32(this.cboAlarmTime.Text.Trim());

                            dstrUDPIP   = this.PInfo.All.UDP_IP.ToString();
                            dstrUDPPort = this.PInfo.All.UDP_PORT.ToString();

                            //포트연결시도를한다.
                            this.PInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.UDPPortOpen);
                            //SEM Controller에 Start명령을 내린다.
                            this.PInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.SEMControllerStart);

                            FunINIMethod.subINIWriteValue("SEM", "UDP_PORT", dstrUDPPort, this.PInfo.All.SystemINIFilePath);
                            FunINIMethod.subINIWriteValue("SEM", "UDP_IP", dstrUDPIP, this.PInfo.All.SystemINIFilePath);
                            FunINIMethod.subINIWriteValue("SEM", "SEM_AlarmTime", this.PInfo.All.SEMAlarmTime.ToString(), this.PInfo.All.SystemINIFilePath);
                        }
                        else
                        {
                            MessageBox.Show("UDP Port가 Open되어 있습니다.");
                        }
                    }
                    catch (UnauthorizedAccessException ex)
                    {
                        //사용할수 없는 포트
                        MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK);
                        this.btnSave.Enabled = true;
                        return;
                    }
                }
                else
                {
                    //SEM Controller에 End명령을 내리고 포트를 닫는다.
                    this.PInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.SEMControllerEnd);

                    this.PInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.UDPPortClose);
                }

                this.Hide();
            }
            catch (Exception ex)
            {
                this.PInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            SerialPort spPort;
            string     dstrBaudRate = "";
            string     dstrComPort  = "";

            try
            {
                this.btnSave.Enabled = false;
                if (this.rdoEnable.Checked == true)
                {
                    try
                    {
                        //포트 오픈 테스트를 한다.======================================================
                        dstrComPort = this.cboPort.Text.Trim();
                        spPort      = new SerialPort(dstrComPort, 115200, Parity.Even, 8, StopBits.One);
                        spPort.Open();
                        if (spPort.IsOpen)
                        {
                            spPort.Close();
                        }
                        //==============================================================================

                        this.PInfo.All.CommPort     = this.cboPort.Text.Trim();
                        dstrBaudRate                = this.cboBaudRate.Text.Trim();
                        this.PInfo.All.CommSetting  = dstrBaudRate + ",e,8,1";
                        this.PInfo.All.SEMAlarmTime = Convert.ToInt32(this.cboAlarmTime.Text.Trim());

                        //포트연결시도를한다.
                        this.PInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.SerialPortOpen);
                        //SEM Controller에 Start명령을 내린다.
                        this.PInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.SEMControllerStart);

                        FunINIMethod.subINIWriteValue("SEM", "SEM_Port", dstrComPort, this.PInfo.All.SystemINIFilePath);
                        FunINIMethod.subINIWriteValue("SEM", "SEM_BaudRate", dstrBaudRate, this.PInfo.All.SystemINIFilePath);
                        FunINIMethod.subINIWriteValue("SEM", "SEM_AlarmTime", this.PInfo.All.SEMAlarmTime.ToString(), this.PInfo.All.SystemINIFilePath);
                    }
                    catch (UnauthorizedAccessException ex)
                    {
                        //사용할수 없는 포트
                        MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK);
                        this.btnSave.Enabled = true;
                    }
                }
                else
                {
                    //SEM Controller에 End명령을 내리고 포트를 닫는다.
                    this.PInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.SEMControllerEnd);
                }

                this.Hide();
            }
            catch (Exception ex)
            {
                this.PInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Esempio n. 3
0
        private void subSaveLastModified()
        {
            string dstrSection = "";
            string dstrDate    = "";

            try
            {
                dstrSection = "ALARMLastModified";
                dstrDate    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                FunINIMethod.subINIWriteValue("ETCInfo", dstrSection, dstrDate, pInfo.All.SystemINIFilePath);

                //this.lblLastModified.Text = dstrDate;
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Esempio n. 4
0
        public void Save()
        {
            try
            {
                FunINIMethod.subINIWriteValue("ETCInfo", "EQPID", this.txtEQPID.Text, pInfo.All.SystemINIFilePath);
                FunINIMethod.subINIWriteValue("ETCInfo", "MDLN", this.txtMDLN.Text, pInfo.All.SystemINIFilePath);
                //Process Data Days to Keep 관련 저장
                FunINIMethod.subINIWriteValue("ETCInfo", "KEEPDAYS", this.txtKeepDays.Text, pInfo.All.SystemINIFilePath);

                pInfo.EQP("Main").EQPID    = this.txtEQPID.Text;
                pInfo.All.MDLN             = this.txtMDLN.Text;
                pInfo.All.ProcDataKeepDays = Convert.ToInt32(txtKeepDays.Text);

                subSaveLastModified(); //최종 수정된 날짜를 Ini파일에 저장한다.

                MessageBox.Show("Data Save Success!", "Jobs Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Esempio n. 5
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 strEOIDItem = parameters[1];

            string[]   dstrValue;
            string     dstrWordAddress = "";
            string     dstrLog         = "";
            int        dintIndex       = 0;
            string     dstrSection     = "EOIDLastModified";
            int        dintReadingEOV  = 0;
            string     dstrAfterEOV    = "";
            SortedList dHT             = new SortedList();
            string     dstrSQL;

            string[] dstrData;

            try
            {
                dintIndex = pInfo.funGetEOIDItemToIndex(strEOIDItem);                     //tbEOID 테이블의 항목에 해당하는 Index 컬럼값

                switch (strEOIDItem)
                {
                //case "VCR":
                //    dstrWordAddress = "W1511";           //VCR Reading Mode
                //    break;

                case "APC":
                    dstrWordAddress = "W1512";               //Wait time for glassid key-input(At reading fail)
                    break;
                }

                m_pEqpAct.subWordReadSave(dstrWordAddress, 1, EnuEQP.PLCRWType.Int_Data);               //VCR Reading Mode

                dstrValue = m_pEqpAct.funWordReadAction(true);

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

                dintReadingEOV = Convert.ToInt32(dstrValue[0]);


                //만약 현재 EOV와 같은 값이 오면 처리를 하지 않는다.
                if (pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV == dintReadingEOV)
                {
                }
                else
                {
                    dstrAfterEOV = dstrAfterEOV + dintIndex.ToString() + ";";         //EOID 저장
                    dHT.Add(dintIndex, pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV); //변경전의 EOID Index, EOV 저장

                    //구조체 변경
                    pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV = dintReadingEOV;

                    //DB Update
                    dstrSQL = "Update tbEOID set EOV=" + dintReadingEOV + " Where Index=" + dintIndex.ToString();

                    if (DBAct.clsDBAct.funExecuteQuery(dstrSQL) == false)
                    {
                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, "DB Update Fail: EOID Index: " + dintIndex.ToString());
                    }

                    //변경된 EOV에 대해 HOST 보고
                    dstrData = dstrAfterEOV.Split(new char[] { ';' });
                    if (dstrData.Length > 1)
                    {
                        if (pInfo.All.EOIDChangeBYWHO == "1" || pInfo.All.EOIDChangeBYWHO == "2")
                        {
                            //HOST나 OP에서 발생한것임
                        }
                        else
                        {
                            pInfo.All.EOIDChangeBYWHO = "3";       //BY Equipment
                        }

                        //HOST로 EOV값 변경 보고
                        pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11RelatedEquipmentParameterEvent, 101, dstrAfterEOV); //마지막 인자는 EOID Index임

                        pInfo.All.EOIDChangeBYWHO = "";                                                                     //초기화

                        //변경 이력 로그 저장
                        foreach (DictionaryEntry de in dHT)
                        {
                            dstrLog = dstrLog + "EOID" + ",";
                            dstrLog = dstrLog + DateTime.Now.ToString("yyyyMMddHHmmss") + ",";
                            dstrLog = dstrLog + "변경" + ",";
                            dstrLog = dstrLog + pInfo.All.UserID + ",";
                            dstrLog = dstrLog + pInfo.Unit(0).SubUnit(0).EOID(Convert.ToInt32(de.Key)).DESC + ",";
                            dstrLog = dstrLog + de.Value.ToString() + ",";
                            dstrLog = dstrLog + pInfo.Unit(0).SubUnit(0).EOID(Convert.ToInt32(de.Key)).EOV;

                            pInfo.subLog_Set(InfoAct.clsInfo.LogType.Parameter, dstrLog); //로그 출력

                            dstrLog = "";                                                 //초기화
                        }
                    }


                    //System.ini 파일에 변경 날짜 갱신
                    FunINIMethod.subINIWriteValue("ETCInfo", dstrSection, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), pInfo.All.SystemINIFilePath);
                }
            }
            catch (Exception ex)
            {
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
            finally
            {
            }
        }
Esempio 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];
            string        dstrWordAddress = "";
            StringBuilder dstrLog         = new StringBuilder();
            int           dintLength      = 0;
            string        dstrTemp        = "";
            int           dintBodyIndex   = 3; //PPID Body Index


            string dstrAfterHOSTPPID = "";
            string dstrAfterEQPPPID  = "";
            string dstrBeforeEQPPPID = "";
            int    dintAfterPPIDType = 0;

            string[] dstrAfterValue;

            try
            {
                dstrWordAddress = "W2040";
                //m_pEqpAct.subWordReadSave(dstrWordAddress, 10, EnuEQP.PLCRWType.ASCII_Data);        //HOST PPID
                m_pEqpAct.subWordReadSave(dstrWordAddress, 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
                //}

                dstrAfterValue = m_pEqpAct.funWordReadAction(true);

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

                dstrAfterHOSTPPID = dstrAfterValue[0];
                dstrAfterEQPPPID  = dstrAfterValue[1];
                dintAfterPPIDType = Convert.ToInt32(dstrAfterValue[3]);

                if (pInfo.Unit(0).SubUnit(0).HOSTPPID(dstrAfterHOSTPPID) == null)
                {
                    pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("존재하지 않는 HostPPID: {0} 에 대한 Mapping 변경 보고됨.", dstrAfterHOSTPPID));
                    return;
                }

                if (pInfo.Unit(0).SubUnit(0).EQPPPID(dstrAfterEQPPPID) == null)
                {
                    pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, string.Format("HostPPID: {0} 에 존재하지 않는 EQPPPID: {1} Mapping 변경 보고됨.", dstrAfterHOSTPPID, dstrAfterEQPPPID));
                    return;
                }



                dstrBeforeEQPPPID = pInfo.Unit(0).SubUnit(0).HOSTPPID(dstrAfterHOSTPPID).EQPPPID;

                pInfo.Unit(0).SubUnit(0).HOSTPPID(dstrAfterHOSTPPID).EQPPPID = dstrAfterEQPPPID;

                //로그를 출력한다.
                dstrLog.Append(FunStringH.funPaddingStringData("-", 30, '-') + "\r\n");
                dstrLog.Append("HOST PPID Mapping 수정(After Data)" + "\r\n");
                dstrLog.Append("AfterHOSTPPID:" + dstrAfterHOSTPPID + ",");
                dstrLog.Append("AfterEQPPPID:" + dstrAfterEQPPPID + ",");
                dstrLog.Append("AfterPPIDType:" + dintAfterPPIDType.ToString() + "\r\n");

                //for (int dintLoop = 1; dintLoop <= pInfo.Unit(0).SubUnit(0).PPIDBodyCount; dintLoop++)
                //{
                //    dstrTemp = FunStringH.funPoint(dstrAfterValue[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, '-') + "\r\n");
                pInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, dstrLog.ToString());


                //HOST로 HOST Mapping 변경 보고
                //인자:변경(3), PPIDTYPE, HOSTPPID, EQPPPID
                pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S7F107PPIDCreatDeleteAndPPBodyChangedReport, "3", dintAfterPPIDType, dstrAfterHOSTPPID, dstrAfterEQPPPID);

                m_pEqpAct.subSetParameterLog("HOST PPID Mapping 수정", dstrAfterHOSTPPID, null, dstrBeforeEQPPPID, dstrAfterEQPPPID);

                //최종 수정된 날짜 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());
            }
        }
Esempio 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);
            }
Esempio n. 8
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());
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Primary Message에 대해 처리한 후 Secondary Message를 Biuld하여 Driver에 전송한다.
        /// </summary>
        /// <param name="msgTran">Primary Message의 Transaction</param>
        public void funPrimaryReceive(Transaction msgTran)
        {
            string  dstrModuleID                = "";
            int     dintEOIDTemp                = 0;;
            int     dintEOIDCount               = 0;
            int     dintEOID                    = 0;
            int     dintEOMD                    = 0;
            int     dintEOV                     = 0;
            int     dintEAC                     = 0;
            int     dintMIACK                   = 0;
            string  dstrEOIDIndex               = "";
            int     dintIndex                   = 0;
            int     dintEOMDCount               = 0;
            string  dstrSQL                     = "";
            int     dintMatchEOIDCount          = 0;            //한개라도 안 맞으면 적용안함 20130308
            Boolean dbolEQPProcessTimeOverReset = false;        //기존에 설정되어 있던 EQP Process Time Over 체크 설정을 다시 할지 여부
            Boolean dbolSuccess                 = false;
            bool    dbolEOIDExist               = true;

            try
            {
                dstrModuleID = msgTran.Primary().Item("MODULEID").Getvalue().ToString().Trim();
                //ModuleID가 존재하지 않는 경우
                if (dstrModuleID != pInfo.Unit(3).SubUnit(0).ModuleID)
                {
                    msgTran.Secondary().Item("MODULEID").Putvalue(dstrModuleID);
                    msgTran.Secondary().Item("MIACK").Putvalue(1);
                    msgTran.Secondary().Item("EOIDCOUNT").Putvalue(0);

                    funSendReply(msgTran);

                    return;
                }

                dintEOIDCount = Convert.ToInt32(msgTran.Primary().Item("EOIDCOUNT").Getvalue());

                //EOID가 6이나 17이 아닌게 하나라도 있으면 NACK보고 후 리턴
                //2011.01.13    송 은선
                for (int dintLoop = 1; dintLoop <= dintEOIDCount; dintLoop++)
                {
                    dintEOIDTemp = Convert.ToInt32(msgTran.Primary().Item("EOID" + (dintLoop - 1)).Getvalue());

                    if (pInfo.funGetEOIDToIndex(dintEOIDTemp) == 0)
                    {
                        dbolEOIDExist = false;
                        //msgTran.Secondary().Item("MODULEID").Putvalue(dstrModuleID);
                        //msgTran.Secondary().Item("MIACK").Putvalue(2);
                        //msgTran.Secondary().Item("EOIDCOUNT").Putvalue(0);

                        //funSendReply(msgTran);
                        //return;
                    }
                }

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

                //받은 EOID중에 존재하지 않는것이 하나라도 있으면 NAK으로 보고하고 모두 적용하지 않는다.
                for (int dintLoop = 1; dintLoop <= dintEOIDCount; dintLoop++)
                {
                    dintEOMDCount = Convert.ToInt32(msgTran.Primary().Item("EOMDCOUNT" + (dintLoop - 1)).Getvalue());

                    for (int dintLoop2 = 1; dintLoop2 <= dintEOMDCount; dintLoop2++)
                    {
                        dintEOID = Convert.ToInt32(msgTran.Primary().Item("EOID" + (dintLoop - 1)).Getvalue());
                        dintEOMD = Convert.ToInt32(msgTran.Primary().Item("EOMD" + (dintLoop - 1) + (dintLoop2 - 1)).Getvalue());
                        dintEOV  = Convert.ToInt32(msgTran.Primary().Item("EOV" + (dintLoop - 1) + (dintLoop2 - 1)).Getvalue());

                        //EOMD, EOMD값으로 Index를 찾는다.(Index가 Key값이기 떄문)
                        dintIndex = pInfo.funGetEOIDEOMDToIndex(dintEOID, dintEOMD);
                        if (pInfo.Unit(0).SubUnit(0).EOID(dintIndex) != null)   //존재하는 EOID임.
                        {
                            //EOMD 유효성 검사
                            if (dintEOMD >= pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOMDMin&& dintEOMD <= pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOMDMax)
                            {
                                if (dintEOV >= pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOVMin&& dintEOV <= pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOVMax)
                                {
                                    if (dintEOID == 8)                                                    //VCR Reading Mode는 0,1,2,3 만 값이 있다.(이외의 값이 오면 Error임.)
                                    {
                                        if (dintEOV == 0 || dintEOV == 1 || dintEOV == 2 || dintEOV == 3) //EOV값 정상
                                        {
                                            dintEAC             = 0;                                      //EOMD 정상
                                            dintMatchEOIDCount += 1;                                      //옳은 EOID 개수 누적
                                        }
                                        else
                                        {
                                            dintEAC = 3;          //3 = Denied, At least one constant out of range
                                        }
                                    }
                                    else
                                    {
                                        dintEAC             = 0;        //EOMD 정상
                                        dintMatchEOIDCount += 1;        //옳은 EOID 개수 누적
                                    }
                                }
                                else
                                {
                                    dintEAC = 3;          //3 = Denied, At least one constant out of range
                                }
                            }
                            else
                            {
                                dintEAC = 1;        //1 = Denied, At least one constant does not exist
                            }
                        }
                        else                        //존재하지 않는 EOID임.
                        {
                            dintEAC = 1;            //1 = Denied, At least one constant does not exist
                        }

                        msgTran.Secondary().Item("EOID" + (dintLoop - 1)).Putvalue(dintEOID);
                        msgTran.Secondary().Item("EOMDCOUNT" + (dintLoop - 1)).Putvalue(dintEOMDCount);

                        msgTran.Secondary().Item("EOMD" + (dintLoop - 1) + (dintLoop2 - 1)).Putvalue(dintEOMD);
                        msgTran.Secondary().Item("EAC" + (dintLoop - 1) + (dintLoop2 - 1)).Putvalue(dintEAC);
                    }
                }

                //if (dbolEOIDExist == false)
                //{
                //    dintMIACK = 2;  //없는 EOID를 받았다.
                //}
                //else
                {
                    dintMIACK = 0;  //정상
                }

                msgTran.Secondary().Item("MIACK").Putvalue(dintMIACK);


                //HOST로 S2F104 보고
                funSendReply(msgTran);

                //유효성 검사에서 OK이면 S6F11(CEID=101) 보고
                if (dintMatchEOIDCount == dintEOIDCount)
                {
                    pInfo.All.EOIDChangeBYWHO = "1";   //BY HOST

                    //구조체를 변경
                    for (int dintLoop = 1; dintLoop <= dintEOIDCount; dintLoop++)
                    {
                        dintEOMDCount = Convert.ToInt32(msgTran.Primary().Item("EOMDCOUNT" + (dintLoop - 1)).Getvalue());

                        for (int dintLoop2 = 1; dintLoop2 <= dintEOMDCount; dintLoop2++)
                        {
                            dintEOID = Convert.ToInt32(msgTran.Primary().Item("EOID" + (dintLoop - 1)).Getvalue());
                            dintEOMD = Convert.ToInt32(msgTran.Primary().Item("EOMD" + (dintLoop - 1) + (dintLoop2 - 1)).Getvalue());
                            dintEOV  = Convert.ToInt32(msgTran.Primary().Item("EOV" + (dintLoop - 1) + (dintLoop2 - 1)).Getvalue());

                            //EOMD, EOMD값으로 Index를 찾는다.(Index가 Key값이기 떄문)
                            dintIndex = pInfo.funGetEOIDEOMDToIndex(dintEOID, dintEOMD);

                            if (pInfo.Unit(0).SubUnit(0).EOID(dintIndex) != null)
                            {
                                if (dintEOV >= pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOVMin&& dintEOV <= pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOVMax)  // && dintEOV != this.PInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV
                                {
                                    //if (dintEOID == 8)     //VCR Reading Mode는 0,1,2,3 만 값이 있다.(이외의 값이 오면 Error임.)
                                    //{
                                    //    if (dintEOV == 0 || dintEOV == 1 || dintEOV == 2 || dintEOV == 3)       //EOV값 정상
                                    //    {
                                    //        dbolSuccess = true;
                                    //    }
                                    //    else
                                    //    {
                                    //        dbolSuccess = false;
                                    //    }
                                    //}
                                    //else
                                    {
                                        dbolSuccess = true;
                                    }

                                    //True이면 업데이트 한다.  이때 EOV의 이전값과 바꾸는 값이 동일하면 넘어간다(S6F11 보고를 안하기 위해서임) - 같은값이 와도 보고해야됨(입고전검수) 20101208 KJK
                                    if (dbolSuccess == true)    // && dintEOV != this.PInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV
                                    {
                                        #region "LOG 출력"
                                        pInfo.subLog_Set(InfoAct.clsInfo.LogType.Parameter, string.Format("EOID,{0},변경,{1},{2},{3},{4}", DateTime.Now.ToString("yyyyMMddHHmmss"), pInfo.All.UserID, pInfo.Unit(0).SubUnit(0).EOID(dintIndex).DESC, pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV, dintEOV));      //로그 출력
                                        #endregion



                                        this.pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV = dintEOV;
                                        dstrEOIDIndex = dstrEOIDIndex + dintIndex.ToString() + ";";

                                        //DB Update
                                        dstrSQL = "Update tbEOID set EOV=" + dintEOV.ToString() + " Where Index=" + dintIndex.ToString();

                                        if (DBAct.clsDBAct.funExecuteQuery(dstrSQL) == false)
                                        {
                                            funSetLog(InfoAct.clsInfo.LogType.CIM, "DB Update Fail: EOID Index: " + dintIndex.ToString());
                                        }

                                        pInfo.DeleteTable("EOID");
                                        dstrSQL = "SELECT * FROM tbEOID order by Index";
                                        DataTable dt = DBAct.clsDBAct.funSelectQuery(dstrSQL);
                                        pInfo.AddDataTable("EOID", dt);
                                        pInfo.AddViewEvent(InfoAct.clsInfo.ViewEvent.EOIDUpdate);


                                        switch (this.pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOID)
                                        {
                                        case 17:                           //MCC Reporting Mode (Decision to transfer MCC log file to File Server)
                                            if (this.pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV == 1)
                                            {
                                                FunINIMethod.subINIWriteValue("MCC", "MCCFileUploadUse", "True", this.pInfo.All.SystemINIFilePath);
                                                this.pInfo.All.MCC_UPLOAD = true;
                                            }
                                            else
                                            {
                                                FunINIMethod.subINIWriteValue("MCC", "MCCFileUploadUse", "False", this.pInfo.All.SystemINIFilePath);
                                                this.pInfo.All.MCC_UPLOAD = false;
                                            }
                                            break;

                                        case 19:                // SEM On/Off
                                            if (this.pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV == 1)
                                            {
                                                this.pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.UDPPortOpen);
                                                this.pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.SEMControllerStart);
                                            }
                                            else
                                            {
                                                this.pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.SEMControllerEnd);
                                                this.pInfo.subPLCCommand_Set(InfoAct.clsInfo.PLCCommand.UDPPortClose);
                                            }
                                            break;

                                        case 21:
                                            if (this.pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV == 1)
                                            {
                                                //FunINIMethod.subINIWriteValue("MCC", "MCCFileUploadUse", "True", this.pInfo.All.SystemINIFilePath);
                                                pInfo.All.APCUSE = true;
                                            }
                                            else
                                            {
                                                //FunINIMethod.subINIWriteValue("MCC", "MCCFileUploadUse", "False", this.pInfo.All.SystemINIFilePath);
                                                pInfo.All.APCUSE = false;
                                            }
                                            break;

                                        case 22:
                                            if (this.pInfo.Unit(0).SubUnit(0).EOID(dintIndex).EOV == 1)
                                            {
                                                //FunINIMethod.subINIWriteValue("MCC", "MCCFileUploadUse", "True", this.pInfo.All.SystemINIFilePath);
                                                pInfo.All.RPCUSE = true;
                                            }
                                            else
                                            {
                                                //FunINIMethod.subINIWriteValue("MCC", "MCCFileUploadUse", "False", this.pInfo.All.SystemINIFilePath);
                                                pInfo.All.RPCUSE = false;
                                            }
                                            break;

                                        default:
                                        {
                                        }
                                        break;
                                        }
                                    }

                                    dbolSuccess = false;  //초기화
                                }
                            }
                        }
                    }

                    //CEID=101, Host로 보고
                    pInfo.subSendSF_Set(InfoAct.clsInfo.SFName.S6F11RelatedEquipmentParameterEvent, 101, dstrEOIDIndex); //마지막 인자는 EOID Index임

                    pInfo.All.EOIDChangeBYWHO = "";                                                                      //초기화

                    //최종 수정된 날짜 Ini에 변경
                    FunINIMethod.subINIWriteValue("ETCInfo", "EOIDLastModified", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), pInfo.All.SystemINIFilePath);
                }

                if (dbolEQPProcessTimeOverReset == true)
                {
                    pInfo.All.EQPProcessTimeOverReset = true;
                }
            }
            catch (Exception error)
            {
                funSetLog(InfoAct.clsInfo.LogType.CIM, error.ToString());
                return;
            }
        }
Esempio n. 10
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();
                }
            }
        }