macros specifiying stage motion, and code for interpreting hardware trigger signals