Data loss while received from serialport.

denesh neupane 121 Reputation points
2021-10-27T08:55:03.03+00:00

I am trying to send the (x, y) co-ordinate to a CNC machine using the SerialPort. The co-ordinates will upload by user which is around 30-200 lines. While sending the co-ordinates less than 40 lines. All the data are received on the CNC machine . if the number of the exceeding from 50 .. some data received with loss of some digits mention below.. here X is loss in received data .

data send
X300Y-1300
X610Y-1500
X720Y-200

data received
X300Y-1300
610Y-1500
X720Y-200

i cannot figured out the problem .. is it a application error ???

if (this->serialPort->IsOpen)
{ String^ txt = richTextBox6->Text;
if (richTextBox6->Lines->Length > 0)
{
serialPort->Write(header + "\x25" + "\x0A"+ "O00000010"+ "\x0A" +" "+"\x0A" + "(from pc) "+ "\x0A" + txt + "\x0A" + "\x25" + header);
}
}

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
322 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,527 questions
{count} votes