Solved

sending hex protocols via mscomm to control a video projector

Posted on 2001-08-31
7
359 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

775 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