Page 1 of 1

Send sting via rs232

Posted: Thu Aug 23, 2007 5:25 pm
by ALAN_26
HELLO

HOW can i send a string via RS232 , rs232 only sends bytes variables or int variables !

And how can i put a numeric string back in a int or byte variable ?

anyone got any idea ?


Thanks in advance

Posted: Fri Aug 24, 2007 10:21 am
by Benj
Hello

To send a string via RS232 you can simply use the following.

"HELLO WORLD"

or you can pass a string variable as the parameter.


To receive a string is a little more complicated.

first you need to create a while loop a length variable and an index variable.

set the index to 0
set the length to the length of the string eg 6 characters
loop while index < length
{
receive rs232 character and store into string[index]
increment index
}