Split Arduino serial data and send it to multiple softwares.

Hi.

My Arduino is sending data from two ADC channels (CH1 and CH2), unfortunately the software i use in Windows doesnt work with multiple channels, so i´m only using one channel :frowning:

Arduino is sending:
CH1: 100
CH2: 210
CH1: 123
CH2: 240

My idea is…

Using some script i manipulate the data, the script will recognize which channel, remove the “CH1:” tag and send it only the values to a virtual serial port:
-CH1: 100 - Goes to virtual Port X as “100”
-CH2: 210 - Goes to virtual Port Y as “210”
-CH1: 123 - Goes to virtual Port X as “123”

With this method i will have two Virtual Serial Ports - X for CH1 and Y for CH2 - and i can use two softwares to monitor data from CH1 and CH2.

Anyone knows a software/freeware which is capable of doing this?

Thanks.

My Arduino is sending data from two ADC channels (CH1 and CH2), unfortunately the software i use in Windows doesnt work with multiple channels, so i´m only using one channel

What software are you using?

The correct way to do this is to have a program on your PC reading the incoming data on the serial port and parse to determine the channel in question, then do whatever it is you want with the data. Display it, save it etc.

Old guy.

I wish to test in different softwares..but its for log the data from the ADC. But the softwares only access data serial port..so even i can managed to do a script to parse the data i need to send to a "virtual serial port" to the software accept the data.

Another way i thought on doing this, is to have two arduinos:

-The Arduino 1 with ADC will Serial.Print the data from CH1 and send the data from CH2 to Arduino 2, the Arduino 2 receive it and Serial.Print

Will this work?

I prefere using a software/script, but using two arduinos its better than only getting one channel per time.

Have you checked - http://www.serialportsplitter.com/splitter.html - It does multiplies the signal to two (virtual) serial ports. Each app can ignore the data not for him/her ...

Another way i thought on doing this, is to have two arduinos:

-The Arduino 1 with ADC will Serial.Print the data from CH1 and send the data from CH2 to Arduino 2, the Arduino 2 receive it and Serial.Print Will this work?

With 2 Arduino's it will definitely work.

robtillaart: Have you checked - http://www.serialportsplitter.com/splitter.html - It does multiplies the signal to two (virtual) serial ports. Each app can ignore the data not for him/her ...

Another way i thought on doing this, is to have two arduinos:

-The Arduino 1 with ADC will Serial.Print the data from CH1 and send the data from CH2 to Arduino 2, the Arduino 2 receive it and Serial.Print Will this work?

With 2 Arduino's it will definitely work.

Thanks for the answer.. indeed that application splits correctly the data to two or more virtual serial ports, but i cant manipulate the data using the splitter software and in the software to plot the data..its a closed software and it can only read from a Serial Port.

I cant find any software/freeware for this issue and since my programming skill are limited, i dont know how to wrote a program to do this.

My best solution is to have two Arduinos, but later i will like to use 3 ADC channels, so 3 arduinos its a bit extreme just to parse the data..

Aother option might be an application that connects to the serial port and splits the data and offers it as three network sockets? (never done this, not trivial, but doable and it would be a great tool if it works....)

Have you checked gobetwino.exe ? does offer some nice features too, might need a redesign on the Arduino side a bit ...

Maybe gobetwino.exe will do the trick…but working at 65SPS each channel, whats the reliability of the data? Not only for gobetwino.exe, i need a reliable method to not loose packets.

But i did once used a opensource project (com0com) which splits the serial port to different virtual serial ports…according to the readme:

The HUB for communications (hub4com) is a Windows application and is a part of
the com0com project.

It allows to receive data and signals from one port, modify and send it to a
number of ports and vice versa.

So this should be the solution, right?

The problem is looking to the source code or to the commands on hub4com dont know where to start… any help i appreciate.

Hi.

Com0Com + Hub4com is the solution to my needs, i will make a mini-tutorial when i got this fully running..

I successfully split and redirect data to two virtual serial ports, but i need to print in a new line..

Using fix messages: Serial.println("010203"); Serial.println("151617");

hub4com removes the "0" tag and redirects to serial port COMX --> 123 hub4com removes the "1" tag and redirects to serial port COMY --> 567

But for each serial port i have 123123123123123123123 and 567567567567567567

So it does not understand "ln" sent by arduino, because hub4com works in binary and i´m sending in ASCII (i think)..but sending like this:

Serial.print(0x00 0x31 0x00 0x32 0x00 0x33 0x00 0x0A, BIN);

It says "expected ")" before numeric constants".

How can i Serial.print in a new line? If possible i prefer to be sending in ASCII..

Serial.print(0x00 0x31 0x00 0x32 0x00 0x33 0x00 0x0A, BIN);

The compiler is right. This code is rubbish. The documentation provided is not provided because people like to sit around writing documentation. It is there because people need to read it. That includes you.

How can i Serial.print in a new line?

See above comment.

PaulS:

Serial.print(0x00 0x31 0x00 0x32 0x00 0x33 0x00 0x0A, BIN);

The compiler is right. This code is rubbish. The documentation provided is not provided because people like to sit around writing documentation. It is there because people need to read it. That includes you.

How can i Serial.print in a new line?

See above comment.

Thank you for saying what i already know.

I can't figure out what you think you are doing in the Serial.print() statement, so I have no idea how to help you. Most likely, you need to put those values in an array, and print the array.

As for the new line, that's what Serial.println() does.

I was trying to send the data (0102030\n) in binary..to hub4com remove the "0" and create a new line..ending like:

123 123 123 123

Like i said before, i´m parsing the data ok to the virtual serial ports, but the problem is that hub4com does not create a new line..but i think that i need to send the data in binary rather than ASCII for Hub4Com...so to send data in binary i need to work in serial.write?

binary, ascii, etc..its really confusing for me, i agree that i have to learn a lot more..

Problem solved!

Getting from COMX

123 123 123 123

Getting from COMY 567 567 567 567

I will add a mini tutorial here in a couple of days.