Counting the number of Rotations in Absolute Encoder

I am suppose to control the position of a lead screw Stepper Motor using absolute Encoder EMS 22A.
To move the Lead Screw, required multiple rotations of the Encoder. How will i program this?

What i did was to determine the “Largest Change” to count the number of cycle that has occurred. However, with fast rotation the program was not able to detect the change.

void loop(){

unsigned long currentMillis = millis();
pos = encoder.ReadAngle();

  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;
    pos2 = encoder.ReadAngle();
int change = pos2-pos;
if (change > 200){
if (change < -200){
if(change > 1){         
if(change < -1){
if(change <= 1 && change >= -1){
Serial.print(" ");

You have not posted a complete program so it is difficult to give advice

Does the ReadAngle() method return the absolute angle of the encoder ?

Do you know how far the leadscrew moves per full rotation of the encoder ?