About S-Soil MTEC-02B sensor using modbus RS485 protocol

Can anyone help me with the arduino code for sending data to S-Soil MTEC-02B soil moisture sensor which working using modbus RS485 protocol. The schematic diagram is also given below.MAX RS485 module is used for the communication.
images (1)
Sensor link is given below.
https://www.seeedstudio.com/RS485-Soil-Moisture-Temperature-EC-Sensor-S-Soil-MTEC-02B-p-4860.html?

This is the code i have used but it did not respond with the sensor. I think requesting data from modbus module are not compatible:

#include <SoftwareSerial.h>
#include <Wire.h>
/*
  RO = Receiver Output. Connects to a serial RX pin on the microcontroller
  RE = Receiver Enable. Active LOW. Connects to a digital output pin on a microcontroller. Drive LOW to enable receiver, HIGH to enable Driver
  DE = Driver Enable. Active HIGH. Typically jumpered to RE Pin.
  DI = Driver Input. Connects to serial TX pin on the microcontroller
*/
//2 connections between Arduino and 'MAX485 TTL to RS-485 Interface Module'
#define RE 8 //[digital pin 8 -> RE]
#define DE 7 //[digital pin 7 -> DE]

const byte nitro[] = {0x01, 0x03, 0x00, 0x1e, 0x00, 0x01, 0xe4, 0x0c}; //Request code for nitrogen level
const byte phos[] = {0x01, 0x03, 0x00, 0x1f, 0x00, 0x01, 0xb5, 0xcc}; //Request code for phosporous
const byte pota[] = {0x01, 0x03, 0x00, 0x20, 0x00, 0x01, 0x85, 0xc0}; //Request code for potassium
const byte ec[] = {0x01, 0x03, 0x00, 0x15, 0x00, 0x01, 0x95, 0xCE}; //Request code for electric conductivity
const byte sal[] = {0x01, 0x03, 0x00, 0x14, 0x00, 0x01, 0xC4, 0x0E}; //Request code for salinity
const byte temp[] = {0x01, 0x04, 0x00, 0x00, 0x00, 0x03, 0xB0, 0x0B}; //Request code for temperature

byte values[11]; //empty byte array of length 11

//another 2 connection between Arduino and 'MAX485 TTL to RS-485 Interface Module'
//[digital pin 2 -> RO]
//[digital pin 3 -> DI]
SoftwareSerial mod(2, 3); //defining the module as 'mod' object

void setup() {
  Serial.begin(9600); //initialize serial monitor
  mod.begin(9600); // initialize sensor module
  pinMode(RE, OUTPUT); //set digital pin 8 as output
  pinMode(DE, OUTPUT); //set digital pin 7 as output
  delay(1000); //wait 1 second
}

void loop() {
  byte val1, val2, val3, val4, val5, val6; //defining six byte variables
  val1 = nitrogen(); //calling function nitrogen()
  delay(250); // wait 0.25 seconds
  val2 = phosphorous(); //calling function phosphorous()
  delay(250); // wait 0.25 seconds
  val3 = potassium(); //calling function potassium()
  delay(250); // wait 0.25 seconds
  val4 = conductivity(); //calling function conductivity()
  delay(250); // wait 0.25 seconds
  val5 = salinity(); //calling function salinity()
  delay(250); // wait 0.25 seconds
  val6 = temperature(); //calling function temperature()
  delay(250); // wait 0.25 seconds

  Serial.print("Nitrogen: ");
  Serial.print(val1); //print nitrogen level in serial monitor
  Serial.println(" mg/kg");//unit
  Serial.print("Phosphorous: ");
  Serial.print(val2); //print Phosphorous level in serial monitor
  Serial.println(" mg/kg");//unit
  Serial.print("Potassium: ");
  Serial.print(val3); //print Potassium level in serial monitor
  Serial.println(" mg/kg");//unit
  Serial.print("EC: ");
  Serial.print(val4); //print Electric Conductivity level in serial monitor
  Serial.println(" S");//unit
  Serial.print("SL: ");
  Serial.print(val5); //print Salinity level in serial monitor
  Serial.println(" mg/kg");//unit
  Serial.print("Temperature: ");
  Serial.print(val6); //print Temperature in serial monitor
  Serial.println(" C");//unit
  delay(2000);
}

byte nitrogen() {
  digitalWrite(DE, HIGH);
  digitalWrite(RE, HIGH);
  delay(10); //wait 0.01 seconds
  if (mod.write(nitro, sizeof(nitro)) == 8) {
    digitalWrite(DE, LOW);
    digitalWrite(RE, LOW);
    for (byte i = 0; i < 7; i++) {
      //Serial.print(mod.read(),HEX);
      values[i] = mod.read(); //retrieving the nitrogen level in hexadecimal
      Serial.print(values[i], HEX); //converting nitrogen level into decimal
    }
    Serial.println();
  }
  return values[4]; //send the value
}

byte phosphorous() {
  digitalWrite(DE, HIGH);
  digitalWrite(RE, HIGH);
  delay(10); //wait 0.01 seconds
  if (mod.write(phos, sizeof(phos)) == 8) {
    digitalWrite(DE, LOW);
    digitalWrite(RE, LOW);
    for (byte i = 0; i < 7; i++) {
      //Serial.print(mod.read(),HEX);
      values[i] = mod.read(); //retrieving the phosphorous level in hexadecimal
      Serial.print(values[i], HEX); //converting phosphorous level into decimal
    }
    Serial.println();
  }
  return values[4]; //send the value
}

byte potassium() {
  digitalWrite(DE, HIGH);
  digitalWrite(RE, HIGH);
  delay(10); //wait 0.01 seconds
  if (mod.write(pota, sizeof(pota)) == 8) {
    digitalWrite(DE, LOW);
    digitalWrite(RE, LOW);
    for (byte i = 0; i < 7; i++) {
      //Serial.print(mod.read(),HEX);
      values[i] = mod.read(); //retrieving the potassium level in hexadecimal
      Serial.print(values[i], HEX); //converting potassium level into decimal
    }
    Serial.println();
  }
  return values[4]; //send the value
}

byte conductivity() {
  digitalWrite(DE, HIGH);
  digitalWrite(RE, HIGH);
  delay(10); //wait 0.01 seconds
  if (mod.write(ec, sizeof(ec)) == 8) {
    digitalWrite(DE, LOW);
    digitalWrite(RE, LOW);
    for (byte i = 0; i < 7; i++) {
      //Serial.print(mod.read(),HEX);
      values[i] = mod.read(); //retrieving the electric conductivity level in hexadecimal
      Serial.print(values[i], HEX); //converting electric conductivity level into decimal
    }
    Serial.println();
  }
  return values[4]; //send the value
}

byte salinity() {
  digitalWrite(DE, HIGH);
  digitalWrite(RE, HIGH);
  delay(10); //wait 0.01 seconds
  if (mod.write(sal, sizeof(sal)) == 8) {
    digitalWrite(DE, LOW);
    digitalWrite(RE, LOW);
    for (byte i = 0; i < 7; i++) {
      //Serial.print(mod.read(),HEX);
      values[i] = mod.read(); //retrieving the salinity level in hexadecimal
      Serial.print(values[i], HEX); //converting salinity level into decimal
    }
    Serial.println();
  }
  return values[4];
}

byte temperature() {
  digitalWrite(DE, HIGH);
  digitalWrite(RE, HIGH);
  delay(10); //wait 0.01 seconds
  if (mod.write(temp, sizeof(temp)) == 8) {
    digitalWrite(DE, LOW);
    digitalWrite(RE, LOW);
    for (byte i = 0; i < 7; i++) {
      //Serial.print(mod.read(),HEX);
      values[i] = mod.read(); //retrieving the temperature in hexadecimal
      Serial.print(values[i], HEX); //converting temperature into decimal
    }
    Serial.println();
  }
  return values[4]; //send the value
}

Your fuzzy frizzy is not readable, posting a Schematic is much better. Also posting links to "Technical" information on the hardware parts goes a long way in getting your problem solved. I know of no code that fits your description. There is some similar but you will have to look for it. You can hire somebody to do it for you as well. You will also have to specify the codes you will send and use from the Modbus.

That sensor looks similar to the NPK sensor that appears on the forums from time to time.

Do Seeedstudio not have any example sketches?

Have you got a link to the actual user guide/manual?

What code have you tried so far?

I tried NPK sensor code.But it is not valid for this.
Manual for this sensor is below.
https://www.google.com/url?sa=t&source=web&rct=j&url=https://files.seeedstudio.com/products/101990668/res/Soil%2520Moisture%2520%26%2520Temperature%2520Sensor%2520User%2520Manual-S-Soil%2520MT-02%2520v2.0.pdf&ved=2ahUKEwjm5LuE_fH5AhXRpOkKHeA3A9gQFnoECAoQAQ&usg=AOvVaw1Wv-84TUlO6ocjNcEEzStB

I tried NPK sensor code but it did not match for this sensor.

This is not a free give away shop, helpers making code all day.
You need to start with something like example code and then helpers will assist You in adjusting the code.
The forum intention is to help members learn and grow in coding themselves.

From the manual you provided the modbus address is:

Default:1 or 17

Why have 1 when you can make things more complicated by having 2 default addresses!!

I also found this web page which may or may not provide any clues:

EDIT: When attempting to use RS485 and Modbus with new/unknown hardware I would recommend using a USB-RS485 dongle and one of the free Modbus tools for a PC just to gain the confidence that the sensor is working. If you can talk to the sensor from a PC, then you will know the correct serial parameters, the Modbus address and also exactly what data is sent to and received from the sensor.

Sorry for my mistake. I attached the coding.

Thank you.