It is critical that we acquire stimulus-locked digital codes so that we can bin the data according to stimulus type during analysis. This is also essential for creating event-related averages of psychophysiological data (e.g. creating ERPs from EEG data) as it gives us the precise onset time of each stimulus. Below is a description of the hardware, software, and steps necessary for sending and acquiring such codes with PsychoPy and the BioSemi ActiveTwo system.
See here for information regarding sending event codes from PsychoPy.