User Manual

long demo,
long trisD,
long trisIO,
long FAR* stateD,
long FAR* stateIO,
long updateDigital,
long resetCounter,
double FAR* count,
float analogOut0,
float analogOut1)
4.12 BitsToVolts
Converts a 12-bit (0-4095) binary value into a LabJack voltage.
Volts=((2*Bits*Vmax/4096)-Vmax)/Gain where Vmax=10 for SE, 20 for Diff.
Declaration:
long BitsToVolts ( long chnum,
long chgain,
long bits,
float *volts )
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
chnum – Channel index. 0-7=SE, 8-11=Diff.
chgain – Gain index. 0=1, 1=2, …, 7=20.
bits – Binary value from 0-4095.
Outputs:
*volts – Voltage.
4.13 VoltsToBits
Converts a voltage to it's 12-bit (0-4095) binary representation.
Bits=(4096*((Volts*Gain)+Vmax))/(2*Vmax) where Vmax=10 for SE, 20 for Diff.
Declaration:
long VoltsToBits ( long chnum,
long chgain,
float volts,
long *bits )
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
chnum – Channel index. 0-7=SE, 8-11=Diff.
chgain – Gain index. 0=1, 1=2, …, 7=20.
volts – Voltage.
Outputs:
*bits – Binary value from 0-4095.