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
Send sting via rs232
- 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:
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
}
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
}
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel