Sending Hex values with MSComm?

Posted on 2006-06-16
Medium Priority
Last Modified: 2012-06-27
I have an application that needs to send a piece of equipment command lines in the following form:


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,
Question by:Randy Bristow
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
LVL 26

Expert Comment

ID: 16921402

dim s as string

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

use s to send

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,
LVL 26

Accepted Solution

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

use chrW

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

765 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