It isn't clear what you mean by "the magnets come on" and "the magnets stop" ?
The printer is either
SPACING (magnets not energized and machine running open like it is trying to continuously type blanks)
or MARKING (magnets energized and machine not typing or not running open)
or TYPING characters
You have a 9797 WU electrical service unit like this one?
The wiring diagram is here -
The outside signal loop runs through the polar relay - the loop is polarity sensitive.
If you have the polarity wrong, the machine will run open.
Terminal 1 is negative, terminal 2 is positive
ON SOME MACHINES (as penciled in on that wiring diagram) terminal 2 was grounded to the chassis - this is a bad practice!
Unhook whatever wire is grounding your loop, because your signal loop might already have negative grounded.
This drove me crazy and shocked me until i figured it out.....
Good luck!