I just google the piper external plug and got some interesting results,
No, you can't charge the battery via the external plug, the master switch must he on for external power to make it to the battery.
So yes, if you are testing out new avionics (the master is going to be on), it should work.
Here is an interesting link about it.
https://piperowner.org/talk/discussion/154730/external-power
ps, I own a PA-28 140.