Home > Software engineering >  How to according to the communication protocol using vb to write a program
How to according to the communication protocol using vb to write a program

Time:09-21

Vb done only a few simple, but look at the long communication protocols, is the rhythm of the minutes to cry ah, online tutorial really can not find, have a great god, consult ah,,, a measuring instrument for temperature port is rs485, ready to use level translator to rs232 to connect to PC, using vb to write a program to two weeks, for advice

CodePudding user response:

Read a word a word ah, can't, do a few familiar,

CodePudding user response:

Above this is a great god, and you catch him...

CodePudding user response:

CodePudding user response:

This kind of problem if using LabVIEW should be relatively simple, Google search should be able to search some useful things

CodePudding user response:

Fyi:
 Dim iBuf () As Byte 
Dim bt As Long
Bt=bytesTotal
'charge current flow
ReDim iBuf (bt - 1)
TcpRTB. GetData iBuf
'the log every byte received
'I=0
'LNX="RTB - & gt; BYTE: "+ Right (" 0000000" + Hex (I), 8) + "-"
'For I=0 To bt - 1
'LNX=LNX + "" + Right (" 0" + Hex (iBuf (I)), 2)
'If I Mod 16=15 Then
'LogRX LNX
'LNX="RTB - & gt; BYTE: "+ Right (" 0000000" + Hex (I + 1), 8) + "-"
'End If
'Next
'I=bt - 1
'If I Mod 16 & lt;> 15 Then
'LogRX LNX
'End If

CodePudding user response:

Mainly used in vb Mscomm control, but, for a communication protocol, according to the communication protocol coding, such as programming code, according to communication response format,

CodePudding user response:

485 - rs232 hardware first,
Then, and then there is a serial port operation

CodePudding user response:

In fact, the application side is according to the communication protocol to write a serial port communication process,

RS485 bus system is to support more from machine, the agreement with this idea is easy to understand,

Need a RS485-232 converter (line),
  • Related