Page 1 of 1

RS232 unable to receive "0" byte

Posted: Tue Feb 04, 2014 8:58 pm
by zadah
Hello

Again troubleshooting FC6 ( I am trying to port my FC5 program to FC 6, but there is continuosly some errors :( )

Now I am stuck with rs232 receive component. The problem is I cant receive "0" byte in FC6 This is possible in FC 5 by selecting "extended" datatype. What does the receive type 16 bit in FC6 mean ? (That doesnt solve the problem anyway...)

Re: RS232 unable to receive "0" byte

Posted: Tue Feb 04, 2014 9:03 pm
by zadah
For example this is what my touchscreen sends to PIC(18f4523) as a MODBUS master:

01 03 00 01 00 07 55 c8

And this is what my PIC "sees" :

01 03 01 07 55 c8, there is zeros missing, so the MODBUS slave wont work.


Above is workin correctly with FC 5...

Re: RS232 unable to receive "0" byte

Posted: Wed Feb 05, 2014 12:44 pm
by Benj
Hello,

Are you able to attach your program to the forums and I will have a look into the problem for you.

Re: RS232 unable to receive "0" byte

Posted: Wed Feb 12, 2014 3:30 am
by zadah
Is there any solution for this problem? Or should i stay on FC5?

Re: RS232 unable to receive "0" byte

Posted: Wed Feb 12, 2014 11:37 am
by Benj
Hello,

I've compared the v6 C code with the v5 C code for the ReceiveString function and cannot find any major differences. Certainly nothing that would prevent a '0' character coming through.

There are some string functions being called as part of the v6 call so I will investigate these and see if they could be having an impact.

Edit: Found the bug, this will be fixed for you in the next release of Flowcode 6.

We were basically doing this string = string + incomingcharacter.

However the string = string + will search through the string to find the '0' null terminator which means when you add the next byte the null will be misread as the end of the string and overwritten.

Now changed to use this syntax instead string[index] = incomingcharacter.

I'll make a note to hunt through other string macros and make sure this problem doesn't exist elsewhere.

Re: RS232 unable to receive "0" byte

Posted: Mon Mar 17, 2014 3:41 pm
by Rudi
Hi Benj,

i have a question to this:

I must take receice Bytes for the RS232.

How i can managed this temporally to next fix, that i can get the 0 Byte

Can you please give me a instruct - perhabs in your post you have posted - but i am not sure and perhabs i have not understand your "tip".

If i have a variable for incomming byte like "bIncom"
so i will write in RS232 Makro for Ret "bIncom"

how did you mean this "string= string + incommingcharacter"

string[index] = incomingcharacter.


can you give me a tip?

Best wishes! And thank you for your Time and Help!

Rudi
;-)

Re: RS232 unable to receive "0" byte

Posted: Mon Mar 17, 2014 4:08 pm
by Benj
Hi Rudi,

Sorry it was down to a bug in the component. It has now been fixed and will work the way you want it to. We are waiting on a release to go out which will include this update. Hopefully the release should be available to download later this week.

Not sure if this will work or not but here is the current version of the RS232 component, place the file into the "Flowcode 6/Components" directory and restart Flowcode to load the changes.

Re: RS232 unable to receive "0" byte

Posted: Mon Mar 17, 2014 6:23 pm
by Rudi
Hi Benj,
at first thank you for your service and your time.

i have rename the orig "RS232.fcpx" to "RS232.fcpx.old604"

i have place the rs232.in FC6\components folder,
restart FC6
new projekt...
try to add from "Comms" a RS232

in this time a WindowMessage popup
"Failed to add the component: RS232"

Must i do anything else more?


Best wishes to you and again, thank you for your great service!!!

Rudi
;-)

Re: RS232 unable to receive "0" byte

Posted: Fri Mar 21, 2014 5:37 am
by zadah
I am still on FC5 because of this kind of problems :( I dont have time to troubleshoot FC6 related errors.

Re: RS232 unable to receive "0" byte

Posted: Fri Mar 21, 2014 3:03 pm
by Rudi
zadah wrote:I am still on FC5 because of this kind of problems :( I dont have time to troubleshoot FC6 related errors.
Hi zadah,
how you have managed the Software Uart to fix it to 38400 - there is still "saying Baudrate is not supported" ..
i think 38400 is to fast for a Software Uart - but i would test it if you can say me how you have managed this.
Thank you!
ciao
Rudi
;-)