Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MsComm Control

Status
Not open for further replies.

cwt

New Member
Hi out there..
I have encounter some problem when dealing with MsComm Control.

Let say, i want to sent out &H11 (hex), which is 00010001 binary, how am i going to send that outwards through serial port?

I am using 8LEDs to test the out coming bytes. If the circuit encounter 00010001, it will light up accordingly.

The problem is, if i declare the hex data to the MsComm, there will be an error. So how am i going to declare the hex data and make sure that the receive bytes are correct?
Please help.

:(
 
cwt said:
Hi out there..
I have encounter some problem when dealing with MsComm Control.

Let say, i want to sent out &H11 (hex), which is 00010001 binary, how am i going to send that outwards through serial port?

I am using 8LEDs to test the out coming bytes. If the circuit encounter 00010001, it will light up accordingly.

The problem is, if i declare the hex data to the MsComm, there will be an error. So how am i going to declare the hex data and make sure that the receive bytes are correct?
Please help.

:(

It will vary according to the language you use, but you need to send the ASCII character representing the number you need - something like Chr$(17) for the value you specified.
 
yes, mscomm excepects a string as input to be sent. so you need to convert your number to ascii
 
Oh..i see..
thanks..
i know how to solve that problem..thanks alot! :lol:
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top