Page 1 of 1

Lost with compile error

Posted: Sat Feb 26, 2022 1:22 am
by alanwms
IS there a chance you can look at the list of errors and help me figure out what I did wrong?

Re: Lost with compile error

Posted: Sat Feb 26, 2022 7:42 am
by p.erasmus
Hi ,
It seems all the errors has to do with the UART and string handling functions,
I would first comment the UART and all string macro's out to see what happens

Re: Lost with compile error

Posted: Mon Feb 28, 2022 10:33 am
by medelec35
Hi Alan.
The issue is with

Code: Select all

Closed_loop_PWM2
user macro.
On the yes branch of

Code: Select all

AN1_current_HP > PWM2_Current_Target OR AN1_current_HP = PWM1_Current_Target
the is an undefined Goto Connection point.
I'm guessing it was set for some other connection point e.g B, but that has been deleted?
That would cause this issue.
The no branch also makes the code continue to the end, so the decision branch is redundant.
It can be removed or disabled unless you have just posted a cut down version?

Re: Lost with compile error

Posted: Tue Mar 01, 2022 2:49 am
by alanwms
You the man! Thanks.

Re: Lost with compile error

Posted: Tue Mar 01, 2022 8:06 am
by medelec35
For future reference how the error could be found.
1. Make sure you don't have the word error within the project title, so rename.
2. Compile to hex.
3. Either open project Name.msg.txt
or
select Build ribbon, Compiler messages.
Select a blank area within compiler messages text, hold ctrl and press a to select all, then ctrl c to copy (or use the right mouse button)
Run notepad or any text viewer, use ctrl v (or right-click mouse button) and paste within text viewer.
4. Left-click anywhere at the top of the text editor and search (normally ctrl f) for the word error.
In this case, you should see:
Error found.png
Error found.png (4.6 KiB) Viewed 2727 times
That tells you to look for a label (a goto) within FCM (FlowCode user Macro) Closed_loop_PWM2_B

Re: Lost with compile error

Posted: Thu Mar 03, 2022 8:13 pm
by alanwms
Thank you Martin - I did catch the PCC_Closed_loop_pwm2_B, but could not figure out where the "B" came from. I though that was the full name but apparently, it was a goto indicator.
Glad you put this down for me. I was going to ask how I can find this stuff, but felt a little pushy!

I compiled another program with a goto (with nowhere to go to), and went through the steps above - Worked great

Thanks again

Re: Lost with compile error

Posted: Fri Mar 04, 2022 11:48 am
by BenR
Regarding this line of code.

Code: Select all

AN1_current_HP > PWM2_Current_Target OR AN1_current_HP = PWM1_Current_Target
This will be doing a binary OR and not a boolean comparison OR which is I beleive is what you are after.

Try this instead.

Code: Select all

(AN1_current_HP > PWM2_Current_Target) || (AN1_current_HP = PWM1_Current_Target)

Re: Lost with compile error

Posted: Fri Mar 18, 2022 1:15 pm
by alanwms
Thanks Ben - Not sure of the difference here. Are you pointing out the parentheses? or are you pointing to a difference betweed "or" and "||"

Re: Lost with compile error

Posted: Fri Mar 18, 2022 2:33 pm
by medelec35
Hi Alan.
The parentheses makes sure that calculations or conditions are completed in the correct order.
Using

Code: Select all

||
instead of

Code: Select all

 OR
is vital for the condition to work, so that is the main point.

Re: Lost with compile error

Posted: Fri Mar 18, 2022 7:31 pm
by alanwms
Thank you!