RTO Timer on Arduino Opta (Retentive Timer)

does anyone know how to do a RTO Timer on an Arduino Opta? Allen Bradley System already has a function block for this. for a retentive timer that will resume counting form where it left off when the input goes true again. I've tried to create one manually but normally you would need a ONS input which I'm not sure how to replicate on the Opta as the Mov function to move the stored UDT back into the ET variable of a timer must only execute once

Look at here: CODESYS Forge - CODESYS Forge / Talk / Engineering 🇬🇧: RTO in CODESYS?

You can rewrite a function in Logic Lab