POUs ¶ SysSemCreate (Function) SysSemDelete (Function) SysSemEnter (Function) SysSemLeave (Function) SysSemTry (Function)
SysSemCreate (FUN) ¶ FUNCTION SysSemCreate : DWORD This function can be used to create a semaphore (synchronization object). InOut: Scope Name Type Comment Return SysSemCreate DWORD Handle to the semaphore or RTS_INVALID_HANDLE if failed. Input bDummy BOOL Dummy variable, not used
SysSemDelete (FUN) ¶ FUNCTION SysSemDelete : BOOL This function deletes the semaphore which is identified by its handle. InOut: Scope Name Type Comment Return SysSemDelete BOOL Return the runtime system error code (see CmpErrors.library) Input dwHandle DWORD Handle of the semaphore
SysSemEnter (FUN) ¶ FUNCTION SysSemEnter : BOOL This function must be called before a task accesses data which also are used by other tasks. Thus the data will be bocked for other tasks, which also use SysSemEnter until by function SysSemLeave the semaphore will be set free again. The semaphore is identified by its handle. InOut: Scope Name Type Comment Return SysSemEnter BOOL Returns the runtime system error code (see CmpErrors.library) Input dwHandle DWORD Handle of the semaphore
SysSemLeave (FUN) ¶ FUNCTION SysSemLeave : BOOL This function must be called after an access on data which are also used by other tasks. This is necessary to release the semaphore, which has been blocked before the access by function SysSemEnter. The semaphore is identified by its handle. InOut: Scope Name Type Comment Return SysSemLeave BOOL Returns the runtime system error code (see CmpErrors.library) Input dwHandle DWORD Handle of the semaphore
SysSemTry (FUN) ¶ FUNCTION SysSemTry : BOOL Try to enter the semaphore. If semaphore is available, the function entered the semaphore and returned ERR_OK. If semaphore is not available, ERR_FAILED is returned. The semaphore is identified by its handle. Note Function is not blocking instead of SysSemEnter! Function returns immediate with an entered lock (ERR_OK) or without having the lock (ERR_FAILED)! InOut: Scope Name Type Comment Return SysSemTry BOOL Returns the runtime system error code (see CmpErrors.library) Input dwHandle DWORD Handle of the semaphore
extern30 ¶ GVL (GVL) SysSemCreate30 (Function) SysSemDelete30 (Function) SysSemEnter30 (Function) SysSemLeave30 (Function) SysSemTry30 (Function)
GVL (GVL) ¶ InOut: Scope Name Type Initial Constant SYSSEM_INVALID_HANDLE UDINT 16#FFFFFFFF
SysSemCreate30 (FUN) ¶ FUNCTION SysSemCreate30 : UDINT InOut: Scope Name Type Return SysSemCreate30 UDINT Input pResult POINTER TO UDINT
SysSemDelete30 (FUN) ¶ FUNCTION SysSemDelete30 : UDINT InOut: Scope Name Type Return SysSemDelete30 UDINT Input hSem UDINT