Xor in vb.net - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Xor in vb.net

xautomxautom Posts: 1Member
[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

End Sub[/size][/size][/color]
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.
Sign In or Register to comment.