Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending data to serial port in hex format

Status
Not open for further replies.

PMeyers

Technical User
Oct 9, 2000
1
US
I'm writing a VB6 application to remotely control a
VCR thru it's "Control-L" port. I got a special adaptor
that plugs into my PC serial port that expects commands
that are 3 bytes long, in hex format. Then, a microprocessor
in the adaptor handles the conversion to a language
understood by the VCR.

The Control-L protocol specifies sending the following
3 bytes to the serial port (without CR, or LF characters)
which ejects the tape in the VCR:

First byte: 20h
Second byte: 0Fh
Third byte: 2Fh

(values are in hex, as noted by the "h" suffix)

Is this the correct way to send the hex data?

MSComm1.Output = Chr$(&H20) + Chr$(&H0f)+ Chr$(&H2F)

Another issue is whether or not version 6.xx.xx of
MSComm32.OCX will support a baud rate of 38,400. I'm
able to set the 38,400 baud rate in properties and run
the form without an error message.

Any help would be greatly appreciated.

Paul [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top