look at the engine control unit behind the engine, it has a bunch of lights on it.
corresponding to different faults, none of the bottom four should be lit if things are OK
This sounds like 3 things maybe - Clogged fuel filter, broken throttle selonoid(this is right on the front, it pulls back when engine is starting and remains back while running), or bad alternator.
The alternator should have a fault light on the control box, when the alts go bad, it sends bad voltage out to the ecu which then turns off the engine.
If none of that makes sense to you, go to a carrier dealer.