How to see indata from outside DataReceivedHandler? Everything that I found on the Internet solved the problem of outputting to the textbox using the delegate, but I do not need the output in the UI, but simply pull out the string variable to process it and send it to Modbus TCP.
private static void DataReceivedHandler( object sender, SerialDataReceivedEventArgs e) { SerialPort sp = (SerialPort)sender; string indata = sp.ReadExisting(); }