void DTFUN::InitBoard( const char *board_name, bool new_outputclockonusercounter ) { UINT uiElement; UINT uiBits; outputclockonusercounter=new_outputclockonusercounter; SetBoardName(board_name); lpszName= BoardName; // "BCI_IN"; lphDev = NULL; uiElement= 0; // initialize this board status= olDaInitialize( lpszName, &lphDev ); // get a handle to the A/D subsystem status= olDaGetDASS( lphDev, OLSS_AD, uiElement, &lphDass) ; // do we want to output the sample clock onto the user counter pin? // (this user counter pin is used as an A/D sample clock input for this board // and can also be used to synchronize boards if (outputclockonusercounter) status= olDaGetDASS(lphDev, OLSS_CT, 0, &lphDassCT); uiDataFlow= OL_DF_CONTINUOUS; status= olDaSetDataFlow( lphDass, uiDataFlow ); iMsg= status; status= olDaGetResolution( lphDass, (LPUINT)&uiBits ); ADSize= (int)uiBits; }
BOOL CALLBACK GetDriver(LPSTR lpszName, LPSTR lpszEntry, LPARAM lParam) { // Board LPBOARD lpboard = (LPBOARD)(LPVOID)lParam; // lstrcpynW(lpboard->name, lpszName, MAX_BOARD_NAME_LENGTH-1); // lstrcpynW(lpboard->entry, lpszEntry, MAX_BOARD_NAME_LENGTH-1); lpboard->status = olDaInitialize(lpszName, &lpboard->hdrvr); if (lpboard->hdrvr != NULL) /* printf("\nERROR!!!\n"); if (lpboard->hdrvr == 67) printf("ERROR! OL CANNOT OPEN DRIVER\n"); else if (lpboard->hdrvr == 127) printf("ERROR! OL UNSUPPORTED SYSTEM\n");*/ return FALSE; else return TRUE; // Board2 LPBOARD2 lpboard2 = (LPBOARD2)(LPVOID)lParam; /* lstrcpyn(lpboard->name, lpszName, MAX_BOARD_NAME_LENGTH-1); lstrcpyn(lpboard->entry, lpszEntry, MAX_BOARD_NAME_LENGTH-1); lpboard->status = olDaInitialize(lpszName, &lpboard->hdrvr); if (lpboard->hdrvr != NULL) printf("\nERROR!!!\n"); if (lpboard->hdrvr == 67) printf("ERROR! OL CANNOT OPEN DRIVER\n"); else if (lpboard->hdrvr == 127) printf("ERROR! OL UNSUPPORTED SYSTEM\n"); return FALSE; else return TRUE;*/ }
BOOL OctopusLaser::OnInitDialog() { CDialog::OnInitDialog(); ECODE status = NULL; TRACE("Initializing OctopusLaser\n"); hdrvr_9812 = NULL; hdass_9812_DAC = NULL; status = olDaInitialize(PTSTR("DT9812(00)"), &hdrvr_9812 ); if (status != OLNOERROR) { TRACE("Error: %lu\n ",status); AfxMessageBox(_T("Connect to DT9812 board failed.\nHave you plugged it in and turned it on?")); } status = olDaGetDASS( hdrvr_9812, OLSS_DA, 1, &hdass_9812_DAC ); status = olDaSetDataFlow( hdass_9812_DAC, OL_DF_SINGLEVALUE ); status = olDaConfig( hdass_9812_DAC ); if( status != OLNOERROR ) { TRACE("Error: %lu\n ",status); AfxMessageBox(_T("Error at Subsystem DAC")); } return TRUE; }