Page 1 of 2

2D Dashboard running simulation

Posted: Fri Mar 01, 2024 1:19 pm
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

Re: 2D Dashboard running simulation

Posted: Fri Mar 01, 2024 2:10 pm
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?

Re: 2D Dashboard running simulation

Posted: Mon Mar 04, 2024 11:38 am
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 477 times
Dashboard LEDs not initialising on re-run
Dashboard LEDs not initialising on re-run
2D_Dashboard_Not_Initialising.png (234.99 KiB) Viewed 477 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 477 times

Re: 2D Dashboard running simulation

Posted: Mon Mar 04, 2024 11:42 am
by Qualcomm5
The source project...
Hello_World_With_Switch_LEDs_And_Display.fcfx
(42.26 KiB) Downloaded 22 times

Re: 2D Dashboard running simulation

Posted: Mon Mar 04, 2024 12:06 pm
by Steve-Matrix
Thanks, I can see the problem and will try to sort it.

Re: 2D Dashboard running simulation

Posted: Mon Mar 04, 2024 2:38 pm
by Qualcomm5
Thanks Steve, entirely appreciated.

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

Re: 2D Dashboard running simulation

Posted: Mon Mar 04, 2024 9:21 pm
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).

Re: 2D Dashboard running simulation

Posted: Tue Mar 05, 2024 12:09 pm
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

Re: 2D Dashboard running simulation

Posted: Tue Mar 05, 2024 12:32 pm
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.

Re: 2D Dashboard running simulation

Posted: Tue Mar 05, 2024 2:39 pm
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 422 times
Library_Updates__Files_In_Use.png
Library_Updates__Files_In_Use.png (11.65 KiB) Viewed 422 times
Library_Updates__Full_Database_Files_In_Use.png
Library_Updates__Full_Database_Files_In_Use.png (35.1 KiB) Viewed 422 times