usb控制继电器板软件+驱动+源代码
Public Function tx_read_frame(leixing As Byte, data1 As Byte, data2 As Byte, data3 As Byte, data4 As Byte)
Static Byteout(0 To 7) As Byte, i As Byte '向外发送
Dim sum As Integer
Byteout(0) = &H55; Byteout(1) = 1
Byteout(2) = leixing
Byteout(3) = data1
Byteout(4) = data2
Byteout(5) = data3
Byteout(6) = data4
sum = 0
For i = 0 To 6 Step 1
sum = sum + Byteout(i)
Next
Byteout(7) = sum Mod 256
main_form.MSComm1.InBufferCount = 0
main_form.MSComm1.Output = Byteout
End Function
2019-12-21 21:15:43
4KB
继电器
1