<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Le 16/05/2014 22:06, Paul Martin a
écrit :<br>
</div>
<blockquote cite="mid:1400270785478-4030517.post@n3.nabble.com"
type="cite">
<pre wrap="">Hi,
I have created my own Xcos Block.
I try to share variable between them without any link.
I want to have the same behavior than the GOTO/FROM Blocks, but i want to
manage the variable inside my own block.
My blocks are developped in C, i thought use the globlal variable, but i
dont know how to use it in C files.
</pre>
</blockquote>
First, it is not a good idea to share variables between blocks
because it may create side effects in particular if you want to
share variables that can be modified by block execution (like input
or output)<br>
<br>
<div id="gt-src-c" class="g-unit">
<div id="gt-src-p">
<div class="" id="gt-src-wrap">
<div id="gt-src-tools">
<div id="gt-src-tools-l">
<div style="display: inline-block;" id="gt-input-tool">
<div id="itamenu"><span class="ita-kd-inputtools-div"></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="gt-res-c" class="g-unit">
<div id="gt-res-p">
<div id="gt-res-data">
<div id="gt-res-wrap">
<div id="gt-res-content" class="almost_half_cell">
<div dir="ltr" style="zoom:1">
<div id="tts_button" style="" class=""><object
type="application/x-shockwave-flash"
data="//ssl.gstatic.com/translate/sound_player2.swf"
id="tts" height="18" width="18"></object></div>
<span id="result_box" class="short_text" lang="en"><span
class="hps">Nevertheless, if you really want to do
that you could have a look to the
modules/scicos/src/c/import.c file (see the attached
one if you dont have a source version)<br>
<br>
The scicos_imp structure is available at simulation
time and can be used to access to all C variables
and data structures concerning the compiled model
like global continuous state </span></span><span
id="result_box" class="short_text" lang="en"><span
class="hps"><span id="result_box" class="short_text"
lang="en"><span class="hps">scicos_imp.</span></span>x,
all blocks inputs ans outputs,... as well as the
array of blocks definition scicos_imp.blocks.<br>
<br>
Serge Steer<br>
<br>
<br>
</span></span></div>
</div>
</div>
</div>
</div>
</div>
<br>
<blockquote cite="mid:1400270785478-4030517.post@n3.nabble.com"
type="cite">
<pre wrap="">
Thanks,
Paul
--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/Share-variable-between-Xcos-Blocks-tp4030517.html">http://mailinglists.scilab.org/Share-variable-between-Xcos-Blocks-tp4030517.html</a>
Sent from the Scilab developers - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/dev">http://lists.scilab.org/mailman/listinfo/dev</a>
</pre>
</blockquote>
<br>
</body>
</html>