Problems With if Statement

I have a PLC and HMI piggybacked to the Arduino and the PLC sends a “start” signal to the Arduino via digital pin 53. I have this as a conditional “if” statement so that if pin 53 is high it will run the rest of the code, if the pin is low then nothing is supposed to happen. When I upload the code I can see and hear the relays I’m using click on and off but pin 53 is low. There is no power to the pin whatsoever. I tried changing the code to if pin 53 is low then the code should run, but it still does the same thing as if the rest of the code isn’t in the conditional statement. The bracket I am using after the if statement is closed by the bracket after all of the code as well. If someone could point me in the right direction I would greatly appreciate it.

#include <AccelStepper.h>

#define motorPin1 9 // CP +  
#define motorPin2 10 // CW +  
#define motorPin3 11 // CP + 
#define motorPin4 12 // CW + 
AccelStepper DRIVER(1,motorPin1,motorPin2);
AccelStepper Calibration(1,motorPin3,motorPin4);

const int sensorPin7 = A0;
const int sensorPin8 = A1;
const int sensorPin9 = A2;

int sensorValue7 = 0;
int sensorValue8 = 0;
int sensorValue9 = 0;
float Vin = 5;
float Vout = 0;

float Rref7 = 20;
float Rref8 = 20;
float Rref9 = 30000;

float R7 = 0;
float R8 = 0;
float R9 = 0;


void setup ()
{
  Serial.begin(9600);

  DRIVER.setMaxSpeed(400);
  DRIVER.setAcceleration(250);
  DRIVER.setCurrentPosition(0);
  Calibration.setMaxSpeed(2000);
  Calibration.setAcceleration(750);
  Calibration.setCurrentPosition(0);

  pinMode(0,INPUT_PULLUP);
  pinMode(1,INPUT_PULLUP);
  pinMode(2,INPUT_PULLUP);
  pinMode(3,INPUT_PULLUP);
  pinMode(4,INPUT_PULLUP);
  pinMode(5,INPUT_PULLUP);
  
  pinMode(53, INPUT); 
  pinMode(52, INPUT);
  pinMode(51, OUTPUT); 
  pinMode(49, OUTPUT);

  
  pinMode(22, OUTPUT);
  pinMode(24, OUTPUT);
  pinMode(26, OUTPUT);
  
}
int Joint1;                                               // Represents Pad 1
int Joint2;                                               // Represents Pad 2
int Joint3;                                               // Represents Pad 3
int Joint4;                                               // Represents Pad 4
int Joint5;                                               // Represents Pad 5
int Joint6;                                               // Represents Pad 6


void loop ()
{
  if (digitalRead(53) == HIGH) {                        // Begins test utilizing signal from PLC
    DRIVER.moveTo(-1300);                                   // Displacement of the stepper motor downwards THIS IS USED TO FLEX THE SENSOR DOWNWARDS
    while(DRIVER.distanceToGo() !=0){                       
    DRIVER.run();}
  
    delay(2000);                                            // Delay can be reduced after testing
    DRIVER.moveTo(1100);                                    // Displacement of the stepper motor upwards THIS IS USED TO FLEX THE SENSOR UPWARDS
    while(DRIVER.distanceToGo() !=0){
    DRIVER.run();
   }
    delay(2000);                                           
    DRIVER.moveTo(-200);                                    
    while(DRIVER.distanceToGo() !=0){
    DRIVER.run();
    }
    Joint1=digitalRead(0);                                  
    delay(1000);
    Joint2=digitalRead(1);                                  
    delay(1000);
    Joint3=digitalRead(2);                                  
    delay(1000);
    Joint4=digitalRead(3);                                 
    delay(1000);
    Joint5=digitalRead(4);                                 
    delay(1000);
    Joint6=digitalRead(5);                                  
    delay(1000);
  

    digitalWrite(22, HIGH);                                 // Turns on the Relay for R7
    delay(1000);                                            // CAN BE REMOVED AFTER TESTING
    sensorValue7 = analogRead(sensorPin7);                  // Reads Vout on analog input pin A0 (Arduino can sense from 0-1023, 1023 is 5V)
    Vout = (Vin * sensorValue7) / 1023;                     // Converts Vout to volts
    R7 = Rref7 * (1 / ((Vin / Vout) - 1));                  // Formula to calculate tested resistor's value
    Serial.print("R7: ");                                   // CAN BE REMOVED AFTER TESTING
    Serial.println(R7);                                     // Gives calculated resistance in Serial Monitor CAN BE REMOVED AFTER TESTING
    digitalWrite(22, LOW);
    delay(3000);

    digitalWrite(24, HIGH); 
    delay(1000);
    sensorValue8 = analogRead(sensorPin8);
    Vout = (Vin * sensorValue8) / 1023;
    R8 = Rref8 * (1 / ((Vin / Vout) - 1));
    Serial.print("R8: ");
    Serial.println(R8); 
    digitalWrite(24, LOW);
    delay(3000);

    digitalWrite(26, HIGH);
    delay(1000);
    sensorValue9 = analogRead(sensorPin9);
    Vout = (Vin * sensorValue9) / 1023;
    R9 = Rref9 * (1 / ((Vin / Vout) - 1));
    Serial.print("R9: ");
    Serial.println(R9);                                     
    digitalWrite(26, LOW);                                  
    delay(3000);                                           

    DRIVER.moveTo(0);                                       
    while(DRIVER.distanceToGo() !=0){
    DRIVER.run();

    if (R7 > 10 && R7 < 30 && R8 > 10 && R8 < 30 && R9 > 20000 && R9 < 40000 && Joint1 == 0 && Joint2 == 0 && Joint3 == 0 && Joint4 == 0 && Joint5 == 0 && Joint6 == 0) {             
    digitalWrite(51, HIGH);                                
    }
      else {
      digitalWrite(49, HIGH);                               
    }
    }  
}
}

why don't you put an LED/resistor on pin 53 to see when/if it is HIGH

why don't you add a Serial.println() after the if to see if the condition is ever recognized as true?

you have a lot of while loops. maybe your code is stuck in one of them. you can put Serial.prints to follow the progress thru the code

How do you know that:

pin 53 is low.

?

You have it pinMode()-ed as:

pinMode(53, INPUT);

Unless you have a pull down resistor on there (do you?) it will be floating and could just randomly be going high.