Yanmar is a large manufacturer and supplier of marine and industrial diesel engines. Yanmar marine engines have alternators fitted to enable the battery to get charged and to run electrical equipment on board the vessel. Yanmar as a company don't actually manufacture alternators, but there is a wide range of alternators suitable for wiring to your Yanmar engine. Most alternators, whether for marine vessels or cars, have two or three clearly labelled wiring connections, making this a moderately easy task.
Make sure your Yanmar engine is cool and the electrics turned off before attempting to wire the alternator. You'll need to touch parts of the engine.
Check the rear of the alternator attached to your Yanmar engine to find how many terminals it has and their labelling. It has two or three terminals; one labelled "B", Batt" or "S", another labelled "Ign" or "Field" and, if it has a third, "Gnd", or "T." The first connects to the wire that goes to the battery and starter motor, the second to the ignition and warning lights while the third, if applicable, is the ground wire terminal. If it doesn't have a third terminal it means the alternator is grounded directly to the Yanmar engine block.
Locate the two or three cables. One is red and has an eyelet or plastic connector plug on the end. The second is a thinner cable and varies in colour, but is usually blue, brown or green/yellow stripped and has a small plastic connector plug on the end. If there's a third, it is coloured black and has an eyelet or plastic connector plug on the end.
Connect the red cable to the terminal labelled "B", "Batt" or "S." Either insert the plastic plug in the socket, or if it has an eyelet remove the nut from the terminal pole on the alternator using a wrench. Slide the eyelet over the terminal pole and replace the nut then tighten it.
Connect the thin coloured wire to the terminal labelled "Ign" or "Field." Simply insert the small plug into the socket until you hear it click in place.
Connect the black cable, if you have one to the terminal labelled "Gnd" or "T." Insert the plug into the socket or use a wrench to remove the nut. Slide the eyelet over the terminal pole then replace the nut and tighten.
Things you need