[scilab-Users] Use of SendScilabJob

Sylvestre Ledru sylvestre.ledru at scilab-enterprises.com
Tue Apr 3 13:51:35 CEST 2012


Salut Rémy,

On 03/04/2012 13:37, Remy_Abergel wrote:
> 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)
>
The problem is probably due to the fact that you are mixing two 
different things:
* call_scilab should be used when you want to use Scilab as a computing 
engine from a thirdparty applications
* api_scilab is used when you want to extend the features of Scilab by 
adding a new function.

SendScilabJob has not been designed nor tested to be used inside a gateway.

Sylvestre



-- 
-----------------------------
Sylvestre Ledru
Operation manager
Community manager
-----------------------------
Scilab Enterprises
http://www.scilab-enterprises.com/
http://www.scilab.org/
-----------------------------




More information about the users mailing list