Uno - Receiving from COMx and sending to COMy

Hello guys,
Like i said in the title, have a little problem to make the Arduino send a string to an other serial communication.
The communication that i want occurs like this (for example):
Sensor > Arduino (COM3) > PC > Another Plataform (COM4)
Sensor are connected in Arduino, that are connected in PC with USB, and the other device are connected with a USB to PC too.

I only can reach the communication between Uno and PC, with the Serial.print, but i dont know how to do this "serial.print" to another COM port. Anyone can give a help please?

Thanks all. :cold_sweat:

You need to run an application on the PC which reads from one serial port and echoes everything it receives onto the other serial port. I think you ought to be able to do that with RealTerm or PuTTY, but if not you could write a small application to do that in whatever language you prefer.

So, its impossible to do this with only Arduino programming?
I'll show u what i've got for now:

int analogPin = 0;
int readValue = 0;
float temperatura = 0;
float temperatureF = 0;
float a2;
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  readValue = analogRead(analogPin);
  //Serial.println(readValue);
  temperatura = (readValue * 0.0049);
  temperatura = temperatura * 100;
  //temperaturaF = (temperature * 1.8) + 32;
  if (temperatura != a2){
    a2 = temperatura;
    Serial.print("%R1Q,2028:DryTemperature[");
    Serial.print(a2);
    Serial.println("]");
    //Serial.println("C ");
  }
  Serial.print("Temperatura: ");
  Serial.println(temperatura); 
  //Serial.println("C ");
  
  //Serial.print("Temperatura: ");
  //Serial.print(temperatura);
  // Serial.println("C ");
  //Serial.print(temperatureF);
  //Serial.println("F");
  delay(1000);
}

But, i need to print the msg

    Serial.print("%R1Q,2028:DryTemperature[");    Serial.print(a2);    Serial.println("]");

to another COM.

jackcabral90:
So, its impossible to do this with only Arduino programming?

Yes. Your PC can only read the output of your Arduino. The Arduino doesn't control the PC.

From your Post#2 I'm not clear if you want the Arduino to send stuff to two different devices which you could probably do using SoftwareSerial to manage a second Com port on your Arduino.

However if the idea is that all the data is received by the PC and then redistributed to another device from the PC the earlier advice is appropriate.

...R

Well, i know i can do this with Matlab programming, but i dont want use others softwares... I just want to this auto.
But, since is impossible, better start the Matlab progs...

jackcabral90:
But, since is impossible, better start the Matlab progs...

Of course it isn't impossible. You need an application on the PC to do it - that doesn't have to be Matlab.