SysCpuAtomicAdd
(FUN)
FUNCTION SysCpuAtomicAdd : DINT
- <description>
Function to increment the content of the given pointer by nSum in one atomic operation (task safe). IMPLEMENTATION NOTE: - Add/Sub the value to the content of the pointer - Return the value after the Add/Sub operation Both things must be done atomic!
</description> <result><p>RESULT: Returns the value after the increment operation in an atomic way! </p></result> <SIL2/>
- InOut:
Scope
Name
Type
Comment
Return
SysCpuAtomicAdd
DINT
Input
piValue
POINTER TO DINT
<param name=”piValue” type=”INOUT”>Pointer to the value to increment</param>
nSum
DINT
<param name=”nSum” type=”IN”>Summand for the operation. >0 to increment, <0 to decrement</param>
pResult
POINTER TO RTS_IEC_RESULT
<param name=”pResult” type=”OUT”>Pointer to runtime system error code (see CmpErrors.library)</param>