Solved:Please Help, error while compiling my project

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

Moderator: Benj

Post Reply
User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Solved:Please Help, error while compiling my project

Post by tiny »

Hello,
I have my Flowcode updated on FC7 and tried my project, created with FC6 and run on my board, to compile it.
Enclosed is a simple flowchart without function, but it generates the same error when compiling as in my project.
I am using a PIC18F26K22. All timer greater Timer 3 bring this error and a "Goto Connection Point" only works in the main chart, not in the macros, but I also need this function to save code.

Can someone please help me there?
Thanks
Tiny
Flowcode1_18f26k22.fcfx
(9.88 KiB) Downloaded 328 times
Flowcode1_18f26k22.msg.txt
(1.24 KiB) Downloaded 305 times
Last edited by tiny on Sun Sep 11, 2016 6:38 pm, edited 1 time in total.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Please Help, error while compiling my project

Post by QMESAR »

Hi ,
In my opinion there is an error in the FCD file for the 18F26K22 as the compiler does not find a structure member T5Conbits.RD16 the same effect is for Timer 3 and higher
as a work around till one of the more experience people can correct the FCD use Timer1, I just compiled your Flowchart with Timer 1 selected see screen shot attached

@Benj what concerns me also is the unreachable code sections that the compiler shows for FCM_1 module
Attachments
wer.JPG
wer.JPG (46.06 KiB) Viewed 13639 times

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Re: Please Help, error while compiling my project

Post by tiny »

Thanks for the quick response, but as mentioned the flowchart is an example without function. In my project I'm using 4 timers, that Timer 1-3 function does not help me further.
I also have ,to save code, in 3 macros jump functions.
My only current alternative is to work with FC6 on.

Tiny

PS: by dsPIC33EP256P504 (my next favorite) there is no such problems!

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Please Help, error while compiling my project

Post by QMESAR »

Aha Ok well then if you need the timers then MATRIX will fix the FCD file for you on monday I guess
the dsPIC33EPxxxPxxx is a great micro controllers in my opinion :D I really like the dsPIC' they have very good performance and peripherals

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Please Help, error while compiling my project

Post by kersing »

Attached a fixed version of the FCD file. Drop in ..\Flowcode 7\FCD\PIC (make a copy of the original first, just in case)

@Benj: For timer3 and timer5 RD16 needs to be replaced with RD163 and RD165.

Regarding the connection point, when looking at the generated code I do not see what issue you are experiencing? Is the issue in simulation or on the target controller?
Attachments
18F26K22.fcdx
(36.68 KiB) Downloaded 295 times
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Re: Please Help, error while compiling my project

Post by tiny »

Thank you for FCD File.
The other error messages make me uneasy simply because I will not know if the program works properly on the chip. It's just too large to fit as quickly find an error. I try it just with FC7 as I hope to get a leaner code because I have free from the 64K only 2k.
Thanks again!
Tiny

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Please Help, error while compiling my project

Post by kersing »

The warning messages are generated because you are adding jumps to the program, so the code generated by Flowcode will have sections that are unreachable by definition as you jumped out of that program flow. The only solution for that issue is not to use connection points and use a flag with decisions to get the same result. Using a flag and decisions should not result in large overhead if you structure your code right.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Please Help, error while compiling my project

Post by QMESAR »

The warning messages are generated because you are adding jumps to the program, so the code generated by Flowcode will have sections that are unreachable by definition as you jumped out of that program flow
This is interesting I thought also it is the jump points causing this , I removed the jump points and placed a While 1 loop with only the timer Interrupt and compiled and it again
showed the message unreachable code section ,
Not sure why this happend :D

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Re: Please Help, error while compiling my project

Post by tiny »

Thanks for your support!
But I still have some problems.
The appendix in PDF File, the yellow shaded error messages: how can I find the error in the Flowchart, to search for the cause of the error?
Tiny
Compiler Messages.pdf
(9.19 KiB) Downloaded 389 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Please Help, error while compiling my project

Post by kersing »

You can not find the errors because they are not related to a specific line of code. The messages point to a lack of flash, the compiler/linker can not find space for all code.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Re: Please Help, error while compiling my project

Post by tiny »

Hi, I thought so and that's why I started to exclude possible errors. Search lice!
I have a voltage monitor for mains and battery voltage in my program. If the power fails or low battery voltage a SMS is sent.
This can be calculated and prepared as follows:

TransEEpr = TransEEpr + StrVolt
.SpgFloat = fdiv (Spg_Netz,41)
TmpNumber = FloatToString$ (.SpgFloat) <- Here an error
TmpNumber = Mid$ (TmpNumber,0,4) <- Here an error
TransEEpr = TransEEpr + TmpNumber
TransEEpr = TransEEpr + "V"
TransEEpr = TransEEpr + "\r"
TransEEpr = TransEEpr + StrAccu
.SpgFloat = fdiv (Spg_Accu,41)
TmpNumber = FloatToString$ (.SpgFloat) <- Here an error
TmpNumber = Mid$ (TmpNumber,0,4) <- Here an error
TransEEpr = TransEEpr + TmpNumber
TransEEpr = TransEEpr + "V"
TransEEpr = TransEEpr + "\r"

The voltage monitor is invoked every minute via a timer, when it comes to fault a macro with the appropriate parameter passing (GSM_Log) is called, and in this macro is the problem.
So a long way from the error message to the source!
And the nice thing is that in FC6 everything works!
How many errors are still appearing ???

Tiny

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Please Help, error while compiling my project

Post by kersing »

Float takes a lot of memory, isn't there a solution that does not require floating point maths to save memory? If you need a limited number of digits behind the decimal point, consider storing Spg_Net in a long, multiply by 100 (for 2 digit) or 1000 (3 digits) before dividing. Then use the value / 100 (or 1000) for the digits before the decimal point and the remainder (% operator) for the digits after the decimal point.

FC6 uses a different floating point library that might just fit.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Re: Please Help, error while compiling my project

Post by tiny »

Behind these routines are timers that can get the timeout values up to 30 minutes. These values are transmitted via WLAN from a PC program. After an adjustable time the entire circuit, which is supplied by then a battery, switched off. For this reason, I just can not only work with byte or Integer.
So it looks like I may have to revise the entire program.
The only reason why I switched to FC7 is that MatrixTSL sold no ChipPack for PIC16 for FC6 because FC6 was adjusted in sales.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Please Help, error while compiling my project

Post by kersing »

Sorry but I don't see why timers or data from a wlan module mandate the use of floats, however I clearly don't have all the information you have. (note I mention long integer, not byte or integer. Longs can hold values up to 2^32)
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Re: Please Help, error while compiling my project

Post by tiny »

I can send you the Flowchart by PM, but it will probably be like a black hole on the time required to look through everything. I do not want to publish here in the forum, because too much of heart and soul in this project.

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Solved: Please Help, error while compiling my project

Post by tiny »

Problem solved!
This time I was able to locate and fix (the) error.
Initially, the error described above. After I turned off all the icons that performed calculations, came this error:

.........
0: (499) undefined symbol:
_reset(FourChannelTimer_26K22_Light_V7.obj)

It is to despair! What please is an "undefined symbol" where it all icons are used only from Flowcode?

After a long search the solution: C-Code
Bild2.jpg
Bild2.jpg (25.28 KiB) Viewed 13548 times
After I had the icon deleted, re-inserted and filled with the same command, everything was suddenly without error.

Detail: when I had FC6 functions such Nettime and Email via GSM remove because no program memory was present (99% in use without Nettime and email!).
With FC7 with these functions to get to about 70%!

That comforts me across the hassles of troubleshooting. I'm excited!

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Please Help, error while compiling my project

Post by QMESAR »

:D Great news happy you solved the issue I was worried on your part about this
Good luck

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Re: Please Help, error while compiling my project

Post by tiny »

A small mistake on my part: I had turned off a block of code (WLAN), so about 70% program memory in use. Now I'm at 98%, but is better than with FC6!
There is also a problem when you call another macro from a macro. When FC6 it ran, with FC7 should I do differently.

Post Reply