BaseSystemLib hinzugefügt

This commit is contained in:
2026-06-29 16:28:48 +02:00
parent a51a0c6fd1
commit 14a1c5172d
168 changed files with 6797 additions and 0 deletions
@@ -0,0 +1,34 @@
FUNCTION_BLOCK "FB_CycleTime"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_OUTPUT
CycleTime : DInt;
END_VAR
VAR
TimeOld : DInt;
TimeNew : DInt;
END_VAR
BEGIN
//letzte Zykluszeit ermitteln
IF "FirstScan" THEN
//first Cycle
//no Cycletime
#TimeNew := TIME_TCK();
#CycleTime := 0;
#TimeOld := TIME_TCK();
ELSE
#TimeNew := TIME_TCK();
IF #TimeNew < #TimeOld THEN
//Systemzeit übergelaufen
#CycleTime := 2147483647 - #TimeOld + #TimeNew;
ELSE
#CycleTime := #TimeNew - #TimeOld;
END_IF;
#TimeOld := #TimeNew;
END_IF;
END_FUNCTION_BLOCK