There are three types of tachs on a diesel. Magnetic, Alternator or a gear drive generator.
Yanmars drive the tach from a magnetic pick up on the bell housing.
So blanket statements don't work, because there are a lot of Yanmars out there.
Now the good news. Both the magnetic and alternator driven have wires that attach to either the alternator or the magnetic sensor. Both commonly have the same problem. The vibration of the engine may cause the wire to be loose in the clip or the clip it self may be lose on the spade it slides on to. The clip or spade may also be oily or dirty. So check the wire for a good connection and clean up the contact.
Some alternators will not show a charge until the rpms raise the voltage high enough. But I do not think that affects the tach. The diesel alternator tachometer is hooked up the AC tap of the alternator which is before the regulator. This connection can be marked as: AC, AUX, S, R, TACH, or nothing at all.
On the back of the tach here are a few voltages that may be useful. The voltage between the B+ and the Grd. terminals on the back of the tach should be 12V-14VDC. The voltage between the Sig and Grd. should be 2 VDC. If no 12V then find and fix the feed or trace the fuse. If no 2V that means it isn't getting up to the tach from the alt or the alt isn't producing the 2V. That should be easy to check.
Be careful around a running engine while checking the alternator out put.
Hope this helps.