sgJavaSci - Java Based Scilab/Xcos Diagram Importer and C-Code Generator for GeneAuto
What is Scilab ? Scilab is free and open source software for numerical computation providing a powerful computing environment for engineering and scientific applications. What is Scilab/Xcos ? Scilab includes a toolbox called Xcos which is based on Scicos. What is Scicos ? Scicos is a graphical dynamical system modeler and simulator. Users can create block diagrams to model and simulate the dynamics of hybrid dynamical systems (both continuous and discrete time) and compile these models into executable code. Applications include signal processing, systems control, queuing systems, and the of study physical and biological systems. What is GeneAuto ? Gene-Auto is an open-source toolset for real-time embedded systems. The toolset takes as input a functional description of an application specified in a high-level modelling language (Simulink/Stateflow/Scicos) and produces C (in close future also Ada) code as output. What is sgJavaSci ? sgJavaSci is a tool for binding Scilab and Java. The first module if the toolbox is C Code Generator by using above tools. Currently it has the features as follow Supported Xcos Blocks
SUPER_f defines a system
CONST_m defines a constant
DOLLAR_m defines a unit delay
IFTHEL_f calls a system block according to condition based on an input value (u>0)
SUMMATION adds or subtracts inputs
SWITCH2_m selects an inputs from two according to conditions based on an input value and a trishold value (u>a, u>=a, u~=a)
OUT_f defines an output variable
CLKINV_f defines an event or action input
Supported Data Types
Double
Supported Block Parameter Types
Real Expression
Integer Expression
Binary Expression
String Expression
Features
Block Names
Usage Before using the tool you shoul have programs as follow
Eclipse Java Development Environment
Java RTE 1.7
Java JDK 1.7
Scilab
There is no published binaries or Java Byte Code of the tool. You can get it as Eclipse project as follow.
You can clone the tool from Git repository
git clone https://bitbucket.org/ierturk/sgjavasci.git
You can download as zip from
https://bitbucket.org/ierturk/sgjavasci
Then you can import the project into your Eclipse workspace. If you have Git plugin with Eclipse you can directly import project from above git repository. Creating Scilab/Xcos diagram We assume that you are familiar with Scilab/Xcos diagrams. Diagram should be created by using only supported blocks. Parameters should be in type of double and scalar. An example diagram are given below.
Code Generation Process After creating diagram or already you have a diagram which comply with the condition above, you can run the tool within Eclipse. The window will be displayed as follow.
At this stage, the process is as simple as press button and select input diagram and output folder by means menu or toolbar buttons. The steps should be in sequences as in the image below.
In the end everything were go well. You will be found C Files in output folder "cfiles", and GeneAuto XML file in output folder "XML". Output folder is the one you were select at the step 2.
Other windows you will see as follow along with process
After all, c files in output folder, trees views of input diagram XML file and GeneAuto XML file in main window of the tool and a generated C file in Eclipse will be shown as follow
I hope that the tool is useful and look for your valued feedback.
References
sgJavaSci Home
Java
Scilab/Xcos
GeneAuto
All rights reserved. COPYRIGHT 2014 StarGate Inc.










