SysTaskCycleTime block

Short summary

Name

SysTaskCycleTime

→POU type

→function

Category

more system blocks, blocks for target-system diagnostics

Graphical interface

images/download/thumbnails/414780309/SysTaskCycleTime-version-1-modificationdate-1534499090479-api-v2.png

Available since

Functionality

The block returns the cycle time of the →task in the context of which the block is called.

Return value


Identifier

→Data type

Description

Return value:

TIME

configured cycle time – the cycle time defined within the PLC-object

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

FUNCTION_BLOCK TestSysTaskCycleTime
VAR
configured : TIME;
okConfigured : BOOL;
END_VAR
configured := SysTaskCycleTime(ENO=>ENO);
(* Function 'TestSysTaskCycleTime' returns the configured cycle time. *)
okConfigured := configured = T#500ms;
ENO := AND(ENO, okConfigured);
END_FUNCTION_BLOCK

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.

Restriction for test framework

Do not use this block within a POU under test (see "Testing single POUs by using the test framework") because this block is not supported when a test is executed. Reason: The cycle time is adjusted during the test execution so this block returns faulty data.