Solved

sending hex protocols via mscomm to control a video projector

Posted on 2001-08-31
7
362 Views
Last Modified: 2012-05-04
i am currently trying to control a projector through rs232 using mscomm but i cannot get it to work the protocol command i am sending is "A5h 01h 01h 00h 01h 03h 00h 01h 00h 01h 17h 00h 80h 08h 00h 06h 40h54h 2Eh 00h 00h 00h A1h 5Ah"                 i know this is the right command as the projector comes with its own software for testing protocol commands on the projector.
this is what i have tried so far.

    MSComm1.CommPort = 1
    MSComm1.Settings = "38400,E,8,1"
    MSComm1.InputLen = 0    '
    MSComm1.PortOpen = True
    MSComm1.Output = "A5h 01h 01h 00h 01h 03h 00h 01h 00h 01h 17h 00h 80h 08h 00h 06h 40h54h 2Eh 00h 00h 00h A1h 5Ah"
i think the problem lies in that i am sending ASCI instead of the needed hex anyone have any ideas
thanks
0
Comment
Question by:VMP
7 Comments
 
LVL 6

Accepted Solution

by:
anthony_glenwright earned 100 total points
ID: 6447257
Instead of:

MSComm1.Output = "A5h 01h 01h 00h 01h 03h 00h 01h 00h 01h 17h 00h 80h 08h 00h 06h 40h54h 2Eh 00h
00h 00h A1h 5Ah"


Try something like:

strOutput = "&HA5 &H01 &H01 &H00 &H01 &H03 &H00 &H01 &H00 &H01 &H17 &H00 &H80 &H08 &H00 &H06 &H40 &H54 &H2E &H00
&H00 &H00 &HA1 &H5A"

For each vntItem in Split(strOutput, " ")
  MSComm1.Output = val(vntItem)
next
0
 

Author Comment

by:VMP
ID: 6447262
ill give that a try
thanks
0
 

Author Comment

by:VMP
ID: 6447267
ill give that a try
thanks
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

 
LVL 12

Expert Comment

by:roverm
ID: 6447382
Here a nice example to address up to 4 comm ports without the use of MSCOMM :

http://www.thescarms.com/vbasic/CommIO.asp

D'Mzzl!
RoverM
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7205363
Hi VMP,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept anthony_glenwright's comment(s) as an answer.

VMP, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7240852
Per recommendation, force-accepted.

Netminder
CS Moderator
0
 

Expert Comment

by:hsctng
ID: 7827536
Hi,

If you want to send Hex through Comm Port, I think you should output the byte array for Output of MSComm.

Here is the VB code for your reference!!


Dim HexData(1) As Byte
HexData(0) = CInt(Val("&H" & "AA"))  ' Send &HAA
MSComm1.Output = HexData
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

856 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