We recently added new power-up defaults functionality to UD series (U3, U6, UE9) firmware. This came in the form of two new functions: SetDefaults and ReadDefaults.
SetDefaults will write the current configuration of the LabJack to flash. If the device is power cycled, it will load this configuration right when it starts up.
Have timers setup? Their configuration is saved.
Have DAC0 set to 1.2 volts and DAC1 set to 2.1 volts? Saved.
Have every other pin on your U3 configured for digital? Stored.
Get the LabJack exactly how you want it, then call SetDefaults and you’re good to go. If you’re on Windows, you may be familiar with the “Config. IO Defaults” panel in LJControlPanel. You may have asked yourself, “How do they do that?” Now you know, SetDefaults.
Now, there are a few of us who work on Mac OS X or Linux. Before, we were SOL. Enter the latest improvement of LabJackPython. You can now call SetDefaults on any UD series device from LabJackPython. There is also support for the sister function ReadDefaults, to read back the stored values.
>>> import u3
>>> d = u3.U3()
>>> d.writeRegister( 5000, 1.2 ) # Set DAC0 to 1.2 using Modbus
>>> d.configIO( FIOAnalog = 15 ) # Set the first four FIOs to analog.
>>> d.setDefaults()
It doesn’t get much simpler than that. Just configure the device the way you want it and call setDefaults() on it.