Home > Back-end >  Mscomm serial port communication problems
Mscomm serial port communication problems

Time:10-18

how to tell a hexadecimal string (such as STR:='6820 aaaaaaaaaaaaaa1a039a4f003416) sent to the single-chip computer?????
1 - comInputModeBinary an InputMode attribute for;
Settings of the properties for 2400, e, 8, 1;
Thanks for your answer;

CodePudding user response:

Use ASCII

CodePudding user response:

How best can you point in detail with the code

CodePudding user response:

Use first convert a string to a byte array of ASCII byte string, a serial port is sent the byte array, I didn't install mscomm, suggested a Cport serial interface control, easy to use

CodePudding user response:

SPCom works fine!
Than the MSComm that!

CodePudding user response:

Converted to ASCII characters:
Var
S: a string;
BASCII: array [0.. 49] of byte;
I: integer;
The begin
S:='6820 aaaaaaaaaaaaaa1a039a4f003416';
For I:=1 to lenght (s) do
BASCII: [I - 1]=Char [I] (s);

Turns into ASCII characters with the word () function

CodePudding user response:

Dizzy, spoke against, correct

Converted to ASCII characters:
Var
S: a string;
BASCII: array [0.. 49] of byte;
I: integer;
The begin
S:='6820 aaaaaaaaaaaaaa1a039a4f003416';
For I:=1 to lenght (s) do
BASCII: [I - 1]=word (s) [I];

Turns into ASCII characters with Char () function

CodePudding user response:

On a post from you in light of the problem is that you put the string into a byte stream, the positive solution to the upstairs
  • Related