Hello!
I'm running Visual Basic 2012
I'm having a certain amount of sucess controlling my serial port but now I've hit a wall.
As you can see I need either the whole byte in hex or just parts of it, problem is that Hex(Int) gives it as a string instead of the &H?? format I need. I can't find any solution on MSDN.
Am I just not seeing the obvious?
Best Regards
SciCat
EDIT: The code is incomplete, I didn't want to dump a 100+ line blob, the code works in its entirety.
I'm running Visual Basic 2012
I'm having a certain amount of sucess controlling my serial port but now I've hit a wall.
Code:
Public com3 As New SerialPort("COM3", 9600, Parity.None, 8, StopBits.One)
Public Hexe As Integer = Hex(100)
Public Sub New()
InitializeComponent()
For Each sp As String In My.Computer.Ports.SerialPortNames
ListBox1.Items.Add(sp)
Next
If com3.IsOpen = False Then
com3.Open()
End If
Dim Absolut() As Byte = {1, 4, 0, 0, 0, 0, 0, Int in Hex (&H format), Int in Hex + 5 (control bit)}
com3.Write(Absolut, 0, Absolut.Length)
End Sub
Am I just not seeing the obvious?
Best Regards
SciCat
EDIT: The code is incomplete, I didn't want to dump a 100+ line blob, the code works in its entirety.
Comment