SysCpuTestAndSet
(FUN)
FUNCTION SysCpuTestAndSet : RTS_IEC_RESULT
- <description>
- Test and set a bit in an ULONG variable in one processor step. This operation is to provide
a multitasking save operation.
</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).
ERR_OK: If bit could be set and was set before, ERR_FAILED: If bit is still set
</p></result>
- InOut:
Scope
Name
Type
Comment
Return
SysCpuTestAndSet
RTS_IEC_RESULT
Input
pulValue
POINTER TO UDINT
- <param name=”pulValue” type=”IN”>Pointer to the unsigned value to test and set a bit inside in one atomic
processor step</param>
ulBit
UDINT
<param name=”ulBit” type=”IN”>Bit number inside the variable to test and set. 0=first bit, 31=last bit</param>