Page 1 of 1
RS232 help
Posted: Wed Sep 19, 2007 4:57 pm
by Chad528
Are there any documents that explain how to properly use the RS232 macro. Anything I send outputs an *.
In addition, I am new to flowcoding and PICs and would appreciate any suggestions or tips.
Thanks,
Chad
Posted: Wed Sep 19, 2007 5:07 pm
by Benj
Hello
You can send characters or strings with the send macro.
characters can be defined as 'A' or 'a' or the ASCII equivalent.
strings can be defined as "Hello" or "World" or an array of the ASCII equivalent.
You can only receive a single character at a time. So to build up a string you would have to use an array of bytes to store the incoming data.
The timeout on the receive represents the length of time to wait. A 0 indicates a wait forever. This can be problematic as if an error occurs it will remain and your program may well freeze where it is.
The return value is the incoming byte. If the value is 255 then a timeout occurred. It is best to use this function with a timeout between 50 and 200 and then followed by a decision that checks to see if the returned value is <255.
There should be a help file for the RS232 component that is packaged with Flowcode. click on the small arrow of the RS232 component and then select properties. Then you will have access to a help button which will spawn the help file.