Before you started it up out of the barn, did it have a battery?

If it did, was the battery an old one, and was it dead (did you replace it)?

After changing a battery, and/or generator, and/or voltage regulator, it is often necessary to repolarize the generator (this is described in most Shop Manuals).

If the direction of flow of electrical-current is not established through polarization, when you turn off the ignition, electricity will flow in the opposite direction, draining the battery and maybe harming electrical/ignition system parts.

It looks like you have a 12v system/conversion. Does it have a generator/alternator?