I'm using Psychtoolbox for Matlab for presenting visual stimuli. I need to change the visual stimuli according to a serial trigger received from another computer. The serial input is provided by the Signal (CED) software installed in the other PC. Since this study involves non invasive stimulation (TMS) of Brain, timing of visual stimulus is very important. I'm pretty new to Psychtoolbox and I have read about 'KbName' feature of the Psychtoolbox which receives key presses of the subject and changes the visual stimulus according to the key press. I'm looking for a similar kind of solution. If anyone had faced a similar situation in Psychtoolbox please help me out.