L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 55

Advertising
background image

L-force | PLC Designer

Lenze Specific Functions

DMS 4.1 EN 03/2011 TD29

53

2.3

PLC program for documentation of a cycle time violation
In the logbook of the L-force controller, you can document a cycle time violation by
means of the code described below.
When you are specifying the required cycle time of a PLC project, please follow the
procedures described in the communication manuals "Control Technology CANopen"
and "Control Technology EtherCAT" (section: "Specifying the minimum cycle time of
the PLC project").
Function:
• Information about a task can be requested from the "CmplecTask" system library

by means of variables of the type "Task_Info".

• The function "L_AddLog" can be used to generate a log entry in the logbook of the

L-force controller from the PLC.

• If the measured jitter is greater than the cycle time, a task cycle has failed and a

corresponding log entry is created in the logbook of the L-force controller.

Precondition:
• The libraries "CmpIecTask" and "SysTypes" have been integrated in the PLC

Designer project.

• The code indicated below must be called cyclically in the task to be examined.

Example of cycle time monitoring:

VAR
pIecTaskResult : POINTER TO RTS_IEC_RESULT;
tIecTaskHandle : RTS_IEC_HANDLE;
pIecTaskInfo : POINTER TO Task_Info;
tTaskInfo : Task_Info;
END_VAR
------------------------------------------------------------------------
tIecTaskHandle := IecTaskGetCurrent( pIecTaskResult );
pIecTaskInfo := IecTaskGetInfo2( tIecTaskHandle, pIecTaskResult );
tTaskInfo := pIecTaskInfo^;
IF ABS(tTaskInfo.iJitter) > TIME_TO_DINT(tTaskInfo.tInterval) THEN
L_AddLog(eSeverity:= L_TSeverity.L_LogWarning,
eFacility:= L_TFacility.L_PLC_USER_LOG_SCOPE1,
sLogPayLoad:= 'Violation of cycle time PRG');
END_IF

Advertising