Solved

sending hex protocols via mscomm to control a video projector

Posted on 2001-08-31
7
353 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

747 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

12 Experts available now in Live!

Get 1:1 Help Now