Hello and welcome to JustAnswer!
Any time the check engine light comes on it will set a code, that's what turns the light on. The only way for the codes to go away is to clear them with a scan tool or code reader, disconnect the battery, or disconnect the engine controller connectors. I'm thinking there has to be a code set in there, or you've got multiple problems happening at the same time. How did you check for codes?
Ok. Your truck has a unique controller set up. The key cycle method will let you read codes from the engine controller on a gas truck, but not Cummins. The Cummins trucks had two controllers. They had the Chrysler JTEC controller that controlled trans, a/c, cruise control, and charging functions. This is the same kind of controller as the gas trucks had. The engine itself is controlled by the Cummins engine controller, mounted on the left side of the engine block. This only communicates with the JTEC, and the JTEC with the rest of the modules on the truck. Cycling the key won't let you read codes stored in the Cummins controller on these. For working here on JA, I really wish you could read them this way.
The only way to get the codes that are turning your engine light on is with a code reader or professional scan tool. Almost all parts stores will check codes for free with a code reader now. If you could run by a parts store and have them read codes and let me know what they find I'll be able to tell you what to do to fix it.
The two problems may very well go together. I'll be here all weekend, just let me know what you find out!