Skip to main content
Skip table of contents

4.11 - AOUpdate [U12 Datasheet]

Sets the voltages of the analog outputs. Also controls/reads all 20 digital I/O and the counter.

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

If either passed voltage is less than zero, the DLL uses the last set voltage. This provides a way to update 1 output without changing the other. Note that when the DLL is first loaded, it does not know if the analog outputs have been set, and assumes they are both the default of 0.0 volts. Similarly, there are situations where the LabJack could reset without the knowledge of the DLL, and thus the DLL could think the analog outputs are set to a non-zero voltage when in fact they have been reinitialized to 0.0 volts.

Declaration:

long AOUpdate ( long *idnum,
long demo,
long trisD,
long trisIO,
long *stateD,
long *stateIO,
long updateDigital,
long resetCounter,
unsigned long *count,
float analogOut0,
float analogOut1)

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.
  • trisD – Directions for D0-D15. 0=Input, 1=Output.
  • trisIO – Directions for IO0-IO3. 0=Input, 1=Output.
  • *stateD – Output states for D0-D15.
  • *stateIO – Output states for IO0-IO3.
  • updateDigital – If >0, tris and state values will be written. Otherwise, just a read is performed.
  • resetCounter – If >0, the counter is reset to zero after being read.
  • analogOut0 – Voltage from 0.0 to 5.0 for AO0.
  • analogOut1 – Voltage from 0.0 to 5.0 for AO1.

Outputs:

  • *idnum – Returns the local ID or –1 if no LabJack is found.
  • *stateD – States of D0-D15.
  • *stateIO – States of IO0-IO3.
  • *count – Current value of the 32-bit counter (CNT). This value is read before the counter is reset.

ActiveX Function Differences:
The counter read is returned as a double precision float, instead of an unsigned long.

Declaration (ActiveX):

long AOUpdateX ( long FAR* idnum,
long demo,
long trisD,
long trisIO,
long FAR* stateD,
long FAR* stateIO,
long updateDigital,
long resetCounter,
double FAR* count,
float analogOut0,
float analogOut1)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.