Quote:
start_text = serialPort1.ReadByte();
The error mostly will occur if you are trying to read the data when the port is closed. (forgot to open or accidentally got closed)
Make sure you open it in the start (if not doing already):
serialPort1.Open()
Before reading the data, check for the port status:
serialPort1.IsOpen
Look at the example provided here on how to use it:
SerialPort Class (System.IO.Ports) | Microsoft Docs[
^]