TimerSeteDogruAktuelArtanZaman = TimerSetDegeri - AktuelAzalanZaman
Çıkarma işlemini yapabilmek için hepsini aynı boyuta getirebilirsen bu mantıkla sonucun ileri sayması gerekir.
Ekrandan girilen REAL tipinde sn biriminde bir verinin, S5Timer formu STL dilinde aşağıdaki gibidir.
Kod:
L #Time_from_OP // real format (seconds)
L 1000.0
*R
RND // here you get DINT in ms. It the same as TIME format
T #Time_in_ms
CALL "TIM_S5TI" // FC 40 from Standart library->IEC functions
IN := #Time_in_ms
OUT := #S5_time_output
Aynı kod SCL dilinde
Kod:
S5T := TIME_TO_S5TIME(IN := ROUND(1000 * "RealTime));