RS232 unable to receive "0" byte

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
zadah
Posts: 31
Joined: Wed May 02, 2012 5:49 pm
Contact:

RS232 unable to receive "0" byte

Post 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...)

zadah
Posts: 31
Joined: Wed May 02, 2012 5:49 pm
Contact:

Re: RS232 unable to receive "0" byte

Post 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...

User avatar
Benj
Matrix Staff
Posts: 14835
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: RS232 unable to receive "0" byte

Post by Benj »

Hello,

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

zadah
Posts: 31
Joined: Wed May 02, 2012 5:49 pm
Contact:

Re: RS232 unable to receive "0" byte

Post by zadah »

Is there any solution for this problem? Or should i stay on FC5?

User avatar
Benj
Matrix Staff
Posts: 14835
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: RS232 unable to receive "0" byte

Post 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.

User avatar
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am

Re: RS232 unable to receive "0" byte

Post 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
;-)

User avatar
Benj
Matrix Staff
Posts: 14835
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: RS232 unable to receive "0" byte

Post 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.
Attachments
RS232.fcpx
(15.17 KiB) Downloaded 139 times

User avatar
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am

Re: RS232 unable to receive "0" byte

Post 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
;-)

zadah
Posts: 31
Joined: Wed May 02, 2012 5:49 pm
Contact:

Re: RS232 unable to receive "0" byte

Post by zadah »

I am still on FC5 because of this kind of problems :( I dont have time to troubleshoot FC6 related errors.

User avatar
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am

Re: RS232 unable to receive "0" byte

Post 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
;-)

Post Reply