[Scilab-users] Context error in Xcos Scilab 6.1.0

Clément David Clement.David at esi-group.com
Mon Mar 2 10:17:38 CET 2020


Hello Pierre, Samuel,

First, did you opened a bug on that issue?

Second, to me, the bug is located on the script2var() function which resolves the context and output a struct of `variable=value` that are defined for the diagram (and its parents). For example, when I explicitly define A=100 in the context, the A variable is found and resolved as 100 in the diagram. However, defining A=50 inside the A.ctx file and using the schema A610.zcos, where the A.ctx file is passed to exec(), failed.

Regards,

--
Clément

> -----Original Message-----
> From: users <users-bounces at lists.scilab.org> On Behalf Of Perrichon
> Sent: Saturday, February 29, 2020 7:35 PM
> To: 'Users mailing list for Scilab' <users at lists.scilab.org>
> Subject: Re: [Scilab-users] Context error in Xcos Scilab 6.1.0
> 
> Hello Samuel,
> 
> 
> 
> Glad to see you confirm this bug
> 
> 
> 
> Context is executed at line 26 of the A.sce file, and not before :
> 
> ---> xcos_simulate(scs_m, 4);
> 
> 
> 
> So in scilab 6.1.0, the A.ctx is executed.
> 
> I also add in A610.zcos the instruction
> 
> *	mprintf("Running context in xcos. ...So A=%i\n",A)
> 
> 
> 
> And then here is the track in my PC when running A.sce in xcos 6.1.0 :
> 
> 
> 
> 
> 
> --> exec('C:\0 - tampon\A.sce', -1)
> 
> Chargement du contexte d'exécution A.ctx
> 
> 
> 
> Running context in xcos. ...So A=50
> 
> 
> 
> Where we can see that A=50 inside A610.zcos.
> 
> 
> 
> We also can see that A is lost a the end of the context execution
> 
> 
> 
> 
> 
> This bad behavior also explains that my projects don't migrate from xcos 5.5.2
> to 6.1.0
> 
> 
> 
> Be sure that in my projects, the ct xis a set of a lot of scilab instructions who
> generate variables.
> 
> These variables are use in any bloscks and under blocks of my main shemes
> 
> 
> 
> 
> 
> BR
> 
> 
> 
> 
> 
> De : users <users-bounces at lists.scilab.org> De la part de Samuel Gougeon
> Envoyé : samedi 29 février 2020 17:53 À : users at lists.scilab.org Objet : Re:
> [Scilab-users] Context error in Xcos Scilab 6.1.0
> 
> 
> 
> Le 29/02/2020 à 17:41, Samuel Gougeon a écrit :
> 
> 	Hello Pierre,
> 
> 
> 
> 	Le 29/02/2020 à 11:32, Perrichon a écrit :
> 
> 		Hello,
> 
> 
> 
> 		I try to understand and find a reason why my projects done with
> xcos scilab 5.5.2 not run i 6.1.0
> 
> 		So I isolate at least one reason in a basic test program (see
> attached files)
> 
> 
> 
> 		Here, zcos file are lunched into scilab 5.5.2 or 6.10, with the
> A.sce file which test the version
> 
> 
> 
> 		A.ctx is a context file. Here is a simple variable definition A=50
> in that case.
> 
> 
> 
> 		Every zcos file contains in its simulation contexte, the
> instruction « exec("A.ctx") » ; accessible with simulation-> context modifying
> 
> 
> 
> 		To run this program, make a directory, a copy of the attached
> files, and change eventually line 4 in A.sce :
> 
> 		Root="c:\0 - tampon"                                                                //
> Répertoire de travail pour le test
> 
> 
> 
> 		So run A.sce inside xcos scilab 5.5.2 or 6.1.0
> 
> 
> 
> 		Scilab 5.5.2 run correctly :
> 
> 		<diagram image>
> 
> 
> 
> 
> 		Scilab 6.1.0 is bugged :
> 
> 
> 
> 
> 
> 	Apparently, the problem is that the context is not executed when the
> diagram is loaded.
> 	Despite what the context message indicates:
> 
> 
> 
> 	Indeed, the message mprintf("Chargement du contexte d''exécution
> %s\n\n",FichierContexte)
> 	set in the context is not displayed when the diagram is loaded in 6.1.0 ;
> only when the context
> 	is updated (or simply edited and revalidated).
> 
> 	With Scilab 5.5, the context is not executed when loading the
> diagram,but when running it.
> 
> 	So, to me, there are apparently 2 issues:
> 
> 	1.	The Set Context message should be fixed: "... and every time
> the diagram is run" (not loaded)
> 	2.	The fact that the context is executed when the diagram is run
> should be restored in Scilab 6.
> 
> Sorry, i don't know what occurred with my first trial, but now it works:
> In 6.0.2 and 6.1.0, the message is well displayed when the diagram is run.
> The error message displayed on the icon is the following:
> 
> 
> 
> 
> 
> Samuel
> 
> 




More information about the users mailing list