Thanks for all your help guys.

When I push the emergency stop on the barfeeder, I do get an alarm on the CNC, whether the barfeed works or not.
Strangely, the machine worked normally this morning, so far about 1 hour (30 parts).
As the machine is working I removed the line /M98 P9999 and everything seems to work normally without it.
After this line comes
M10 Chuck open
G4 X5 Dwell
M11 Chuck close
G4 X2 Dwell
I don't know why that line is there, it appears to do nothing. All the programs in the machine have it. When I Bought the machine and barfeed (secondhand) it had some programs in it, and I just copied the first part into all my programs, without really knowing what it does.
It seems the M10 command is what activates the barfeeder.
Feel free to correct me, as I am no expert.
Barfeed will probably fail before lunch.
Click image for larger version. 

Name:	FEED.jpg 
Views:	0 
Size:	122.0 KB 
ID:	399490