How to move the speedometer needle through analogWrite?

Actually earlier we were driving the speedometer through PLC. But now we want to do the same thing through Arduino.
In PLC, the following statement was driving the speedometer:

PLSY D110 K0 Y2