No, the AFM can not set a code 51, Again, with the diag block jumpered, the key on/engine off, the AC off, tranny in park, linkage fully closed now look at the codes.
If it still flashes a code 51, then you have to adjust your TPS or something is keeping the throttle plate open and this...