Skip to main content
Skip table of contents

4.5 - EDigitalOut [U12 Datasheet]

Easy function. This is a simplified version of DigitalIO that sets/clears the state of one digital output. Also configures the requested pin to output and leaves it that way.

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

Note that this is a simplified version of the lower level function DigitalIO, which operates on all 20 digital lines. The DLL (ljackuw) attempts to keep track of the current direction and output state of all lines, so that this easy function can operate on a single line without changing the others. When the DLL is first loaded, though, it does not know the direction and state of the lines and assumes all directions are input and output states are low.

Declaration:

long EDigitalOut ( long *idnum,
long demo,
long channel,
long writeD,
long state )

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 – Line to read. 0-3 for IO or 0-15 for D.
  • writeD – If >0, a D line is written as opposed to an IO line.
  • state – If >0, the line is set, otherwise the line is cleared.

Outputs:

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

LabJackPython Example

- python

import u12
d = u12.U12()
d.eDigitalOut(channel=0, state=1, writeD=0)
#{'idnum': 12}
JavaScript errors detected

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

If this problem persists, please contact our support.