Epanet 2.2 thread safe api functions in Matlab

Hello all,

In matlab, I can run epanet “EN” functions by the use of following code:

loadlibrary(‘epanet2’,‘epanet2.h’);

and then calling functions like:

[~,nl]=calllib(‘epanet2’, ‘ENgetcount’,2,1)

The question is how to do it for “EN_” functions? I could not properly create a project handle therefore could not create a project. How to do these steps at the beginning? Of course this time epanet2_2.h should be included but how is the rest?

Any help is appreciated.

Thanks.

Onur

Hi @kafakiran,

You can load the library like before: loadlibrary(‘epanet2’,‘epanet2.h’);
But you need epanet2_enums.h in the same directory.

Capture

Also, I suggest you try to use the EMT. Ιf there is a problem you can ask us. Here is the dev version with the new last EPANET dev2.2: https://github.com/OpenWaterAnalytics/EPANET-Matlab-Toolkit/tree/dev-2.2-edit