what is the problem with your code?
if you are not sure a technique works write a simple test, e.g. arduino
void setup() {
Serial.begin(115200);
while(!Serial);
Serial.println("567,890");
}
void loop() {
}
and a C# console program
using System;
using System.IO.Ports;
namespace ConsoleTerminal
{
class Program
{
static void Main(string[] args)
{
SerialPort serialPort = new SerialPort() ;
serialPort.PortName = "COM10";
serialPort.BaudRate = 115200;
serialPort.Open();
string s=serialPort.ReadLine();
Console.WriteLine("data received " + s);
string[] data = s.Split(',');
int b, d;
Int32.TryParse(data[0], out b);
Int32.TryParse(data[1], out d);
Console.WriteLine("b = " + b);
Console.WriteLine("d = " + d);
}
}
}
result
data received 567,890
b = 567
d = 890
Press any key to continue . . .