RS485 with arduino

Hi,

I've modbus rtu sensors connected on 1 bus to an IoT gateway and they are working okay.

now i got an analog sensor that i connected to an Arduino mega then connected MAX485 to the arduino and it connected to another IoT gateway via RS485

my question is, will it work if i connected the arduino to the Modbus RTU bus and work with one IoT gateway? or will it be a conflict in the modbus

const int pin_LED = 13;
const int pin_485Dir = 8;      // RX Enable RS485
const int RS485Transmit = HIGH;      // TX Enable RS485
const int RS485Receive = LOW;

const int analogPin = 0; 

void setup()
{
    Serial.begin(9600);
    Serial1.begin(9600);
    //Serial1.flush();
    //Serial.flush();
    //myTransfer.begin(Serial1);
    
    //Serial1.println("Hi from arduino");
    digitalWrite(pin_485Dir, RS485Transmit);
//    Serial1.flush();
    Serial.println("Arduino Connected");
    Serial1.println("Arduino Connected");
    pinMode(pin_LED, OUTPUT);
    pinMode(pin_485Dir, OUTPUT);
    pinMode(analogPin, INPUT);
}


void loop()
{
  digitalWrite(pin_485Dir, RS485Transmit);
  Serial.println("Arduino Connected");
  Serial1.println("Arduino Connected");
  int val = analogRead(analogPin); // read the value from the sensor 
  //float volts = (val / 1023.0) * referenceVolts; // calculate the ratio
  float volts = 0.0048 * val;
  float moisture = calculate_polynomial(volts);
  Serial.print("volts : ");
  Serial.println(volts);
  Serial.print("moisture : ");
  Serial.print(round(moisture));
  Serial.println("%");
  
  Serial1.print("volts : ");
  Serial1.println(volts);
  Serial1.print("moisture : ");
  Serial1.print(round(moisture));
  Serial1.println("%");
  
  Serial1.flush();
  //digitalWrite(pin_485Dir, RS485Receive);
  //Serial1.println("Hi from arduino");
 /* myTransfer.txBuff[0] = 'h';
  myTransfer.txBuff[1] = 'i';
  myTransfer.txBuff[2] = '\n';
  
  myTransfer.sendData(3);*/
  while (Serial.available()) {
        char ch = Serial.read();

        Serial.print("RX: ");
        Serial.print(ch);
        Serial.println("");
        
    }
  
  delay(1500);
}
float calculate_polynomial(float volt){
  float beta = 1+14.4396*(volt)-31.2587*pow(volt,2)+49.0575*pow(volt,3)-36.5575*pow(volt,4) +10.7117*pow(volt,5);
  float total = (beta-1.6)/8.4;

  return  total * 100;
}

void ToggleLED(int  rel) {
    digitalWrite(rel, !digitalRead(rel));
    digitalWrite(pin_485Dir, RS485Transmit);
    Serial1.println(digitalRead(rel));
    //Serial1.println("Hi from arduino");
    //delay(100);
    Serial1.flush();
    digitalWrite(pin_485Dir, RS485Receive);
    Serial.println(digitalRead(pin_485Dir));
}

anyone can help?