Solved

Sending Hex values with MSComm?

Posted on 2006-06-16
3
669 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA error replacing data 6 40
VB6 Compile Compatibility Issue 4 102
vb6 connector to mongodb 2 85
Getting warning: You are about to delete 1 row(s) 9 50
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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

831 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