Use a VAR to store the generator speed for the previous time step.
The simulation time at each time step is found in variabel TIME.
Also, remember that the model is called twice at the same time step when a pause is made in the simulation. Read Model Writing in POM.