Difference between revisions of "Starting Flowchart Simulation"

From Flowcode Help
Jump to navigationJump to search
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<sidebar>Sidebar: Overview of Simulation</sidebar>
+
[[File:Simulation_Icons.png|left]]
[[File:Gen_Main_Toolbar_Simulation_Labelled.png|left]]
+
To simulate a flowchart from the start of Main, select the 'Run' option from the 'Debug' ribbon (Debug > Run), click the 'Run' [[File:Btn_Run.png]] button on the [[Tools and Views#10) Main Toolbar|main toolbar]] or press '''F5'''. Flowcode will go into simulation mode and will start to execute the icons in the flowchart. A red rectangle indicates the icon that is about to be executed.
  
 +
Alternatively, you can choose to start within any user-created macros by first selecting either the user macro from the [[Using_the_Project_Explorer|project explorer]] (outlined in Blue) or From the user macro (outlined in green) you wish to start from.
 +
In the example below:
 +
[[File:Run_from_user_macro.png]]
 +
I have chosen 'Altitude', then select the down arrow just below the word Run.
 +
You will see there is another Run icon with the words Run (Altitude).
 +
When you left-click on it, the simulation will start from the within the first icon of the 'Altitude' user macro
  
To simulate a flowchart, select the Go/Continue option from the Debug menu or press '''F5'''. Flowcode will go into simulation mode and will start to execute the icons in the flowchart. A red rectangle indicates the icon that is about to being executed. The variables, call stack and chip windows are updated on every step of the simulation. In addition, if there are external components attached to the microcontroller then their state is shown in the panel.
+
The [[Simulation Debugger]] and [[Tools and Views#3) Chip View|Chip View]] windows are updated on every step of the simulation. In addition, if there are external components attached to the microcontroller then their state is shown in the panel.
  
  
Simulations can be paused or finished by selecting either the Pause or Stop options from the Debug menu or selecting them from the simulation section of the main toolbar.
+
Simulations can be paused or stopped by selecting either the 'Pause' or 'Stop' options from the 'Debug' menu or selecting them from the simulation section of the [[Tools and Views#10) Main Toolbar|main toolbar]].
  
  
If the flowchart is being simulated as fast as possible then Flowcode will update the Macro Calls, Variables (Simulation Debugger) and Microcontroller (Chip) views when the simulation is paused. A red rectangle will appear around the next icon that is due to be simulated.
+
If the flowchart is being simulated as fast as possible then Chip view and Macro Calls and Variables values in the Simulation Debugger will not be updated until the simulation is paused. A red rectangle will appear around the next icon that is due to be simulated.
  
  
Alternatively if you wish to [[Simulating Icons Step by Step|simulate the flowchart step by step]] from the start, then use the Step option from the Debug menu or press '''F8'''.
+
Alternatively, if you wish to [[Simulating Icons Step by Step|simulate the flowchart step by step]] from the start, then use the 'Step Into' by pressing '''F8''', you can also 'Step Over' icons by pressing '''Shift+F8''' you can also access these options from the 'Debug' menu or by clicking the buttons on the main toolbar.
  
  
Line 18: Line 24:
  
  
Enable ICD mode by going to the 'Debug Options' tab in the [[Project Options]] window. After this option has been enabled you will be able to swap between simulation and ICD mode via the "ICD mode" option in the 'Debug' menu.
+
Enable ICD mode by going to the 'Debug Options' tab in the [[Project Options]] window. After this option has been enabled you will be able to swap between simulation and ICD mode via the 'ICD mode' option in the 'Debug' menu.
  
  
 
Some of the components do not have a simulation feature. These components have a red box drawn around them when they are displayed on the panel. The red box indicated that the component will dissapear when the simulation is running.
 
Some of the components do not have a simulation feature. These components have a red box drawn around them when they are displayed on the panel. The red box indicated that the component will dissapear when the simulation is running.

Latest revision as of 13:50, 22 December 2022

Simulation Icons.png

To simulate a flowchart from the start of Main, select the 'Run' option from the 'Debug' ribbon (Debug > Run), click the 'Run' Btn Run.png button on the main toolbar or press F5. Flowcode will go into simulation mode and will start to execute the icons in the flowchart. A red rectangle indicates the icon that is about to be executed.

Alternatively, you can choose to start within any user-created macros by first selecting either the user macro from the project explorer (outlined in Blue) or From the user macro (outlined in green) you wish to start from. In the example below: Run from user macro.png I have chosen 'Altitude', then select the down arrow just below the word Run. You will see there is another Run icon with the words Run (Altitude). When you left-click on it, the simulation will start from the within the first icon of the 'Altitude' user macro

The Simulation Debugger and Chip View windows are updated on every step of the simulation. In addition, if there are external components attached to the microcontroller then their state is shown in the panel.


Simulations can be paused or stopped by selecting either the 'Pause' or 'Stop' options from the 'Debug' menu or selecting them from the simulation section of the main toolbar.


If the flowchart is being simulated as fast as possible then Chip view and Macro Calls and Variables values in the Simulation Debugger will not be updated until the simulation is paused. A red rectangle will appear around the next icon that is due to be simulated.


Alternatively, if you wish to simulate the flowchart step by step from the start, then use the 'Step Into' by pressing F8, you can also 'Step Over' icons by pressing Shift+F8 you can also access these options from the 'Debug' menu or by clicking the buttons on the main toolbar.


Changing the speed of a simulation can be done by altering options within the Project Options.


Enable ICD mode by going to the 'Debug Options' tab in the Project Options window. After this option has been enabled you will be able to swap between simulation and ICD mode via the 'ICD mode' option in the 'Debug' menu.


Some of the components do not have a simulation feature. These components have a red box drawn around them when they are displayed on the panel. The red box indicated that the component will dissapear when the simulation is running.