You are on page 1of 23

2016

E4coder
Tenet Technetronics is official Training Partners for

SCILAB.

M.Mohamed Ibrahim
Tenet Technetronics
23-DEC-16

Tenet Technetronics 1
Application Notes

Contents
Chapter 1:
Introduction

....2

Features

Requirements to install E4Coder on Scilab

..3

Chapter 2:
Steps involved E4Coder installation on Scilab

...4

Chapter 3:
E4Coder GUI .....9
Feature

.....9

Steps involved to create a diagram in XCOS

...9

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 2
Application Notes

Chapter 1:
Introduction
E4Coder is a set of tools that can be used to simulate Control Algorithms and to
generate code for Embedded Microcontrollers running with or without a Real Time
Operating System.
E4Coder tools include:

SMCube

- Finite State Machine Modeler

E4Coder GUI - Prototyping tool for Graphic User Interfaces

E4Coder CG - an efficient embedded Code Generator

Features:
1. Simulate continuous and discrete time designs.
2. Edit, simulate and generate code for hierarchical Finite State Machines (FSM)
with parallel states support.
3. Simulate and generate C/C++ code easily from ScicosLab diagrams/XCOS
diagrams for any embedded platform.
4. Generate compact and readable multithread code for embedded models with
multiple rates.
5. Optimized usage of RAM and Flash.
6. Easy retargeting to new MCUs or customized hardware.
7. Generate standalone library code for small microcontrollers without an RTOS.
8. Generate a complete Real-Time project for OSEK/VDX based kernels, using RTOS
Erika Enterprise or other RTOS.
9. Customize the generated code with custom data types and variable names.
10. Create custom blocks to integrate existing legacy applications, functions, and
data in your ScicosLab project.
Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 3
Application Notes
11. Edit and simulate customized embedded panels.

Requirements to install E4Coder on Scilab :

Windows OS

Scilab 5.5.2 (32 or 62 bits)

A supported compiler among the following ones:


1. Microsoft Visual C++ (supported versions: Express edition 2008, 2010);
2. MinGW on Windows, installed in C:\MinGW, from the following package:
http://www.e4coder.com/download/mingw-get-inst-20120426.exe

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 4
Application Notes

Chapter 2:
E4Coder installation on Scilab:
Step 1: We need Administrator Privileges to install E4Coder. To gain Administrator
Privileges, we need to right-click on the Scilab program icon, and select Run as
Administrator.
Step 2: Open the ATOMS -Module Manager and Update the list of available packages.

Figure 1: Open the ATOMS- Module Manager

Step 3: Select the Finite State Machines (FSM) Section under the list of categories (see
Figure 2). Then select the E4Coder Plugin as shown in Figure 3 and also E4Coder toolbox
available on online ATOMS repository.

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 5
Application Notes

Figure 2: List of ATOMS Packages

Figure 3: E4Coder Plugin in the ATOMS repository


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 6
Application Notes
Step 4: Before starting the installation, we need a License file (license .xml) and this file is
to be received from Evidence.
E4coder licensing types,
1. Demo license
2. Node locked license
3. Dongle license
Purchase the required license, after that press choose button to select the license file.
Then you have to press the Load button. Finally, License manager will check license
validity and will show the result (Figure 5)

Figure 4: License Manager


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 7
Application Notes

Figure 5: Results for the license file is valid or not


Step 5: Select one of the available compiler

Figure 6: Compiler selection


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 8
Application Notes
Step 6: Finally, E4Coder prints a nice banner, which indicates the E4Coder has been
installed correctly.

Figure 7: E4Coder banner

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 9
Application Notes

Chapter 3:
E4CoderGUI
E4CoderGUI is a tool useful for fast prototyping, designing and simulating graphical user
interfaces.

Feature:
1. Integration of E4CoderGUI user interface inside a ScicosLab / XCos diagram,
using a customized E4CoderGUI block.
2. Integration of the simulation engines of ScicosLab / XCos with E4CoderGUI for
starting, running, stopping a simulation.
3. Simulation of a ScicosLab / XCos diagram including one or more user interface
blocks.
4. Code generation of a diagram inside a Qt Panel, to be integrated with the code
generated for Linux and Windows.
5. Visual design of Graphical User Interfaces (GUIs), with undo support.
6. XML file format.
7. Configuration of multiple input and output data with different types.
8. Visualization of the GUI in a window during simulation.
9. Export of GUIs screenshots in PNG format.

To create a new diagram in Scilab Xcos:


Step 1: Open Scilab, E4Coder toolbox will be opened automatically or
Select, Toolboxes E4Coder (see Figure 7).
Step 2: Click, XCOS icon once the XCos diagram window is open, select the Palette
browser option from the View menu.
Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 10
Application Notes
Step 3: Look for the E4CoderGUI block, under E4Coder - GUI creator.

Figure 8: E4Coder-GUI creator


Step 4: Drag the E4CoderGUI into the diagram window (see Figure 9) and double click
on it.

Figure 9: E4CoderGUI Block


Step 5: Choose Properties button as in Figure 10a and then type the name of new GUI
file name (e.g. DEMO.xml) as in Figure 10b. Note that the file name and path are
relative to the current working directory.

Figure 10a: Message box

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 11
Application Notes

Figure 10b: Type the File name


Step 6: The system will report that the file does not exist, as in Figure 11. Please select the
Yes, and the E4CoderGUI Window will appear (see Figure 12)

Figure 11: Message box

Figure 12: E4coder GUI window


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 12
Application Notes

Now, we design a simple GUI using Button & Text label widgets.
Step 7: Select Input ports on contents panel and then click on the Add button on the
toolbar and select Integer (see Figure 13a). Type the Name of the Input port in the
Properties Editor (see Figure 13b).

Figure 13(a)

Figure 13(b)

Step 8: Select the Output Ports section on the contents panel. Click on the Add button
on the toolbar and select Boolean (see Figure14 a). Type the Name of the output port
in the Properties Editor (see 14b).

Figure 14(a)

Figure 14(b)

Step 9: Select Text label element from the Element palette and then drag the element
to drop in working area (see Figure 15a, 15b)

Step 10: Edit name property (e.g. TEXT) and set input port property to INPUT port as in
Figure 15(b)
Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 13
Application Notes

Figure 15(a)

Figure 15 (b)
Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 14
Application Notes
Step 11: Select Button element from the Element palette and then drag the element to
drop in working area (see Figure 16a, 16b).
Step 12: Edit name property (e.g. Button) and set output port property to OUTPUT port
and text property to Hold as in Figure 16(b).

Figure 16(a)

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 15
Application Notes

Figure 16(b)

Step 13: Save and close the E4CoderGUI window.After the E4Coder-GUI creator block
look as in Figure 17.

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 16
Application Notes

Figure 17:The E4CoderGUI creator block displays the GUI file name(DEMO.xml) and
the input and output ports names
Step 14: Now, connect the suitable XCOS blocks from palette browser. In this project
we need clock, delay, counter, convert and IFTHL_F blocks.

Source palette CLOCK_c

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 17
Application Notes

Select the DOLLAR_m block from Discrete time system category. To change
the block into Mirror image as in Figure 18. And set the block parameters.

Figure 18: Mirror image of DOLLAR_m block and block parameters

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 18
Application Notes

Select, Event Handling IFTHEL_f and change this block into Mirror image.

Select the Counter block from source palette and set block parameters

Figure 19: Counter block parameters.

Add two CONVERT Block from the Integer Palette and set the block parameters.

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 19
Application Notes

Figure 20: Counter block parameters.


Step 15: Choose the pallets and make the connections as in Figure 21.

Figure 21: Connection diagram

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 20
Application Notes
Step 16: Select the Setup from Simulate menu and set the properties as in Figure 22.

Figure 22: Parameters setting


Step17: Start Simulation using RUN or

icon.

Figure 23: Output Window


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 21
Application Notes
Step 18: Make connection changes to see IFTHEL_f block 2nd port is connected in this
diagram, output will be displayed like as in Figure 25

Figure 24: Connection diagram


Step 19: Start Simulation using RUN or

icon.

Figure 25: Output window


Tenet Technetronics | Varsity
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

Tenet Technetronics 22
Application Notes
For more information please visit: www.tenettech.com
For technical query please send an e-mail: info@tenettech.com

Tenet Technetronics | Varsity


#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

You might also like