mySerialPort.Write(SampleMessage,0,40) Dim TerminalACK( 2)作为Byte 'mySerialPort。 ReadTimeout = 10000 'mySerialPort.Read(TerminalACK,0,1) mySerialPort.Close() i需要检查LRC的输出解决方案 LRC(或纵向冗余校验)非常简单:所有你要做的就是对每一个被确认的字节进行异或一起! Dim lrc As 字节 = 0 对于 每个 b 作为 字节 在 sampleMessage lrc = lrc Xor b Next hi i am totally new to vb.net can you provide source code for me with explanationWhat I have tried:i haven't tried anything Dim SampleMessage() As Byte = {&H2, &H0, &H35, &H30, &H30, &H30, &H30, &H30, &H30, &H30, &H30, &H30, &H30, &H30, &H30, _ &H32, &H30, &H30, &H30, &H30, &H1C, &H34, &H30, &H0, &H12, _ &H30, &H30, &H30, &H30, &H30, &H30, &H30, &H31, &H32, &H38, &H30, &H30, _ &H1C, &H3, &H19} mySerialPort.Write(SampleMessage, 0, 40) Dim TerminalACK(2) As Byte 'mySerialPort.ReadTimeout = 10000 'mySerialPort.Read(TerminalACK, 0, 1) mySerialPort.Close()i need to check the LRC for this output 解决方案 LRC (Or Longitudinal Redundancy Check) is very simple: all you have to do is XOR each of the bytes being confirmed together!Dim lrc As Byte = 0For Each b As Byte In sampleMessagelrc = lrc Xor bNext 这篇关于任何人都可以帮助我如何在VB.NET中检查LRC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-10 09:29