Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

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.
0
dspencerpci
Asked:
dspencerpci
1 Solution
 
Bob LearnedCommented:
There is a free community version of Sax.NET in the VB.NET Resource Kit for serial communication:

MSDN:  The Visual Basic .NET Resource Kit
http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

Bob
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now