dspencerpci
asked on
Com Port Programming
Hey All,
I am trying to write some code to communicate with a piece of hardware that accepts hex values.
How will i format a string like "AA AA AA AA AA AA" so that it is hex when I send it to the port.
I will be using the serial port component in VB.net.
What I have so far is something liek this
x(0) = &HAA
x(1) = &HE
x(2) = &H1
x(3) = &H0
x(4) = &H0
x(5) = &H3
x(6) = &H52
x(7) = &H45
x(8) = &H4C
x(9) = &H41
x(10) = &H59
x(11) = &H23
x(12) = &H31
x(13) = &H20
x(14) = &H3
x(15) = &HD4
But it doesnt seem to work.
Any help would be appreciated.
I am trying to write some code to communicate with a piece of hardware that accepts hex values.
How will i format a string like "AA AA AA AA AA AA" so that it is hex when I send it to the port.
I will be using the serial port component in VB.net.
What I have so far is something liek this
x(0) = &HAA
x(1) = &HE
x(2) = &H1
x(3) = &H0
x(4) = &H0
x(5) = &H3
x(6) = &H52
x(7) = &H45
x(8) = &H4C
x(9) = &H41
x(10) = &H59
x(11) = &H23
x(12) = &H31
x(13) = &H20
x(14) = &H3
x(15) = &HD4
But it doesnt seem to work.
Any help would be appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.