Пример #1
0
void OctopusLaser::SetIntensity( float intensity )
{
	ECODE status = NULL;
	float volts = 0;

	volts = (intensity / 100) * 1024;
	volts = min(volts, 1024);
	volts = max(0, volts);
	//convert to DAC units
	status = olDaPutSingleValue( hdass_9812_DAC, volts, 2, 0 );
	CString str;
	str.Format(_T("Volts:%f\n"), volts);
	TRACE(str);
}
Пример #2
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;

}