I have a procedure with a loop and would like to exit the loop after 20 min. The "Time condition" action would be perfect for this task, but I can't figure out, how to put the correct exit time (system time + 20 min) into the actions parameters.
My idea is:
1. Read the current system time, add 20 min and save the result in a variable "ExitTime" as a string.
2. Start the procedure with the loop.
3. The "Time condition" checks if ExitTime is reached, if not, the procedure is restarted - otherwise the macro continues with the next action. Something like that:
Code: Select all
<action name="ActionTimeCondition">
<exception id="0" action="0" line=""/>
<exception id="1" action="0" line=""/>
<exception id="2" action="1" line=""/>
<parameter name="date">
<subParameter name="value" code="1">ExitTime</subParameter>
</parameter>
<parameter name="ifAfter">
<subParameter name="action" code="0">call_procedure</subParameter>
<subParameter name="line" code="0">TimeLoop</subParameter>
</parameter>
<parameter name="ifBefore">
<subParameter name="action" code="0">do_nothing</subParameter>
<subParameter name="line" code="0"></subParameter>
</parameter>
<parameter name="ifNow">
<subParameter name="action" code="0">do_nothing</subParameter>
<subParameter name="line" code="0"></subParameter>
</parameter>
</action>
In general, I would be interested to know how to calculate time. I have another macro where you enter a quantity, but internally this should then be converted into processing time. If you enter 1000, I calculate the duration with 1000 x 1,5s = 1500 sec = 25 min. So for example the loop should run for 25 min, or at run time there should be a pause for 25 min. Or when the time (system time + 25 min) is reached, a certain procedure should be executed.