[Scilab-users] Create a super block through a script

Yves Rambi Yves.Rambinintsoa at gmail.com
Fri Sep 18 13:23:36 CEST 2015


Hello Clément,
it's really not so easy to begin with writing sce scripts.

So I could finally after hours of research and trials partly understand how
this scripting works.

Here is my code:

**********************
scs_m = scicos_diagram();
scs_m.props.title = "Test_Superblock";

//SUM-Block
//scs_m.objs(1) = SUMMATION("define");
//scs_m.objs(1).graphics.sz = [30 50];


//super block
scs_m.objs(1) = SUPER_f("define");
scs_m.objs(1).graphics.sz = [200 200];

//create one additional input
scs_m.objs(1).model.rpar.objs(3)= IN_f("define")

//define input-structure
scs_m.objs(1).model.in = [2;-1]
scs_m.objs(1).model.in2 = [1;-2]
scs_m.objs(1).model.intyp = [2;-1]



xcos(scs_m)

**********************

I have some questions:
- what are the vectors in[2; -1] and in2[1; -2] ? I write it just
"instinctively" by looking at the diagram browser.
- is there not another simplier way to create inputs in a kind of one
command like "create_input"?
- is my code correct or did I forget something?

By the way I don't know how to export a model to the "diagram browser". When
I open it I see a tree structure. From there I deduced how to create
sub-model-elements. But I don't know if my code is complete or if there are
some additional things necessary.

If I could get some example code from somewhere it would help me a lot.


Thank you



Yves



--
View this message in context: http://mailinglists.scilab.org/Create-a-super-block-through-a-script-tp4032849p4032865.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list