Connect sensor to arduino uno via RS 232 pins for sensor data logging

Hey so I am a beginner for arduino coding. And I want to connect an old diameter sensor to my arduino uno via the RS 232, i have attached the pdf for the sensor (page 18 shows the pins for the RS 232 output). How can i change my code to get the diameter readings instead of the output voltgaes?

int sensorPin = A0;    // select the input pin for the ardunio
int ledPin = 13;      // select the pin for the sensor
int sensorValue = ledPin;  // variable to store the value coming from the sensor

void setup() {
 // declare the ledPin as an OUTPUT:
 pinMode(ledPin, OUTPUT);

 Serial.begin(9600);
}

void loop() {
 // read the value from the sensor:
 Serial.println(digitalRead(sensorPin));
 // turn the ledPin on
float diameter = (sensorValue * 34.4386)/(655519-0.2221);
Serial.println(diameter);

 
 delay(500);
}





man--optoCONTROL-2500--en.pdf (961 KB)

@apweerakkody, please do not cross-post. Other thread removed.

Use the CHOOSE_MP command, see "7.4.6 Change the Measurement Program".

hey DrDiettrich............what will the CHOOSE_MP command do exactly?

If you cannot read the data sheet, start with a simpler project. Or go to Gigs and Collaborations for professional help.