Helper Fuctions ¶ The exchange of data between different tasks can be carried out with the functions (Message Passing) of the CAA_MemBlockManager ( MBM.MsgSend , MBM.MsgReceive ). Alternatively the jobs of different tasks on shared memory can be coordinated with the following functions or function blocks. These functions are to protect short code sections against simultaneous access of other IEC tasks (e.g. the consistent reallocation of pointers). This function uses a central semaphore and is based on the macros CAA_ENTER_LOCK and CAA_LEAVE_LOCK in the runtime system. As a consequence, a caller is really blocked. These functions are only meant for library developers and therefore have the attribute hide . TaskLock (Function) TaskUnlock (Function)
TaskLock (FUN) ¶ FUNCTION TaskLock : ERROR This call blocks the calling task until the respective code section is free. InOut: Scope Name Type Return TaskLock ERROR Input xDummy BOOL
TaskUnlock (FUN) ¶ FUNCTION TaskUnlock : ERROR This call unlocks a code section formally blocked with TaskLock. InOut: Scope Name Type Return TaskUnlock ERROR Input xDummy BOOL
Types ¶ COUNT (Alias) DURATION (Alias) FILENAME (Alias) FLOAT (Alias) HANDLE (Alias) IDENT (Alias) PVOID (Alias) SIGNED (Alias) SIZE (Alias) TICK (Alias) UNSIGNED (Alias)
COUNT (ALIAS) ¶ TYPE COUNT : __UXINT Realize a target specific data type for handlig counter values.
DURATION (ALIAS) ¶ TYPE DURATION : TIME Realize a general data type for handlig durations.
FILENAME (ALIAS) ¶ TYPE FILENAME : STRING(255) Realize a target specific data type for handlig filenames.
HANDLE_TO_LWORD (FUN) ¶ FUNCTION HANDLE_TO_LWORD : LWORD InOut: Scope Name Type Return HANDLE_TO_LWORD LWORD Input hValue HANDLE
HANDLE_TO_WORD (FUN) ¶ FUNCTION HANDLE_TO_WORD : WORD InOut: Scope Name Type Return HANDLE_TO_WORD WORD Input hValue HANDLE
LWORD_TO_HANDLE (FUN) ¶ FUNCTION LWORD_TO_HANDLE : HANDLE InOut: Scope Name Type Return LWORD_TO_HANDLE HANDLE Input lwValue LWORD