Page 1 of 1
Receive RS232 string
Posted: Fri May 07, 2010 6:30 am
by Adrien DG
Good morning !!
I'd like to receive a string from RS232, but I don't understand what kind of parameters I've to put in the RS232 routine
Example,
If I receive the string "COMPTEUR" from RS232, i send the value of a variable by RS232
Thanks you for your help
Re: Receive RS232 string
Posted: Fri May 07, 2010 9:02 am
by Steve
You should use the "ReceiveRS232String" macro of the RS232 component. There should be some examples of this in the collection of Flowcode examples on the Flowcode CD.
Re: Receive RS232 string
Posted: Fri May 07, 2010 9:17 am
by Adrien DG
Ok, I've seen it !
Thank you !!
Re: Receive RS232 string
Posted: Thu May 27, 2010 6:10 am
by Adrien DG
Hello,
I come back to you for my problem of RS232 receive string
I receive a string for example : " TEST "
If the string I receive is "TEST", I send a value, for example 10000
else I send an ERROR message.
I've used the compare() fonction in string manipulation block, but that don't runs...
Could you explain me how can I do it ?
Thant you !!!
Bye
Re: Receive RS232 string
Posted: Thu May 27, 2010 8:57 am
by Benj
Hello Adrien,
The string manipulation compare function returns a 0 when the strings match. Could this be the problem. I assure you it does work

Re: Receive RS232 string
Posted: Thu May 27, 2010 10:35 am
by Adrien DG
Hello BenJ,
Yes I've seen a French Manual about flowcode, and I saw in it the use of this function
Look at my example,
If I send a "A", and I compare with a "A", I always receive a False
For sure I don't have understood one thing.
Re: Receive RS232 string
Posted: Thu May 27, 2010 1:01 pm
by Benj
Hello,
It might be worth collecting the length of the string and the contents of the string and echoing these values back also with the RS232 on a Error. This will show you what the microcontroller is seeing as received.
Other then this you can also check single characters from the string one by one using decision icons.
EG
RECEPTION[0] = 'A'
Re: Receive RS232 string
Posted: Mon Jun 14, 2010 9:29 am
by Adrien DG
Hello BenJ,
thank you, that runs very well,
but now, I've another question ...
How can I program an Interrupt on the Rx pin ? Using the RXINT ??
Thank you in advance
Re: Receive RS232 string
Posted: Mon Jun 14, 2010 9:46 am
by Benj
Hello,
Attached is an interrupt example of your earlier program.
You just need to ensure you use the dummy read component macro to enable the UART receive functionality before the interrupt will start working.
Re: Receive RS232 string
Posted: Mon Jun 14, 2010 10:53 am
by Adrien DG
Thank you so much BenJ,
I'll try this !!
Re: Receive RS232 string
Posted: Wed Jun 16, 2010 5:38 am
by jgu1
Hi!
I have follow this line. I have a question, What is the "11,11" in the Component Macro under variable?
Thank´s
Regard Jørgen
Re: Receive RS232 string
Posted: Wed Jun 16, 2010 9:54 am
by Benj
Hello Jorgen.
The 11, 11 are values that are passed to the component macro call as parameters.
Looking at the help file for the component will explain the parameters meaning and role in the function.
The first is the number of iterations to wait before returning a no data received value. This is not needed as we are using the interrupt so you could change this to 1 if you like.
The second is the number of bytes to try and receive into the string variable before a timeout occurs.