void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // usage if (nrhs != 1) { mexPrintf("\nUsage: nmssPSDisconnect(<controller_handle>), where <controller_handle> is the integer number returned by nmssPSConnect."); return; } int iControllerHandle = mxGetScalar(prhs[0]); if (E7XX_IsConnected (iControllerHandle)) { // close connection E7XX_CloseConnection(iControllerHandle); double* pdRet; plhs[0] = mxCreateString(sOK); plhs[1] = mxCreateDoubleMatrix(1, 1, mxREAL); pdRet = mxGetPr(plhs[1]); *pdRet = (double) iControllerHandle; } else { // no controller connected with this handle plhs[0] = mxCreateString(sERROR); int iErrorID = E7XX_GetError(iControllerHandle); char sError[1024]; E7XX_TranslateError (iErrorID, sError, 1024); plhs[1] = mxCreateString(sError); } return; }
int CPI_E761_ZStage::Shutdown() { if (initialized_) { initialized_ = false; if (g_pXYStage == NULL || !g_pXYStage->IsInitialized()) { // Close the device E7XX_CloseConnection(g_DeviceId); } } return DEVICE_OK; }
int CPI_E761_XYStage::Shutdown() { if (initialized_) { initialized_ = false; if (g_pZStage == NULL || !g_pZStage->IsInitialized()) { MMThreadGuard guard(g_PI_ThreadLock); // Close the device E7XX_CloseConnection(g_DeviceId); } } return DEVICE_OK; }