An easy function that writes a value to one analog output. This is a simple alternative to the very flexible IOType based method normally used by this driver.
When needed, this function automatically enables the specified analog output.
Declaration:
LJ_ERROR _stdcall eDAC ( LJ_HANDLE Handle,
long Channel,
double Voltage,
long Binary,
long Reserved1,
long Reserved2)
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
- Handle – Handle returned by OpenLabJack().
- Channel – The analog output channel to write to.
- Voltage – The voltage to write to the analog output.
- Binary – If this is nonzero (True), the value passed for Voltage should be binary. For example, pass 32768.0 in the double parameter for mid-scale output.
- Reserved (1&2) – Pass 0.
2 comments
I gather that by 'binary' you
I gather that by 'binary' you actually mean to pass an integer value as a double, right? For instance, if I want the 12-bit DAC output of Channel 1 to be at half scale, I could pass 2047.0 as Voltage, i.e.
Yes, good clarification.
Yes, good clarification. From looking at Section 5.2.5.16 I know that it is actually justified to a 16-bit value, so you want to pass 32768.0 for mid-scale.