I was having this problem a while ago. I would go through most of the experiment and it would eventually just black out before the end of experiment screen. When I opened the data files, it only recorded the first 40 or so trials.\
I realized that I had too many columns on some of my trials. I had to break some of my trials down across several lines to stop the problem.