Solved

Sending Hex values with MSComm?

Posted on 2006-06-16
3
664 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:RandyB30
  • 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 1

Author Comment

by:RandyB30
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now