Solved

Sending Hex values with MSComm?

Posted on 2006-06-16
3
677 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:Randy Bristow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 16921402


dim s as string

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

use s to send
0
 
LVL 2

Author Comment

by:Randy Bristow
ID: 16923733
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
 
LVL 26

Accepted Solution

by:
EDDYKT earned 250 total points
ID: 16926579
chr is only handle a byte

use chrW
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question