예제 #1
0
int DTFUN::CleanUp( void )
{
    int     i, bcount, status;

    status= olDaFlushBuffers( lphDass );

    bcount= BUFNUM;

    for (i=0; i<bcount; i++)
    {
        status+= olDaGetBuffer( lphDass, &hbuf[i] );
        status+= olDmFreeBuffer( hbuf[i] );
    }

    if (outputclockonusercounter)
        status+= olDaReleaseDASS( lphDassCT );

    status+= olDaReleaseDASS( lphDass );
    return( status );
}
예제 #2
0
COctopusAOTF::~COctopusAOTF()
{	

	B.AOTF_loaded = false;

	HBUF hBuf = NULL;
	olDaAbort( hdass_9834 );
	olDaFlushBuffers( hdass_9834 ); 
	
	do {
		olDaGetBuffer( hdass_9834, &hBuf );           // get the buffer from the done queue
		if( hBuf != NULL ) olDmFreeBuffer( hBuf );    // and free it
	} while( hBuf != NULL );                          // until the done queue is empty	

	olDaReleaseDASS( hdass_9834 );					  // release the subsystem and the board
	olDaTerminate( hdrvr_9834 );
}
예제 #3
0
float AdInput(UINT channel)
{
	float volts;
	long adcvalue;
	long value;

	CHECKERROR(olDaGetSingleValue(board.hdass, &adcvalue, channel, gain));

	if (encoding != OL_ENC_BINARY) {
		value ^= 1L << (resolution - 1);
		value &= (1L << resolution) - 1;
	}

	volts = ((float)max - (float)min) / (1L << resolution) * adcvalue;// + (float)min;
	olDaReleaseDASS(board.hdass);

	return volts;
}
예제 #4
0
int DaOutput(DBL dacvalue, UINT channel)
{
	float volts;
	long value;

	volts = (float)dacvalue;

	value = (long)((1L << resolution) / ((float)max - (float)min) * (volts - (float)min));
	value = min((1L << resolution) - 1, value);

	if (encoding != OL_ENC_BINARY) {
		long sign = 1L << (resolution - 1);
		value ^= sign;
		if (value & sign) value |= 0xffffffffL << resolution;
	}

	olDaPutSingleValue(board.hdass, value, channel, gain);
	olDaReleaseDASS(board.hdass);

	return 0;

}
예제 #5
0
OctopusLaser::~OctopusLaser() 
{
	olDaReleaseDASS( hdass_9812_DAC );
	olDaTerminate( hdrvr_9812 );
	TRACE("Ending OctopusLaser\n");
}