Support and Documentation
Breadcrumbs

4.1 - EAnalogIn [U12 Datasheet]

Easy function. This is a simplified version of AISample. Reads the voltage from 1 analog input. Calling this function turns/leaves the status LED on.

Execution time for this function is 20 milliseconds or less (typically 16 milliseconds in Windows).

Declaration:

long EAnalogIn ( long *idnum,
long demo,
long channel,
long gain,
long *overVoltage,
float *voltage )

Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:

  • *idnum – Local ID, serial number, or -1 for first found.

  • demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack.

  • channel – Channel command is 0-7 for single-ended, or 8-11 for differential.

  • gain – Gain command is 0=1, 1=2, …, 7=20. This amplification is only available for differential channels.

Outputs:

  • *idnum – Returns the local ID or -1 if no LabJack is found.

  • overVoltage – If >0, an overvoltage has been detected on one of the selected analog inputs.

  • voltage – Returns the voltage reading.

LabJackPython Example

- python

import u12 d = u12.U12() d.eAnalogIn(channel=0, gain=0) #{'overVoltage': 0, 'idnum': 12, 'voltage': 1.4599609375}