!mode and STIMCHANGE waw not working because of missing braces.  Disrupted stimulus on timing of DIO.
This version working well in LabA on old powermac.