Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
[size=5]Hi, i'm having the next code in order to send some serial commands to a machine:[/size]
[size=3][color=Blue]Private Sub butSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butSend.Click
Dim COMMAND As String
Dim STX As Byte
Dim ETX As Byte
STX = 2
ETX = 3
COMMAND = "01RS"
In this code, i need to xor the "STX" byte with the "COMMAND" string
and to replace the "SerialPort1.Write(Convert.ToChar([color=Red]3[/color]))"
with the result of the calculation.
In this code the 3 belongs to the result of the STX byte xor the "01RS". So i want every time to calculate the XOR because COMMAND is changing.
Thank all of you in advance.
0 · ·