The library EventData.lib
Examples
The following examples explain the use of the library functions.
Event-driven task ‘interrupt enabled DI edge detected’
This example uses a task which reacts to the interrupt of a correspondingly configured digital input.
Therein, the data from the last occurring interrupt is evaluated and the interrupt per digital input are
counted according to their type (rising / falling edge).
PROGRAM DI_Edge
VAR
A: INT;
eventcount: UDINT;
IntrEdge: IntrEdgeData;
lastValidIntrEdge: IntrEdgeData;
DI0Falling: DINT;
DI0Rising: DINT;
DI1Falling: DINT;
DI1Rising: DINT;
END_VAR
eventcount := eventcount + 1;
IF GetLastIntrEdge(ADR(IntrEdge)) THEN
A:=A+1;
lastValidIntrEdge := IntrEdge;
IF (lastValidIntrEdge.eventMask AND 1) = 1 THEN
DI0Falling := DI0Falling +1;
END_IF;
IF (lastValidIntrEdge.eventMask AND 2) = 2 THEN
DI0Rising := DI0Rising +1;
END_IF;
IF (lastValidIntrEdge.eventMask AND 4) = 4 THEN
DI1Falling := DI1Falling +1;
END_IF;
IF (lastValidIntrEdge.eventMask AND 8) = 8 THEN
DI1Rising := DI1Rising +1;
END_IF;
END_PROGRAM
System event ‚DI_edge’
As with the above example, the data of the last occurring interrupt is evaluated, however, directly in the
interrupt context. The name of the function inserted in the task configuration under 'System events' must
begin with 'Callback'.
Global variables were created in order to have access to the evaluated data outside of the interrupt
processing.
This function runs in the interrupt context. No waiting loops may be programmed therein and
the program code should be as short as possible since otherwise the system can be blocked.
VAR_GLOBAL
int_eventcount: UDINT;
int_lastValidIntrEdge: IntrEdgeData;
int_DI0Falling: DINT;
int_DI0Rising: DINT;
int_DI1Falling: DINT;
int_DI1Rising: DINT;
END_VAR
FUNCTION Callback_DI: DWORD
VAR_INPUT
dwEvent: DWORD;
pData: POINTER TO IntrEdgeData;
dwOwner: DWORD;
END_VAR
CECX-IV 3
Содержание CECX-X-C1 Series
Страница 1: ...Manual Controller Modular CECX CECX X C1 CECX X M1 761886 1112c en ...
Страница 2: ...1112c en ...
Страница 4: ......
Страница 6: ...1112c en ...
Страница 7: ...CECX modular control system CECX modular control system ...
Страница 46: ...CECX modular control system CECX I 38 ...
Страница 47: ...System manual CECX ...
Страница 48: ...CECX II ...
Страница 56: ...Content System Manual CECX VIII ...
Страница 58: ...System manual CECX Product design CECX II 0 2 ...
Страница 68: ...System manual CECX Safety notes CECX II 2 6 ...
Страница 76: ...System manual CECX System overview CECX II 3 8 ...
Страница 84: ...System manual CECX General assembly and installation instructions CECX II 4 8 ...
Страница 118: ...System manual CECX Operating behavior CECX II 8 6 ...
Страница 122: ...System manual CECX Disposal CECX II 10 2 ...
Страница 124: ...System manual CECX Technical data CECX II 11 2 ...
Страница 166: ......
Страница 180: ......
Страница 212: ......
Страница 219: ...System manual CECX Digital input output module CECX D 6E8A PN 2 CECX II 18 7 18 4 2 3 Connection diagram Input diagram ...
Страница 232: ......
Страница 248: ......
Страница 260: ......
Страница 278: ......
Страница 294: ......
Страница 308: ......
Страница 412: ......
Страница 426: ......
Страница 500: ...System manual CECX Bus link module CECX B CO CECX II 34 64 ...
Страница 501: ...The library Ethernet lib The library Ethernet lib ...
Страница 505: ...The library EventData lib The library EventData lib ...
Страница 511: ...The library IncEnc lib The library IncEnc lib ...
Страница 517: ...The Festo_EasyIP lib library ...
Страница 532: ......
Страница 535: ...The library PLCService lib The library PLCService lib ...
Страница 542: ...The library PLCService lib CECX VII 6 ...
Страница 543: ...The library SysLibComEx lib The library SysLibComEx lib ...
Страница 547: ...The Festo_Motion lib library ...
Страница 584: ......
Страница 585: ...The Festo_PartDetector lib library ...
Страница 601: ...FED VipWin interface ...
Страница 630: ......