> > | Direct Access to API
The LogicPD control software GUI is tedious to use for repeated experiments, and cannot be scripted. Defining a pattern sequence requires that you click the "add" button, navigate to a file (the file choose defaults to only displaying BMP images), select and add it, optionally choose a threshold value, and click OK. Then it takes a few seconds to convert the file to the native DBI format. For a sequence of hundreds of patterns, this can take a very long time, and making changes to the patterns will be tedious and error-prone. Fortunately, the DBI format is very simple and can be reverse engineered. Even more fortunately, all the important bits are implemented in a DLL file (the control software simply calls this) and one of those DLL functions can execute a batch file (text file) containing commands that map directly onto DLL functions. It's very easy to call these functions from Python. See the attached script for an example of how to generate the DBI files and display them in sequence. There are some tricky aspects to this (particularly dealing with triggers), described in more detail in the script comments. To run the script, make sure that PortabilityLayer.dll and DlpCommDLL.dll (from the SDK) are in the same directory.
-- BradAtcheson - 20 Sep 2011 |