I used spike2 from Cambridge Electronic Design (CED) for that with their power1401 DAQ and you can do it almost out of the box. I have seen it done with National Instruments equipment too, it's more flexible but takes a bit more code for implementation.