Home > Software engineering >  MFC serial data
MFC serial data

Time:09-20

As shown in figure, want to have a serial port and coordinate the data and stored in TXT, but the serial saved data is garbled, please help, thank you

CodePudding user response:

The STR data before WriteString TRACE out and see if the normal

CodePudding user response:

reference 1st floor zgl7903 response:
WriteString STR data TRACE out before, and see if there is something wrong
access to data, do not know how to change

CodePudding user response:

TARCE (_T (" % s \ n "), (LPCTSTR) STR);
File. WriteString (STR);


CodePudding user response:

The
reference 3 floor zgl7903 response:
TARCE (_T (" % s \ n "), (LPCTSTR) STR);
File. WriteString (STR);
serial data bits are symbols, using serial assistants receive, should be 0.00

CodePudding user response:

The
reference 3 floor zgl7903 response:
TARCE (_T (" % s \ n "), (LPCTSTR) STR);
File. WriteString (STR);
add WeChat can you?

CodePudding user response:

Your get_serialData function should be directly output byte array, because this is the original data, can be used on various occasions, you directly to turn this into a string, somewhere else might also need to turn back,

SaveData function of the data come from? I can't see definition?
STR. The Format (_T (" % d, % d, % s \ n "),... ) a try?

CodePudding user response:

Serial port data acquisition has a problem, no see, post code, using a serial port assistant to look at the received data, then use your program debugging, and the received data is char *, not character conversion, one by one, the other recommended directly under a serial port class to get the data from the Internet,

CodePudding user response:

Problem has been solved, thank you, is the issue of data type conversion
  • Related