Ejemplo n.º 1
0
        //Assy1에 있는 모션 상태 그리드 표시를 업데이트한다.
        public void Axis_Status_Read()
        {
            uint duStatus = 0, duRetCode = 0;
            bool SignalOutput = false;

            for (int i = 0; i < 9; i++)
            {
                this.AxisStatusData[i].Clear();
                //Column 0
                this.AxisStatusData[i].Add(i.ToString("00"));

                duRetCode = CAXM.AxmSignalIsServoOn(i, ref duStatus);
                if (duRetCode == (uint)AXT_FUNC_RESULT.AXT_RT_SUCCESS)
                {
                    SignalOutput = (Convert.ToBoolean(duStatus));
                }
                //Column 1
                this.AxisStatusData[i].Add(SignalOutput);

                duRetCode = CAXM.AxmSignalReadServoAlarm(i, ref duStatus);
                if (duRetCode == (uint)AXT_FUNC_RESULT.AXT_RT_SUCCESS)
                {
                    SignalOutput = (Convert.ToBoolean(duStatus));
                }
                //Column 2
                this.AxisStatusData[i].Add(SignalOutput);

                duRetCode = CAXM.AxmStatusReadInMotion(i, ref duStatus);
                if (duRetCode == (uint)AXT_FUNC_RESULT.AXT_RT_SUCCESS)
                {
                    SignalOutput = (Convert.ToBoolean(duStatus));
                }
                //Column 3
                this.AxisStatusData[i].Add(SignalOutput);

                duRetCode = CAXM.AxmHomeReadSignal(i, ref duStatus);
                if (duRetCode == (uint)AXT_FUNC_RESULT.AXT_RT_SUCCESS)
                {
                    SignalOutput = (Convert.ToBoolean(duStatus));
                }
                //Column 4
                this.AxisStatusData[i].Add(SignalOutput);

                uint uPositiveStatus = 0, uNegativeStatus = 0;
                CAXM.AxmSignalReadLimit(i, ref uPositiveStatus, ref uNegativeStatus);
                //Column 5
                this.AxisStatusData[i].Add(uPositiveStatus);
                //Column 6
                this.AxisStatusData[i].Add(uNegativeStatus);

                double locationData = 0;
                duRetCode = CAXM.AxmStatusGetActPos(i, ref locationData);
                if (duRetCode == (uint)AXT_FUNC_RESULT.AXT_RT_SUCCESS)
                {
                    //Column 7
                    this.AxisStatusData[i].Add(locationData.ToString());
                }

                double speedData = 0;
                duRetCode = CAXM.AxmStatusReadVel(i, ref speedData);
                if (duRetCode == (uint)AXT_FUNC_RESULT.AXT_RT_SUCCESS)
                {
                    //Column 8
                    this.AxisStatusData[i].Add(speedData.ToString("0.000"));
                }
            }
        }