Home > Software engineering >  VB and single-chip microcomputer communication, single chip microcomputer sends data to the VB, the
VB and single-chip microcomputer communication, single chip microcomputer sends data to the VB, the

Time:10-06

As title, please help! VB and single-chip microcomputer communication, single-chip microcomputer sends data to the VB

CodePudding user response:

Communication protocol? The format of the data? VB receive and display the code?

CodePudding user response:

reference 1st floor Tiger_Zhao response:
communication protocol? The format of the data? VB receive and display the code?

VB program in this
 Private Sub Command1_Click () 
If MSComm1. PortOpen=False Then MSComm1. PortOpen=True: Shape1. FillColor=255
End Sub



Private Sub Command3_Click ()
If MSComm1. PortOpen=True Then
MSComm1. The Output=Text1. Text

End the If
End Sub



Private Sub Timer1_Timer ()
If MSComm1. PortOpen=True And MSComm1. InBufferCount & lt;> 0 Then
Text3. Text=MSComm1. Input
Text2. Text=Text2. Text & amp; "" & amp; Text3. Text




End the If

End Sub

CodePudding user response:

It depends on single chip microcomputer to send what,

If it is a printable characters, try
 
Dim TMP As the Variant

TMP=MSComm1. Input
Text3. Text=StrConv (TMP, vbUnicode)
Text2. Text=Text2. Text & amp; "" & amp; Text3. Text


If it's any binary number, try:
 Dim TMP As the Variant, I As an integer 

TMP=MSComm1. Input
Text3=""
For I=0 To Ubound (TMP)
Text3=Text3 & amp; Right (" 0 "& amp; Hex (TMP), 2)
Next I
Text2. Text=Text2. Text & amp; "" & amp; Text3. Text

CodePudding user response:

Single chip microcomputer send is
If (P2_4==0)
{SBUF=ge;
while(! TI);
TI=0;
}

CodePudding user response:

Ge's value is what?

CodePudding user response:

0 x * *; * * this literally will do

CodePudding user response:

communication protocol?
Including baud rate, parity, etc., MSComm controls whether the attribute set of consistent,

the format of the data?
Text or binary mode? MSComm controls whether the attribute set of consistent,
How to cut between the field?
Illustrate the results of the data and what do you expect,

CodePudding user response:

refer to 6th floor baidu_17335183 response:
0 x; * *; * * this will do casually
you must press any binary values to display,
Computer character encoding is specified, such as es "printable characters" code contains only part of the above 0 x20 "defined" number, what are the specific look even chosen word stock,
Here is 0 x00-0 XFF you obviously have a lot of printable characters, according to the latter method, data will be sent up to display in the form of hexadecimal string,

CodePudding user response:

refer to the eighth floor of123 response:
Quote: refer to the sixth floor baidu_17335183 response:

0 x * *; * * this will do casually
you must press any binary values to display,
Computer character encoding is specified, such as es "printable characters" code contains only part of the above 0 x20 "defined" number, what are the specific look even chosen word stock,
You here is 0 x00-0 XFF obviously have a lot of printable characters, you press the back of the method, the data will be sent up to display, in the form of hexadecimal string


I used the method, behind you is shown? - these types, I just want to put the data received in decimal display in the text box

CodePudding user response:

What is your SCM from the format of the data?
Binary or a decimal
  • Related