10.06.2016 Views

eldo_user

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Eldo Control Language<br />

Simulation Dynamic Control<br />

.define_function f_callback (in_sampling[] = 0, @out_sampling[] = 0,<br />

+ in_cur_index = 0, @out_cur_index = 0)<br />

/* Get the voltage value. */<br />

set v2 = _simu_get("v(2)")<br />

/* Save previous results into working variables<br />

* (that will be returned).<br />

*/<br />

out_sampling = in_sampling<br />

out_cur_index = in_cur_index<br />

/* Save voltage. */<br />

out_sampling[out_cur_index] = v2<br />

out_cur_index++<br />

return 0<br />

.end_define_function<br />

.define_task main_simu<br />

set arr_sampling[] = 0<br />

set cur_index = 0<br />

set i = 0<br />

set res = simulation(callback=f_callback(in_sampling = arr_sampling,<br />

+ in_cur_index = cur_index,<br />

+ arr_sampling = @out_sampling,<br />

+ cur_index = @out_cur_index),<br />

+ elapsed_s_period=1)<br />

if (res.simu_status == 0)<br />

fprint(stdout, "Simulation succeeded.\n\n")<br />

fprint(stdout, "Sampling values for v(2):\n")<br />

for (i=0; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!