user-defined blocks in xcos

Post on 05-Jan-2017

354 Views

Category:

Documents

20 Downloads

Preview:

Click to see full reader

TRANSCRIPT

User-defined blocks in Xcos

June 29th 2011

Clément DAVID & Bruno JOFRETScilab Consortium

The free and open source software for numerical computation

Scilab/Xcos: Modeling dynamical systems

● Configurable subsystems use

● Conditionally executed

subsystems creation

● Signals and blocks parameters

adaptation

● Scilab algorithms and hand-

written code integration

The free and open source software for numerical computation

Outline

● Model Building and Edition:

– User-defined palettes,– Configurable subsystems use.

● Xcos toolbox skeleton

● Future external modules:

– User defined blocks enabling Scilab and Modelica algorithms calls.

The free and open source software for numerical computation

Model Building and Edition

The free and open source software for numerical computation

Example to mimic a Simulink® block

● Emulate an integrator which triggers a state reset on an input signal

Simulink is a registered trademark of The Mathworks, Inc.

Scilab / Xcos Matlab / Simulink

1s

x o

I n t e g r a t o r

The free and open source software for numerical computation

The Simulink® diagram

S c o p eP u l s e

G e n e r a t o r

1s

x o

I n t e g r a t o r

0

C o n s t a n t 1

1

C o n s t a n t

The free and open source software for numerical computation

The Simulink® diagram results

The free and open source software for numerical computation

The Xcos diagram

The free and open source software for numerical computation

The Xcos diagram results

The free and open source software for numerical computation

With a SuperBlock

The free and open source software for numerical computation

Customize it

The free and open source software for numerical computation

With exact input mapping

The free and open source software for numerical computation

With exact input mapping (2)

The free and open source software for numerical computation

Adding to the palettes

The free and open source software for numerical computation

Using masked SuperBlocks

● Define variables in the parent context

● Use context on the blocks

● Create and customize the mask

● Remove variable in the parent context

The free and open source software for numerical computation

The masked SuperBlock

The free and open source software for numerical computation

Xcos toolbox skeleton

The free and open source software for numerical computation

Xcos toolbox skeleton

● Included into the Scilab distribution (Development tools) with:

– Documentation (how to write your own help pages),

– Examples,

– Demos.

● Quick start to deploy an Xcos module through ATOMS.

● Interface your own libraries:

– Native ones (C, C++, Fortran, …),

– Interpreted (Scilab, Modelica).

The free and open source software for numerical computation

External modules distribution

● ATOMS – http://atoms.scilab.org

– Package your business logic

● Scilab File Exchange – http://fileexchange.scilab.org

– Upload sample files

● Forge – http://forge.scilab.org

– Public or private collaboration platform

The free and open source software for numerical computation

Future External Modules

The free and open source software for numerical computation

UDP Blocks

● Implement blocks to handle remote data access using the UDP protocol:

– http://forge.scilab.org/index.php/p/udp-blocks/– not yet packaged in ATOMS.

The free and open source software for numerical computation

UDP Blocks

● UDP Send:

– C function to send UDP packet● UDP Receive:

– C function to receive UDP packet

The free and open source software for numerical computation

Network

UDP Blocks

● Example: Scilab ↔ Scilab

The free and open source software for numerical computation

Network

UDP Blocks

● Example: Scilab ↔ ???

The free and open source software for numerical computation

Network

UDP Blocks

● Example: ??? ↔ Scilab

The free and open source software for numerical computation

UDP Blocks

● UDP Blocks:

– Based on ToolBox Skeleton,– C Simulations function,– Available through ATOMS (coming soon),– Encode/Decode your own UDP packet,– Easy communication with hardware devices.

The free and open source software for numerical computation

COSELICA

● COSELICA (Modelica)

Standard Modelica Library in Xcos

– Use more Modelica features:● Electrical,● Thermal,● Mechanics.

– Advanced Xcos UI features (port colors, SVG blocks, etc... )

The free and open source software for numerical computation

COSELICA

The free and open source software for numerical computation

COSELICA

The free and open source software for numerical computation

COSELICA

The free and open source software for numerical computation

COSELICA

The free and open source software for numerical computation

COSELICA

● COSELICA (Modelica):

– Based on ToolBox Skeleton,– Modelica Equations,– Generated C Simulation functions,– Available through ATOMS (coming soon),– Extends Xcos on other scientific domains.

The free and open source software for numerical computation

Future FunctionalityAvailable with Scilab 5.4.0

The free and open source software for numerical computation

Block wizard● Common UI for user blocks generation

● Ease new blocks integration

Thanks for your attention

www.scilab.org

top related