I need some help writing a function block which I can use to record the travel distance of an axis. This should record every time the axis moves sort of like an odometer, this value will be used for preventative maintenance on the axis. ie greasing the ball screw and linear bearings.
The function has to ignore chatter on the axis when it is not moving and accomodate the homing function which overwrites the position several times.