[Scilab-users] Integrating SciLab and EPANET (.dll written in C/C++)
Antoine Monmayrant
antoine.monmayrant at laas.fr
Mon Jul 8 08:48:49 CEST 2013
On 05/07/2013 20:45, Chuox wrote:
> Hi im trying to integrate EPANET and SciLab, i all ready do it in MATLAB, (i
> actually din't do it Demetrios Eliades
> <http://www.mathworks.com/matlabcentral/fileexchange/authors/53840> i'm
> going to show how i succesfull did it in MATLAB, and then how i'm trying to
> do it in SciLab.
>
> In MATLAB
Hi,
It does seem that you are not using "call" properly.
Have a look at the examples in Scilab Help >> Link dynamique/incremental
> call
You basically need to know and tell "call", for each input argument:
- its position in the function call: ret=function(a,b,c): a: position 1,
b: position 2,c: position 3.
- its type and dimension.
You also have to do the same for the output argument.
If you give us the prototype of the C function you are trying to call,
we might try to get the right call sequence.
Cheers,
Antoine
>
>
>
>>> loadlibrary('epanet2', 'epanet2.h')
>>> [errorcode] = calllib('epanet2', 'ENopen', 'Net1.inp', 'temp1.$$$',
>>> 'temp2.$$$')
> errorcode =
>
> 0
>
>>> index=1;
> diam=0;
> [error,diam] =calllib('epanet2', 'ENgetlinkvalue', index, 0, diam)
>
> error =
>
> 0
>
>
> diam =
>
> 18
>
> End Working in MATLAB
>
>
> In SciLab
>
>
> -->link("C:\Users\Alfredo\Google
> Drive\Tesis\SciLab\epanet2.dll","ENopen","c")
> Shared archive loaded.
> Link done.
> ans =
>
> 0.
>
> -->c_link("ENopen")
> ans =
>
> T
>
> -->call("ENopen","C:\Users\Alfredo\Google
> Drive\Tesis\SciLab\Net1.inp","temp1.$$$","temp2.$$$")
> Warning !!!
> Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
> with "call" function.
> Save your data and restart Scilab.
> ans =
>
> temp2.$$$
>
> Warning: stack problem..., cleared.
>
> En working in SciLab
>
>
> I think in not using very well the call function, any help will be
> apreciated, thanks.
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/Integrating-SciLab-and-EPANET-dll-written-in-C-C-tp4026977.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Antoine Monmayrant LAAS - CNRS
7 avenue du Colonel Roche
BP 54200
31031 TOULOUSE Cedex 4
FRANCE
Tel:+33 5 61 33 64 59
email : antoine.monmayrant at laas.fr
permanent email : antoine.monmayrant at polytechnique.org
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
More information about the users
mailing list