Use of SendScilabJob

Remy_Abergel remy.abergel at parisdescartes.fr
Tue Apr 3 13:37:05 CEST 2012


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.



More information about the users mailing list