[Scilab-users] Xcos Debugging : block number, Flag and tutorial

Quentin Mazué mazue.quentin at gmail.com
Tue Jul 29 10:16:01 CEST 2014


Hi,

I need to make some debugging in Xcos, and for that I use the block "DEBUG"
with the code below: 

-------------------------------------------------------------------------
xcos_debug_gui(flag,block);
warnBlockByUID(block.label, "ERROR");
n=curblock();
f=%cpr.sim.funs(n)
path=%cpr.corinv(n);
t=scicos_time();
printf("flag=%d, t=%g, n=%d, f=%s \n", flag,t,n,f)
if n==5 then
	printf("u=%g, y=%g \n ------- \n", block.inptr(1), block.outptr(1))
	pause
end
-------------------------------------------------------------------------

1) 
I have some difficulties in a huge diagram (several hundreds of blocks) to
find the block I want to analyze. Indeed I need to get the block number in
the scs_m structure and until now I use the following procedure: 

During the debugging I wait until the simulation stop (at Flag = 1 for
example)
I use a loop with the getlabelblock(i) function until it gives me the label
of the block I want to follow.
I stop the simulation
I correct the line n==5 to n==i (i : block number that I want to follow)
I start again the simulation

=> Is there a simpler way to get the block number?

=> Why the function "xcos_blocks_info(%cpr)" detailed page 209 in the book
"Scilab de la théorie à la pratique" written by Serge Steer and Yvon Degré
does not exist in Scilab 5.5.0? This function could be useful because we
have a direct correlation between block number and their uid.

2)
Is there a list of all flag signification in Xcos?
How/When/in which order are these flags called in Xcos?

3)
Are there some tutorials to explain how to debug an Xcos Diagram?


Thanks a lot

Regards
Quentin Mazué






--
View this message in context: http://mailinglists.scilab.org/Xcos-Debugging-block-number-Flag-and-tutorial-tp4030977.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list