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...)
RS232 unable to receive "0" byte
Moderator: Benj
-
- Posts: 31
- Joined: Wed May 02, 2012 5:49 pm
- Has thanked: 3 times
- Been thanked: 7 times
- Contact:
Re: RS232 unable to receive "0" byte
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...
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...
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 unable to receive "0" byte
Hello,
Are you able to attach your program to the forums and I will have a look into the problem for you.
Are you able to attach your program to the forums and I will have a look into the problem for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 31
- Joined: Wed May 02, 2012 5:49 pm
- Has thanked: 3 times
- Been thanked: 7 times
- Contact:
Re: RS232 unable to receive "0" byte
Is there any solution for this problem? Or should i stay on FC5?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 unable to receive "0" byte
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: RS232 unable to receive "0" byte
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
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 unable to receive "0" byte
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.
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 302 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: RS232 unable to receive "0" byte
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
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
-
- Posts: 31
- Joined: Wed May 02, 2012 5:49 pm
- Has thanked: 3 times
- Been thanked: 7 times
- Contact:
Re: RS232 unable to receive "0" byte
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
Hi zadah,zadah wrote:I am still on FC5 because of this kind of problems I dont have time to troubleshoot FC6 related errors.
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