Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesct
themeEclipse
titleFloodlight.sct
scchart BlinkyModel {
    
    @Wrapper Clock, "500"
    input bool clock;
    
    @Wrapper DigitalWrite, "13"
    output bool light;
    
    initial state lightOff
    --> lightOn with clock / light = true;
    
    state lightOn
    --> lightOff with clock / light = false;
}

...

The available wrapper code snippets are defined in the snippets assets directory of the project in ftl files (FreeMarker template files). In the default configuration of a new SCCharts project for Arduino, the file main.ftl is processed to create the entry point of the program. Thus it includes other templates containing the available code snippets. The table below gives an overview of the available wrapper code snippets.

Note: To view ftl files with highlighting, you may want to install the FreeMarker IDE feature from the JBoss Tools. However, this is not necessary to work with KIELER. JBoss Tools is available in the Eclipse Market Place and via update site. The update site for stable releases is http://download.jboss.org/jbosstools/neon/stable/updates/ . Note that only the FreeMarker IDE feature is required (Abridged JBoss Tools > FreeMarker IDE).

...

Build the project:

With the mouse over the SCT file in the project explorer, perform Right Click > Run As > KiCo Compilation.

A launch config is created, which compiles the model to C code and creates wrapper code from the annotations in the model file. Afterwards this output is compiled and deployed to the Arduino board, by using the launch shortcut from the Arduino Plugin. If any errors occur, you can see them in the Console View.

For a deeper understanding of the project launch and initialization, take a look at the wiki page for PromAfter the modeling is done, the project can be built. Select Project > Build Project. This will create a new folder kieler-gen with the compiled model file. Further the wrapper code is processed. After the build finished sucessfully, the ino file for the project has been updated with the new wrapper code for the model, and thus the project can be deployed to the Arduino board. The Eclipse Arduino Plugin provides an upload button for this task in the toolbar.

Simulating the model

A simulation of models is created as part of a build inside kieler-gen/sim/bin. To use these simulations, first change to the Simulation Perspective, which provides new buttons in the toolbar. The executables in the bin folder can then be launched via Right Click > KIELER Simulation. The output of a running simulation can be seen in the Data Pool View.

Available Wrapper Code Snippets

...