<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div><span style="font-family: Verdana, sans-serif, Arial, 'Trebuchet MS'; font-size: 13px; line-height: 1.6em;">Hello</span></div>
<div class="signature">
<div> </div>
<div>I am writing on an application using Scilab and Xcos. Right now I am working on a specialised replacement for “getvalue(..)” (GUI to edit parameters of Xcos blocks) written in Java.</div>
<div>Now I need to access the current Scilab workspace (execute an expression and get back the result) from Java -- something like { x = myScilab.getResultFromExpression("2.0*sin(foo)") } with an error message in case of a non-valid expression. Current means that the java code of interest is run through JIMS and shall access its calling Scilab environment.</div>
<div>Where can I find this functionality?</div>
<div> </div>
<div>What I tried:</div>
<div>Javasci:</div>
<div> </div>
<div>Used in a separated session it provides roughly the asked functionality. See the example included in Javasci.</div>
<div>Used within an existing Scilab session I run in some problems.</div>
<div> </div>
<div>The sci.open() does not return when called from within a Scilab session and is probably not needed as there are static methods like Scilab.getInCurrentScilabSession(..), too.</div>
<div>sci.get(..) is working when I skip sci.open(). Maybe that is the cause for the further problem with sci.execException.</div>
<div> </div>
<div>Scilab.getInCurrentScilabSession(“foo”) is working (returning a Scilab variables content) but I found one strange behaviour:</div>
<div>Scilab.getInCurrentScilabSession(“foo * 2”) returns the value of foo, not 2*foo and does not thow an Exception. This happens also when called as separate session.</div>
<div> </div>
<div>When called from within a running Scialb session sci.execException(“X2C_JAVA_ACCESS = 987”) (or any other valid expression) throws</div>
<div> </div>
<div>org.scilab.modules.javasci.JavasciException$ScilabErrorException: A Scilab error occurred: winqueryreg: Cannot query value of this type.</div>
<div>Code: 999</div>
<div><br/>
and called one more time:</div>
<div> </div>
<div>org.scilab.modules.javasci.JavasciException$ScilabErrorException: A Scilab error occurred: Method invocation: An error occurred during the data retrieving in Java:An exception has been thrown in calling the method getValueFromExpression_1:org.scilab.modules.javasci.JavasciException$ScilabErrorException: A Scilab error occurred: winqueryreg: Cannot query value of this type.Code: 999</div>
<div>Code: 999</div>
<div> </div>
<div>In a separate session as in the Javasci example that works.</div>
<div><br/>
</div>
<div>Do you have hints where to dig to get something like getResultFromExpression("2.0*sin(foo)") working?</div>
<div> </div>
<div> </div>
<div>Thanks</div>
<div> </div>
<div>Martin</div>
</div></div></body></html>