Wednesday, April 3, 2013

Labview routines for camera data acquisition and storage to MDSplus

When I started my latest project building a new imaging system at MIT, we inherited a fancy scientific imaging camera with a janky RS-170 interface, a National Instruments frame-grabber, and a bright shiny new 4-core PC running LabView. Our lab uses a FOSS data acquisition system called MDSplus to run our experiments and store data, so I needed to put a routine together to trigger the camera, gather frames during the experiment, and store them to the database. I implemented a pre-allocated ring-buffer to allow for pre-triggering frames and avoid skipping frames due to some time lag while allocating memory. There are probably lots of ways to do this sort of thing in LabView, but this was my solution to enable pre-trigger recording and the frame-skipping which occurred when using the 'grab' or 'snap' frame-grabbing methods in LabView. Integrating the MDSplus routines in LabView is way more complicated than in python, but is easy enough once you've figured it out. So if there's anyone else out there with a similar setup, here is an archive of the LabView routine I wrote to help you get going. Since MDSplus works so much more nicely with python than with LabView, I also wrote a set of routines to interrogate data stored for the camera and configure the hardware settings in the database, which you can download here if you're interested.

No comments: