Lenze ApplicationTemplate PackML (PLC Designer R3-x) User Manual
Page 84

Architecture: The ApplicationTemplate PackML in detail
Consistent data transfer
84
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
• ...to be ensured for specific application cases. Depending on the application case, proceed as
follows:
Reserving/inhibiting data areas of the AppChannelData(ACD) structure
The ACD structure contains an L_EATP_CriticalSection block which, by means of the following
methods, ensures the data consistency of real time-critical data.
• If several blocks are required, further instances of the block can be use in the ACD structure.
1. Before the data area to be transmitted can be accessed consistently, the Lock() method has to
be called in a task. The Lock() method returns a BOOL value if...
• ...another task has already called the method ("TRUE").
• ...no task has called the method yet ("FALSE").
Application case
Data element/data type
Description
Data consistency within individual
data elements
Integer
INT
DINT
Direct access is permissible.
Bit fields
WORD
DWORD
Data consistency within one data
element
Floating point
LREAL
When the controller is used, data
consistency of an LREAL variable is
ensured.
Data consistency for more than one
data element
The data areas have to be...
• ...inhibited for others tasks before
the first access, using the Lock()
method.
• ...re-enabled after the last access,
using the Unlock() method.
Method
Function
Lock()
Reserve data area of the ACD structure.
Unlock()
Enable reserved data of the ACD structure.
LockState()
Query locked status of a data area.
Note!
Avoiding performance loss
Avoid inhibiting real time-critical data of the ACD structure by several MAPs within the
same machine module by the CriticalSection.
• Reserve an individual area for every MAP for real time-critical data in the ACD
structure, in order to avoid that the module application (MAP) of a low-priority task
(Task_Mid) slows down the MAP of a higher-priority task (Task_High).
Note!
A task may only use the data area (reading or writing) if the appChannelLock() method
has returned the TRUE value.