Page 1 of 1

RS232 help

Posted: Wed Oct 24, 2007 5:27 pm
by goldwingers
In your example program on rs232 what do the following refer to

> ?....
< ?....

also i see this cropping up in programs "==" what does this do.

cheers guys

Ian

Posted: Wed Oct 24, 2007 5:34 pm
by Benj
Hello Ian

These commands are all comparisons.

> means greater then.

5 > 3 would return true (1)
3 > 5 would return false (0)
3 > 3 would return false (0)


< means less then.

5 < 3 would return false (0)
3 < 5 would return true (1)
3 < 3 would return false (0)


== means logically equal.

3 == 5 would return false (0)
3 == 3 would return true (1)

reply...

Posted: Wed Oct 24, 2007 5:40 pm
by goldwingers
Hi Beng

I get that but in your RS232 sample flowcode you ask if the input is anything other than 255 this is then followed by another decision box with the following

What are these char's im supposing they are < & > but what does it do?. the return char's as in the program.....(CHR<>60) AND (CHR<>62)

Cheers Ian

RS232 Question

Posted: Thu Oct 25, 2007 9:22 am
by MW
Hi Guys,

Another RS232 Question. I know from previous threads that the RS232 component assumes a Xtal speed of 19.96MHz and that to adapt this to other Xtals you need to edit the C code.

Could you please elaborate on this a little. Specifically what (register?) do you edit and how do you derive what the new value should be for the new Xtal.

Thanks
MW

Posted: Thu Oct 25, 2007 9:38 am
by Benj
Hello Ian

In the example CHR <> 60 means not equal to 60.

eg

if CHR = 59 then CHR <> 60 returns true (1)
if CHR = 60 then CHR <> 60 returns false (0)

You can also use the following instead to do the same function

CHR != 60

Posted: Thu Oct 25, 2007 9:39 am
by Benj
Hello MW

The clock speed in Flowcode is set via the Chip -> Clock Speed menu.

Once this setting has been set correctly you can go into the properties for the RS232 component and adjust the baud rate accordingly.

No edits to the C code are required.

One last thing

Posted: Thu Oct 25, 2007 10:34 am
by goldwingers
What is CHR 60 ?

and why do you filter it out?

sorry thats 2 things

Ian

Posted: Thu Oct 25, 2007 11:19 am
by Steve
60 is "<" and 62 is ">".

I've not seen the program, so I don't know why those two characters are filtered out. Presumably it is part of the communication from the PC.