Comparison of subsystems to be included
This example shows two identical subsystems, with differences in the settings of the received control signal, in the first case the signal starts the model, in the second case it resets its execution.
The figure below shows the model itself.

Next, we will connect an auxiliary function to run the model.
In [ ]:
function run_model( name_model)
Path = (@__DIR__) * "/" * name_model * ".engee"
if name_model in [m.name for m in engee.get_all_models()] # Проверка условия загрузки модели в ядро
model = engee.open( name_model ) # Открыть модель
model_output = engee.run( model, verbose=true ); # Запустить модель
else
model = engee.load( Path, force=true ) # Загрузить модель
model_output = engee.run( model, verbose=true ); # Запустить модель
engee.close( name_model, force=true ); # Закрыть модель
end
sleep(5)
return model_output
end
Out[0]:
Let's run the model.
In [ ]:
run_model("CompareEnabled") # Запуск модели.
Out[0]:
Unpack and display the signals recorded from the model.
In [ ]:
held = simout["CompareEnabled/state_and_output_held.Out1"];
reset = simout["CompareEnabled/state_and_output_reset.Out1"];
Sine = simout["CompareEnabled/Sine Wave.1"];
held = collect(held);
reset = collect(reset);
Sine = collect(Sine);
plot(held.time, held.value)
plot!(reset.time, reset.value)
plot!(Sine.time, Sine.value)
Out[0]:
Conclusion
As we can see from the resulting graph, the system with reset goes to the initial state of the integrator at the moment of transition to the positive region of the control signal, while the system without reset continues counting from the last counted value inside the integrator.