예제 #1
0
        int IPIZ.GetAxisStatus()
        {
            string        sErrMsg       = string.Empty;
            StringBuilder sErrorMessage = new StringBuilder(1024);
            int           iError;

            ////////////////////////////////////////
            // Read the moving state of the axes. //
            ////////////////////////////////////////
            int[] bIsMoving = new int[3];
            // if 'axes' = NULL or 'axis' is empty a general moving state of all axes ist returnd in 'bIsMoving[0]'
            // if 'bIsMoving[0]' = TRUE at least one axis of the controller ist still moving.
            // if 'bIsMoving[0]' = FALSE no axis of the contrller is moving.
            //bIsMoving[0] = 1;
            // if 'axes != NULL and 'axis' is not empty the moving state of every axis in 'axes' is returned in
            // the arry bIsMoving.
            if (PI_GCS.IsMoving(m_iControllerId, m_sAxisName, bIsMoving) == 0)
            {
                iError = PI_GCS.GetError(m_iControllerId);
                PI_GCS.TranslateError(iError, sErrorMessage, sErrorMessage.Capacity);
                sErrMsg = "ERROR From IsMoving " + iError.ToString() + ": " + sErrorMessage.ToString();
                return(-1);
            }
            return(bIsMoving[0]);
        }