labjacks (USB I/O devices)

PsychoPy® provides an interface to the labjack U3 class with a couple of minor additions.

This is accessible by:

from psychopy.hardware.labjacks import U3

Except for the additional setdata function the U3 class operates exactly as that in the U3 library that labjack provides, documented here:

http://labjack.com/support/labjackpython

Note

To use labjack devices you do need also to install the driver software described on the page above

class psychopy.hardware.labjacks.U3(debug=False, autoOpen=True, **kargs)[source]

Name: U3.__init__(debug = False, autoOpen = True, **openArgs)

Args: debug is False, True (for stdout) or a logging.Logger

autoOpen, if true, the class will try to open a U3 using openArgs **openArgs, the arguments to pass to the open call. See U3.open()

Desc: Instantiates a new U3 object. If autoOpen == True, then it will

also open a U3.

Examples: Simplest: >>> import u3 >>> d = u3.U3()

For debug output: >>> import u3 >>> d = u3.U3(debug = True)

To open a U3 with Local ID = 2: >>> import u3 >>> d = u3.U3(firstFound = False, localId = 2)

setData(byte, endian='big', address=6701)[source]

Write 1 byte of data to the U3 register address (EIO default)

Parameters:
  • byte (-) – the value to write (must be an integer 0:255)

  • endian (-) – [‘big’ or ‘small’] ignored from 1.84 onwards

  • address (-) –

    U3 register to write byte to. Both str and int constants are supported:

    • ’FIO’ == 6700

    • ’EIO’ == 6701 (default, accessed from DB15 breakout)

    • ’CIO’ == 6702 (4 bits wide (0 - 15))


Back to top