Sending Hex values with MSComm?

I have an application that needs to send a piece of equipment command lines in the following form:

SOH TYPE [##] STX [DATA_TEXT] ETX [BCC] CR

Bracketed items are optional data. TYPE, ##, and DATA_TEXT are all text. SOH, STX, ETX, and CR are all Hex values but I get an error when trying to send a hex value with MSComm. My question is...how would I send the following parameters using MSComm?

&H1 P AA &H2 Hello World &H3 &HD

Thanks In Advance,
Randy
LVL 3
Randy BristowSenior Systems AnalystAsked:
Who is Participating?
 
EDDYKTConnect With a Mentor Commented:
chr is only handle a byte

use chrW
0
 
EDDYKTCommented:


dim s as string

s = chr(1) & chr(2) & "hello world" & chr(3) & chr(13)

use s to send
0
 
Randy BristowSenior Systems AnalystAuthor Commented:
Thanks for the response.

How would I send the hex value &h1EE? I get an error when I use the chr() function.

Thanks Again,
Randy
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.