<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Vorformatiert Zchn";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Sprechblasentext Zchn";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
color:black;
mso-fareast-language:EN-US;}
span.SprechblasentextZchn
{mso-style-name:"Sprechblasentext Zchn";
mso-style-priority:99;
mso-style-link:Sprechblasentext;
font-family:"Tahoma","sans-serif";}
span.E-MailFormatvorlage19
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.HTMLVorformatiertZchn
{mso-style-name:"HTML Vorformatiert Zchn";
mso-style-priority:99;
mso-style-link:"HTML Vorformatiert";
font-family:Consolas;
color:black;
mso-fareast-language:EN-US;}
span.E-MailFormatvorlage22
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hello Paul,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>thank you for your answer.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I had a look at the “DOLLAR” block. It’s a kind of delay block, but it’s not the right block for the task I have to do, I think.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I attached a simulation file, which shows the problem. This is not the real simulation, because the real one is more complex.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>First of all I load the .sce file. If I start the simulation, the output shows the result with the initial value of C defined in the .sce file and I get the error message “Evaluation problem: value not updated from context. Protected variable name. Please choose another variable name.”<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>After I start the simulation a second time, the output graph shows the correct result and the error message doesn’t appear again.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Is there any possibility to write into my variable C at the beginning of the simulation? Or is it possible to do this task with the “DOLLAR” block like you thought?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Michael<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:DE'>Von:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:DE'> Paul Bignier [mailto:paul.bignier@scilab-enterprises.com] <br><b>Gesendet:</b> Donnerstag, 10. April 2014 12:35<br><b>An:</b> International use</span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:DE'>rs mailing list for Scilab.; martin.buecherl@th-deg.de<br><b>Betreff:</b> Re: [Scilab-users] Problems with "To workspace" and "From workspace"<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><br>Hi Michael,<br><br>Indeed it looks like you can't overwrite a variable defined in the context.<br>Have you tried replacing the "FROMWSB" block with a "DOLLAR" block?<br>Then it would have the same data and activation inputs as the "TOWS_c" block,<br>and you would not need to pre-define 'C' (just give it an initial value in the block parameters).<br><br>Hope this helps,<br>Regards,<br>Paul<br><br><o:p></o:p></p><div><p class=MsoNormal>On 04/10/2014 09:27 AM, Michael Ungelehrt wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span lang=EN-US>Dear users,</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>I have a problem with the “To workspace” respectively “From workspace” block in Xcos.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>I’d like to write the value of a function to workspace if the value of another function changes its sign from + to -. A short time later I’d like to use this value in a third function and retrieve it from workspace.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>For that I evaluate the first function with the “NEGTOPOS_f” block and give the output event to the “TOWS_c” block. The “TOWS_c” block is connected with the second function and should write the value to a vaiable A in the workspace.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>The “FROMWSB” block is connected with a third function which should use the variable that is saved before.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Now I have the following problem:</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>If I start the simulation, the “FROMWSB” says that the variable A does not exist. So my idea was to define the variable in the variable-browser before I start the simulation. If I do so I get an error at the “TOWS_c” block: “Evaluation problem: value not updated from context. Protected variable name. Please choose another variable name.”</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Is there any solution for that problem?</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><u><span lang=EN-US>Block parameters:</span></u><o:p></o:p></p><p class=MsoNormal><u><span lang=EN-US>From workspace:</span></u><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Variable name: C</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Interpolation Method: 0</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Enable zero crossing: 1</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Output at end: 1</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><u><span lang=EN-US>To workspace:</span></u><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Size of buffer: 1</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Scilab variable name: C</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Inherit: 0</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><u><span lang=EN-US>Definition of variable C in SciNotes upfront:</span></u><o:p></o:p></p><p class=MsoNormal>C.time=0;<o:p></o:p></p><p class=MsoNormal>C.values=0; <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Thank you in advance!<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Mit freundlichen Grüßen</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Best regards,</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'> </span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Michael Ungelehrt</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'> </span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'> </span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'><img width=138 height=133 id="Bild_x0020_1" src="cid:image001.jpg@01CF5802.9CB96B90" alt="Logo_TC_Cham"></span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'> </span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Michael Ungelehrt, B.Eng.</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Laboringenieur</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'> </span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>THD – Technische Hochschule Deggendorf<br>Technologie Campus Cham</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Badstraße 21</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>D-93413 Cham</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'> </span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Tel: +49 9971 99673-29</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Fax: +49 9971 99673-69</span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>E-Mail: <a href="mailto:michael.ungelehrt@th-deg.de">michael.ungelehrt@th-deg.de</a></span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'>Web: <a href="http://www.tc-cham.th-deg.de/">www.tc-cham.th-deg.de</a></span><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:DE'><br><br><br><o:p></o:p></span></p><pre>_______________________________________________<o:p></o:p></pre><pre>users mailing list<o:p></o:p></pre><pre><a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><o:p></o:p></pre><pre><a href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a><o:p></o:p></pre></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:DE'><br><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>Paul BIGNIER<o:p></o:p></pre><pre>Development engineer<o:p></o:p></pre><pre>-----------------------------------------------------------<o:p></o:p></pre><pre>Scilab Enterprises<o:p></o:p></pre><pre>143bis rue Yves Le Coz - 78000 Versailles, France<o:p></o:p></pre><pre>Phone: +33.1.80.77.04.69<o:p></o:p></pre><pre><a href="http://www.scilab-enterprises.com">http://www.scilab-enterprises.com</a> <o:p></o:p></pre></div></body></html>