How to add Simple Controls?

Hi:

I need to control the status of some pipes at certain hydrodynamics. Could you explain me how can I especify the correct arguments to addBinControls??

for example, I need to execute next control:

‘LINK X CLOSED AT TIME XX’;
d.addBinControl(a,b,c,d,…);

But I don’t solve yet :expressionless: how to write the correct a,b,c,d,… arguments in d.addBinControl function.

SOME ASPECTS BEFORE ANSWER:

1.- I have tested the “EX17a_add_multiple_controls_pipestatus_bin.m” contained in the examples folder of the toolkit. But when I test only one Control (Not carried out all the loop, only generate one of them: Controls = ‘LINK 10 Open AT CLOCKTIME 000:00:00’ and when apply to: “d.addBinControl(Controls)”, I get an error :no_entry_sign:, buy when “Controls” have all the 288 simple controls, It works :ok_hand:. Why?? :face_with_monocle:

2.- In other post, I see than there exist and “EMT v2.2” with dll functions of Epanet 2.2 beta. This version contains the function d.addControls, and the next example works perfectly :white_check_mark::partying_face::

d.addControls(['LINK, char(LinkID), ’ CLOSED AT TIME ', num2str(2*3600)]);

Even if this could be the solution, use this version is not possible for me, because I generate some INP files with "d.saveInputFile(‘NameX.inp’); but it writes incorrectly the [DEMANDS] part of the file. It writes some symbols tha Epanet and the toolkit himself can’t read them. (I attached one example) and THIS NOT OCCUR IN THE 2.1 VERSION

Net3ScnBMODByPass.inp (83.4 KB)

I hope you help me to write simple controls with d.addBinControls(a,b,c,…) in the EMT 2.1

Thanks

-Daniel

Hi @DanielHernandezCerva,

You can try the function d.addControls with https://github.com/OpenWaterAnalytics/EPANET-Matlab-Toolkit/releases/tag/v2.2.0-beta.2

You can type >>help d.addControls to find some examples.
Let me know if something is wrong.

Also, I want to learn more about "d.saveInputFile(‘NameX.inp’); but it writes incorrectly the **[DEMANDS]** part of the file.

Thanks,
Marios

Thanks a lot

This version does not have problems to write INP files, and the way to write CONTROLS y}is very simple.

Regards Mariosmsk