Send sting via rs232

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
ALAN_26
Posts: 84
Joined: Sat Apr 29, 2006 3:36 pm
Location: MALTA
Contact:

Send sting via rs232

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post 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
}

Post Reply