float IPIZ.GetCurPos() { float fCurPos = 0f; string sErrMsg = string.Empty; StringBuilder sErrorMessage = new StringBuilder(1024); int iError; double[] dPos = new double[3]; // call the command to querry the current POSition of axes. if (PI_GCS.qPOS(m_iControllerId, m_sAxisName, dPos) == 0) { iError = PI_GCS.GetError(m_iControllerId); PI_GCS.TranslateError(iError, sErrorMessage, sErrorMessage.Capacity); sErrMsg = "ERROR From Pos?" + iError.ToString() + ": " + sErrorMessage.ToString(); } fCurPos = (float)dPos[0]; return(fCurPos); }