Solved

sending hex protocols via mscomm to control a video projector

Posted on 2001-08-31
7
357 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

914 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

14 Experts available now in Live!

Get 1:1 Help Now