Example #1
0
        public int IsAxisMoving(string axes, ref string sErrMsg)
        {
            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 (PICommand.IsMoving(m_iControllerId, axes, bIsMoving) == 0)
            {
                iError = PICommand.GetError(m_iControllerId);
                PICommand.TranslateError(iError, sErrorMessage, sErrorMessage.Capacity);
                sErrMsg = "ERROR From IsMoving " + iError.ToString() + ": " + sErrorMessage.ToString();
                return(-1);
            }
            return(bIsMoving[0]);
        }