Data acquisition and control routines