Skip to main content
Skip table of contents

4.4 - EDigitalIn [U12 Datasheet]

Easy function. This is a simplified version of DigitalIO that reads the state of one digital input. Also configures the requested pin to input 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.


long EDigitalIn ( long *idnum,
long demo,
long channel,
long readD,
long *state )

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

  • *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.
  • readD – If >0, a D line is read as opposed to an IO line.


  • *idnum – Returns the local ID or –1 if no LabJack is found.
  • *state – The selected line is TRUE/Set if >0. FALSE/Clear if 0.

LabJackPython Example

- python

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

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

If this problem persists, please contact our support.