The majority of tachs I've seen on diesels are straight mechanical. There is a spinning flexible shaft inside the cable that runs to the gauge which turns a magnet. Another magnet connected to the needle moves an amount determined by the strength of the field generated by the first magnet which is determined by how fast it's spinning. The take off from the engine can be anywhere depending on the gauge and how it's graduated. The one on my L175 is attached to the fuel cam shaft. The one on my Honda Nighthawk (motorcycle) is driven by a gear off the crankshaft.