State map compilation error

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
niedian
Posts: 85
http://meble-kuchenne.info.pl
Joined: Thu Jan 07, 2021 11:28 am
Has thanked: 3 times
Been thanked: 4 times

Flowcode v10 State map compilation error

Post by niedian »

Hello, I would like to use a state diagram as an example of a running light. Why is there a compilation error and only one light flashing during simulation? Help me! (The program is attached)
Attachments
Flowcode1.fcfx
(52.7 KiB) Downloaded 261 times

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 286 times
Been thanked: 412 times

Re: State map compilation error

Post by chipfryer27 »

Hi

I don't have the capabilities to compile to your chip on this machine, however from your chart I assume you are trying to "run" your LEDs much like "Knight Rider's " car.

If so, your C-Code seems to be the issue. Instead of using C-Code to calculate the value of "n" if you instead just use "calculation" with n=n+1 and later n=n-1 it should work.

Well it at least simulates OK with me.

Regards

niedian
Posts: 85
Joined: Thu Jan 07, 2021 11:28 am
Has thanked: 3 times
Been thanked: 4 times

Re: State map compilation error

Post by niedian »

Hello chipfreer27, thank you. I have modified it to calculate "n=n+1" in the "calculation" and now it runs normally in the simulation window. However, when writing the program to the chip, there was still a compilation error. I have sent a screenshot below, please help me take a look. Thank you!
Attachments
5.png
5.png (137.71 KiB) Viewed 5388 times
4.png
4.png (261.47 KiB) Viewed 5388 times
1.png
1.png (100.97 KiB) Viewed 5388 times

niedian
Posts: 85
Joined: Thu Jan 07, 2021 11:28 am
Has thanked: 3 times
Been thanked: 4 times

Flowcode v10 Re: State map compilation error

Post by niedian »

Here is a clearer screenshot
Attachments
7.png
7.png (349.61 KiB) Viewed 5388 times
8.png
8.png (354.43 KiB) Viewed 5388 times
9.png
9.png (273.13 KiB) Viewed 5388 times

Steve-Matrix
Matrix Staff
Posts: 1257
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 168 times
Been thanked: 279 times

Re: State map compilation error

Post by Steve-Matrix »

Thanks for the error report. I see what the issue is. The following fix should allow the project to compile correctly:

Edit the "Main" macro and add a call to LED_Array1::AllOff() before you call your state diagram macro, like this:
Attachments
State diagram error fix.png
State diagram error fix.png (13.06 KiB) Viewed 5361 times

niedian
Posts: 85
Joined: Thu Jan 07, 2021 11:28 am
Has thanked: 3 times
Been thanked: 4 times

Re: State map compilation error

Post by niedian »

Thank you, Steve Matrix. After modifying the program, download it to the chip and the hardware runs normally. Thank you.

Post Reply