Um blog sobre tendências tecnológicas, dicas de cursos e leituras.
seen from China
seen from China

seen from Germany
seen from United States
seen from China

seen from Malaysia
seen from Türkiye
seen from United States
seen from United States
seen from Hong Kong SAR China
seen from India

seen from India

seen from United States
seen from United States

seen from United States
seen from Malaysia

seen from Germany

seen from Hong Kong SAR China
seen from United States
seen from United States
Um blog sobre tendências tecnológicas, dicas de cursos e leituras.
Scilab: Xcos - Resposta ao degrau de um sistema de primeira ordem #7.1
some commissions i finished today ;v; goodnight its already 1am Xcos, NutmegRaccoon
Matlab/Simulink的免费版Scilab/Xcos
大名顶顶的Matlab,在科研领域应该是无人不知的,无人不晓吧。既然这么出名,想要买license,价格也是对的起它的名声。2000欧左右可以买到光Matlab的,再加3000欧才能用上Simulink……这就迫使个人电脑上运行着各种“绿色”版Matlab。 如果项目眼下没资金,又不能用绿色版,那可咋办? 法国Inria研究所90年代,发布了一款开源科学计算软件叫Scilab,它可以说是Matlab的免费版。现今,Scilab由Scilab enterprise管理,但还保持着免费,开源。 下面进入主题:Xcos Xcos等价于matlab中的Simulink,做电气自动化的肯定都用过。虽然Xcos没有Simulink那么强大,功能那么多,有时也会出现卡死,退出等问题,但是,免费这一项就让我们把所有问题都忽略了。
首先,来看一下Xcos长什么样子吧。跟Simulink使用一样,再Scil…
View On WordPress
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.
sgJavaSci Scilab/Xcos Tools
We have started up a new project sgJavaSci Scilab/Xcos tools to manage Scilab from Java environment. Initially, JavaSci example was imported from Scilab installation. Also a class was created to display Xcos diagram in XML format as SWT/JFace treeviewer.
Current development environment on Windows 7 / 64bit machine as follow
Eclipse Luna Release (4.4.0) x86_64
IBM 64-bit SDK for Windows AMD64/EM64T architecture, Java Technology Edition, Version 7
Scilab-5.5.0 64bit
Source code can be downloaded from BitBucket repository.