[scilab-Users] Use of SendScilabJob
Allan CORNET
allan.cornet at scilab.org
Tue Apr 3 13:50:33 CEST 2012
Hi,
>From a C/C++ gateway of Scilab, the current good way to do is:
http://wiki.scilab.org/Calling%20a%20scilab%20function%20%28macros%29%20from%20a%20C%20interface
SendScilabJob must be used from a external app and not scilab
Allan
-----Message d'origine-----
De : Remy_Abergel [mailto:remy.abergel at parisdescartes.fr]
Envoyé : mardi 3 avril 2012 13:37
À : users at lists.scilab.org
Objet : [scilab-Users] Use of SendScilabJob
Hello,
I would like to interface in Scilab a C code that uses "SendScilabJob".
Here is a very simple code that I am unsuccessfully trying to make work.
#include "api_scilab.h"
#include "call_scilab.h"
#include "stack-c.h"
#include "sciprint.h"
void hello()
{
int res = SendScilabJob("disp(''hello'')");
sciprint("res=%d",res);
}
int interface_hello(char *fname)
{
CheckRhs(0,0) ;
CheckLhs(0,1) ;
hello();
return 0;
}
The builder is simply made of the line: ilib_build('libhello',['hello',
'interface_hello'],['hello.c'],[])
When I run "hello()" in Scilab, the SendScilabJob is not correctly executed
(res=-1 which means that the call_Scilab engine is not started)
If I change my function hello into:
void hello()
{
StartScilab(getenv("SCI"),NULL,NULL);
SendScilabJob("disp(''hello'')"); }
then a call to "hello()" crashes Scilab. I tryied on 2 different computers with the version 5.3.3 of Scilab. It seems there is a problem with JVM lib (a message appears in my linux terminal saying that Scilab cannot open JVM
library) but I do not understand what is going wrong.
My wish is that typing "hello()" in my Scilab console, my c code runs, and sends the "disp('hello')" instruction *to the same* Scilab console.
It would be very useful to me if I could achieve that, thank you for your responses.
Rémy
--
View this message in context: http://mailinglists.scilab.org/Use-of-SendScilabJob-tp3880580p3880580.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
--
To unsubscribe from this mailing-list, please send an empty mail to users-unsubscribe at lists.scilab.org
To check the archives of this mailing list, see http://mailinglists.scilab.org/
More information about the users
mailing list