New LabJackPython Release

We’ve created another stable release of LabJackPython. Download it from the LabJackPython page. The development version will stay on GitHub, and an archive of all our stable downloads are also on the GitHub downloads page.

In addition to over 20 bug fixes and improvements, the latest release boasts:

1. Linux U12 support

Using the Exodriver, you may now communicate with your U12 using LabJackPython. It’s as easy as:


>>> import u12
>>> d = u12.U12()
>>> d.rawAISample() # Section 5 of the U12 User's Guide
{
  'IO3toIO0States':
    <BitField object: [ IO3 = Low (0), IO2 = Low (0),
                        IO1 = Low (0), IO0 = Low (0) ] >,
  'Channel0': 1.46484375,
  'Channel1': 1.4501953125,
  'Channel2': 1.4599609375,
  'Channel3': 1.4306640625,
  'PGAOvervoltage': False,
  'EchoValue': 0
}
>>> d.eAnalogIn(0) # eFunctions from Section 4
{'overVoltage': 0, 'idnum': 1, 'voltage': 1.435546875}
  

2. Improved error reporting

For example, the getFeedback() function now ensures that you cannot create a feedback command that is too long. The code below tries to read from 14 analog inputs from a U6 in a single feedback command. The command could be sent to the U6, but the response would have been bigger than can fit in a USB frame:


>>> commandList = [ u6.AIN24AR(i) for i in range(14) ]
>>> d.getFeedback(commandList)
LabJackPython.LabJackException: ERROR: The feedback command you are attempting to send would yield a response that is greater than 64 bytes ( 80 bytes ). Break your commands up into separate calls to getFeedback().
  

3. New/improved examples

Browse the Examples/ directory for code that controls a DCA-10, configures PWM over Modbus, and reads from a K-type thermocouple.

Related Tags: