Hello Fausto,
here is a small example:
VAR
Speed : REAL;
LastCounterValue : DINT;
Counter : DINT;
EncoderResolution : REAL;
IncrementsPerMin : DINT;
END_VAR
PROGRAM _INIT
EncoderResolution := 2000;
END_PROGRAM
PROGRAM _CYCLIC
IncrementsPerMin := (Counter - LastCounterValue) * 60;
IF EncoderResolution > 0 THEN
Speed := DINT_TO_REAL(IncrementsPerMin) / EncoderResolution;
ELSE
Speed := 0;
END_IF
LastCounterValue := Counter;
END_PROGRAM
Regards

