Пример #1
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : PLC READ
        //설명 : G4 설비 데이터 리딩 맵 확인 후 매칭작업
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void ReadPLCDataMachineTypeProcess150()
        {
            var pDocument = CDocument.GetDocument;

            CConfig.CPLCInitializeParameter objPLCParameter = pDocument.m_objConfig.GetPLCParameter();
            short[]  pReadData      = new short[objPLCParameter.iInputCountWord];
            double[] pReadDwordData = new double[objPLCParameter.iInputCountDWord];

            short[]  pWriteData      = new short[objPLCParameter.iOutputCountWord];
            double[] pWriteDwordData = new double[objPLCParameter.iOutputCountDWord];

            // READ 영역 READ
            // DOUBLE WORD영역
            m_objPLC.HLReadWordFromPLC("PLC_MODEL_CHANGE", objPLCParameter.iInputCountWord, ref pReadData);

            // READ 영역 READ
            // LVDT 로그데이터 갯수는 50개
            m_objPLC.HLReadDoubleWordFromPLC("PLC_WEIGHT_CELL_ID_1", 50, ref pReadDwordData);
            // LEAD돌출검서 데이터 갯수는 A,B합쳐서 150개
            m_objPLC.HLReadDoubleWordFromPLC("PLC_LVDT_CELL_ID_1", 50, ref pReadDwordData);

            // WRITE 영역 READ
            // DOUBLE WORD영역
            m_objPLC.HLReadWordFromPLC("PC_VISION_ALIVE", objPLCParameter.iOutputCountWord, ref pWriteData);
        }
Пример #2
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 초기화
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public bool Initialize()
        {
            bool bReturn   = false;
            var  pDocument = CDocument.GetDocument;

            do
            {
                // 폼 초기화
                // 초기 메인 스테이지
                m_eCamera                     = CDefine.enumCamera.CAMERA_1;
                m_objSystemParameter          = pDocument.m_objConfig.GetSystemParameter();
                m_objLightControllerParameter = pDocument.m_objConfig.GetLightControllerParameter(CDefine.enumLightController.LIGHT_CONTROLLER_MAIN);
                m_objPlcParameter             = pDocument.m_objConfig.GetPLCParameter();
                m_objCameraParameter          = pDocument.m_objConfig.GetCameraParameter(( int )m_eCamera);
                m_objRecipeParameter          = pDocument.m_objConfig.GetRecipeParameter(( int )m_eCamera);
                m_dCameraResolutionDistance   = 1;
                m_dCameraResolutionPixel      = 100;
                GetCameraResolutionPixel();

                if (false == InitializeForm())
                {
                    break;
                }

                bReturn = true;
            } while(false);

            return(bReturn);
        }
Пример #3
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 폼 초기화
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public bool InitializeForm()
        {
            bool bReturn = false;

            do
            {
                var pFormCommon = CFormCommon.GetFormCommon;
                var pDocument   = CDocument.GetDocument;

                // 페이지 변수 초기화
                m_iCurrentPage = new int[( int )enumIO.IO_FINAL];
                m_iMaxPage     = new int[( int )enumIO.IO_FINAL];

                // 버튼 매칭
                SetButtonControlInitialize();

                // IO 초기화 정보를 가져온다
                m_objPLCParameter = pDocument.m_objConfig.GetPLCParameter();

                // 해당 부분은 IO 디바이스에서 전체 수를 구해와서 나눠서 구해야 함
                int   iInputIOCount  = m_objPLCParameter.strPLCInput.Count;
                int   iOutputIOCount = m_objPLCParameter.strPLCOutput.Count;
                int[] iIOCount       = { iInputIOCount, iOutputIOCount };

                for (int iLoopIO = 0; iLoopIO < ( int )enumIO.IO_FINAL; iLoopIO++)
                {
                    // 현재 페이지 설정
                    m_iCurrentPage[iLoopIO] = 0;
                    // 최대 페이지 설정
                    m_iMaxPage[iLoopIO] = (iIOCount[iLoopIO] / m_iDisplayPageIO);
                }
                // 버튼 색상 정의
                SetButtonColor();
                // 타이머 외부에서 제어
                timer.Interval = 100;
                timer.Enabled  = false;

                SetDisplayInput();
                SetDisplayOutput();
                // IO 객체
                m_objPLC = pDocument.m_objProcessMain.m_objPLC;
                bReturn  = true;
            } while(false);

            return(bReturn);
        }