[Scilab-users] Problems with "To workspace" and "From workspace"

Paul Bignier paul.bignier at scilab-enterprises.com
Tue Apr 15 09:52:21 CEST 2014


Hi Michael,

When I run the simulation a second time, I still get the "Protected 
variable name" and "Singularity in a block" (block EXPRESSION) errors.

The attached diagram does what I think you are trying to do (without 
running the script).
That is, when the ramp block crosses zero, save the value of the sine 
block in Scilab environment and plot it.
The CLKSOMV_f block is just there to give an initial impulse to DOLLAR_f 
thanks to the added CLOCK_c block.

As Serge stated, the variables are "transferred" to the Scilab 
environment at the end of the simulation, so there is no way of saving a 
variable AND loading it mid-simulation in one diagram.

Hope this helps,
Regards,
Paul

On 04/14/2014 05:01 PM, Michael Ungelehrt wrote:
>
> Hello Paul,
>
> thank you for your answer.
>
> 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.
>
> I attached a simulation file, which shows the problem. This is not the 
> real simulation, because the real one is more complex.
>
> 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."
>
> After I start the simulation a second time, the output graph shows the 
> correct result and the error message doesn't appear again.
>
> 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?
>
> Best regards,
>
> Michael
>
> *Von:*Paul Bignier [mailto:paul.bignier at scilab-enterprises.com]
> *Gesendet:* Donnerstag, 10. April 2014 12:35
> *An:* International users mailing list for Scilab.; 
> martin.buecherl at th-deg.de
> *Betreff:* Re: [Scilab-users] Problems with "To workspace" and "From 
> workspace"
>
>
> Hi Michael,
>
> Indeed it looks like you can't overwrite a variable defined in the 
> context.
> Have you tried replacing the "FROMWSB" block with a "DOLLAR" block?
> Then it would have the same data and activation inputs as the "TOWS_c" 
> block,
> and you would not need to pre-define 'C' (just give it an initial 
> value in the block parameters).
>
> Hope this helps,
> Regards,
> Paul
>
> On 04/10/2014 09:27 AM, Michael Ungelehrt wrote:
>
>     Dear users,
>
>     I have a problem with the "To workspace" respectively "From
>     workspace" block in Xcos.
>
>     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.
>
>     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.
>
>     The "FROMWSB" block is connected with a third function which
>     should use the variable that is saved before.
>
>     Now I have the following problem:
>
>     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."
>
>     Is there any solution for that problem?
>
>     _Block parameters:_
>
>     _From workspace:_
>
>     Variable name:                C
>
>     Interpolation Method:                 0
>
>     Enable zero crossing:     1
>
>     Output at end:                 1
>
>     _To workspace:_
>
>     Size of buffer:                  1
>
>     Scilab variable name:     C
>
>     Inherit: 0
>
>     _Definition of variable C in SciNotes upfront:_
>
>     C.time=0;
>
>     C.values=0;
>
>     Thank you in advance!
>
>     Mit freundlichen Grüßen
>
>     Best regards,
>
>     Michael Ungelehrt
>
>     Logo_TC_Cham
>
>     Michael Ungelehrt, B.Eng.
>
>     Laboringenieur
>
>     THD -- Technische Hochschule Deggendorf
>     Technologie Campus Cham
>
>     Badstraße 21
>
>     D-93413 Cham
>
>     Tel: +49 9971 99673-29
>
>     Fax: +49 9971 99673-69
>
>     E-Mail: michael.ungelehrt at th-deg.de
>     <mailto:michael.ungelehrt at th-deg.de>
>
>     Web: www.tc-cham.th-deg.de <http://www.tc-cham.th-deg.de/>
>
>
>
>
>     _______________________________________________
>
>     users mailing list
>
>     users at lists.scilab.org  <mailto:users at lists.scilab.org>
>
>     http://lists.scilab.org/mailman/listinfo/users
>
>
>
> -- 
> Paul BIGNIER
> Development engineer
> -----------------------------------------------------------
> Scilab Enterprises
> 143bis rue Yves Le Coz - 78000 Versailles, France
> Phone: +33.1.80.77.04.69
> http://www.scilab-enterprises.com  

-- 
Paul BIGNIER
Development engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140415/2bf81175/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 4176 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140415/2bf81175/attachment.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: To-From Workspace_DOLLAR.zcos
Type: application/octet-stream
Size: 6417 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140415/2bf81175/attachment.obj>


More information about the users mailing list