2D Dashboard running simulation

Use this section to discuss your embedded Flowcode projects.
Qualcomm5
Posts: 11
http://meble-kuchenne.info.pl
Joined: Wed Dec 20, 2023 2:13 pm
Has thanked: 6 times
Been thanked: 4 times

Flowcode v10 2D Dashboard running simulation

Post by Qualcomm5 »

Hi everyone.

I'm creating a simulation program for Flowcode training purposes, using the simple/lightweight 2D dashboard that I only use for setting up component parameters and lightweight simulation for debug.

However, creating a simple LED array (binary bit representation) sitting above a simulated LCD graphic, where the LCD represents the numerical value of a variable passed to the port driving the LEDs, the persistent prior state of LEDs (not being updated on simulation restart) can only add confusion when moving on to discuss and demonstrate bit-masking - unless I tell my students they must close Flowcode and restart to re-run simulation.

I'm hoping the simple 2D dashboard hasn't been deprecated and forgotten, so just asking if anyone else has a workaround to resolve graphical persistence in the dashboard? In other words, individual LEDs (active High) remain 'On' once set, and not reset on restarting the simulation with their associated port bits first set to all zero's.

Many thanks,
Brendan

Steve-Matrix
Matrix Staff
Posts: 1253
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: 2D Dashboard running simulation

Post by Steve-Matrix »

Can you set the port to zero with an Output icon at the beginning of your project to force the LEDs to reset?

Qualcomm5
Posts: 11
Joined: Wed Dec 20, 2023 2:13 pm
Has thanked: 6 times
Been thanked: 4 times

Flowcode v10 Re: 2D Dashboard running simulation

Post by Qualcomm5 »

Hi Steve.

As a matter of course (emphasising good programming practice to students), I expressly initialise all LED-driving ports to zero, which originally highlighted this issue. However, I found a 'fudge' that appears to largely resolve dashboard persistence in the binary-representative display.

I provide three screenshots which include the start of the program...

1st simulation run with port initialisation icons enabled and fudge disabled. Allowed to loop-count to 10.
2nd - Simulation stopped, then restarted, and stopped at loop-count of 1, showing LED persistence from previous run.
3rd - Simulation re-run with fudge icons enabled.

Certainly something going on between PC speed/run-time timings and the dashboard, where the dashboard isn't always getting initialised before the debug simulation starts to run. This is obviated further by slowing the simulation down.

Thanks and best regards,
Brendan
2D_Dashboard_Initial_Run.png
2D_Dashboard_Initial_Run.png (235.08 KiB) Viewed 318 times
Dashboard LEDs not initialising on re-run
Dashboard LEDs not initialising on re-run
2D_Dashboard_Not_Initialising.png (234.99 KiB) Viewed 318 times
Fudge applied, but also requires slow simulation for reliability
Fudge applied, but also requires slow simulation for reliability
2D_Dashboard_Initialising_With_Alternation.png (234.98 KiB) Viewed 318 times
Last edited by Qualcomm5 on Mon Mar 04, 2024 11:50 am, edited 3 times in total.

Qualcomm5
Posts: 11
Joined: Wed Dec 20, 2023 2:13 pm
Has thanked: 6 times
Been thanked: 4 times

Flowcode v10 Re: 2D Dashboard running simulation

Post by Qualcomm5 »

The source project...
Hello_World_With_Switch_LEDs_And_Display.fcfx
(42.26 KiB) Downloaded 15 times

Steve-Matrix
Matrix Staff
Posts: 1253
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: 2D Dashboard running simulation

Post by Steve-Matrix »

Thanks, I can see the problem and will try to sort it.

Qualcomm5
Posts: 11
Joined: Wed Dec 20, 2023 2:13 pm
Has thanked: 6 times
Been thanked: 4 times

Re: 2D Dashboard running simulation

Post by Qualcomm5 »

Thanks Steve, entirely appreciated.

I'm running an introductory training session this week, though can easily work around for the time being :)

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: 2D Dashboard running simulation

Post by medelec35 »

Hello.
I have made a minor change to the LED Mono component.
Can you try it and if you are happy with it, I will roll it out on all the 2D LEDs

To try the updated component.
Browse to this location using file explorer , it's hidden by default so just paste the link into your address bar.

Code: Select all

C:\ProgramData\MatrixTSL\FlowcodeV10\Components
Place the attached component.
If Flowcode is already open, then you will need to reload your project for the new component to work
If you run any component updates, then the component you added will be overwritten, so it will stop working again (unless the component update has been pushed).
Attachments
LED_Mono_2dgi.fcpx
(7.02 KiB) Downloaded 16 times
Martin

Qualcomm5
Posts: 11
Joined: Wed Dec 20, 2023 2:13 pm
Has thanked: 6 times
Been thanked: 4 times

Re: 2D Dashboard running simulation

Post by Qualcomm5 »

Hi Steve.
Many thanks for providing the updated component to try, though sadly no change.

My original suspicions related to possible timings, though I observe the same behaviours when stepping through from start with F8 on each occasion.

Best regards,
Brendan

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: 2D Dashboard running simulation

Post by medelec35 »

Hi Brendon.
Before the component change, If I stepped through the code with the switch on, then after LED on A1 and A2 toggled, I switched the switch off and single stepped a few more times, until just LED on A2 is lit
After stopping the simulation and restarting the simulation, repeating above, both LEDS lit.
With the updated component it does not.
Can you select Help > Library Updates.. and take a screenshot and post the Updates windows, please.
Martin

Qualcomm5
Posts: 11
Joined: Wed Dec 20, 2023 2:13 pm
Has thanked: 6 times
Been thanked: 4 times

Re: 2D Dashboard running simulation

Post by Qualcomm5 »

Hi Martin.

I provide the requested screenshots...

"Files In Use" reflects no updates, although "Full Database" does, and also double-checked the correct location of the replaced file (reflected by file date). Just to confirm, I have closed and re-opened FC a few times since replacing the file.

Hopefully this may be of some help.

Thanks and best regards,
Brendan
Replaced LED_Mono_2dgi.fcpx.png
Replaced LED_Mono_2dgi.fcpx.png (155.56 KiB) Viewed 263 times
Library_Updates__Files_In_Use.png
Library_Updates__Files_In_Use.png (11.65 KiB) Viewed 263 times
Library_Updates__Full_Database_Files_In_Use.png
Library_Updates__Full_Database_Files_In_Use.png (35.1 KiB) Viewed 263 times

Post Reply