SysCpuCallIecFuncWithParams (FUN) ¶ FUNCTION SysCpuCallIecFuncWithParams : RTS_IEC_RESULT Call an IEC function from plain C code. Since different CPU’s/systems use different calling conventions, this function should be used as a wrapper. IEC functions or methods of function block use all the same calling convention: They have no return value and exactly one parameter, which is a pointer to a struct that contains all required IN and OUT parameters. NOTE: A call to the function SysCpuCallIecFuncWithParams with the parameter values <pointer (not equal to NULL)> in pParam and <0> in iSize has the same result as a call with the parameter values <NULL pointer> in pParam and <0> in iSize. Both result in a call without parameters of the function passed in parameter pfIECFunc. IN GENERAL: An IEC function must always be called with the parameters according to its definition. If an IEC function is called with parameters which do not correspond to the definition of the IEC function, the CODESYS Control runtime system may CRASH. RETURN: Returns the runtime system error code (see CmpErrors.library) <SIL2/> InOut: Scope Name Type Comment Return SysCpuCallIecFuncWithParams RTS_IEC_RESULT Input pfIECFunc POINTER TO BYTE Pointer to the IEC function that should be called pParam POINTER TO BYTE Pointer to the parameter struct that contains the function parameters. Can be 0 if not used. ulSize UDINT Size of the parameter structure to copy the content on stack. Can be 0.
SysCpuResetBit (FUN) ¶ FUNCTION SysCpuResetBit : RTS_IEC_RESULT <description> Reset 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).</p></result> InOut: Scope Name Type Comment Return SysCpuResetBit RTS_IEC_RESULT Input pulValue POINTER TO UDINT <param name=”pulValue” type=”IN”>Pointer to the unsigned value to reset a bit inside in one atomic processor step</param> ulBit UDINT <param name=”ulBit” type=”IN”>Bit number inside the variable to reset. 0=first bit, 31=last bit</param>
SysCpuResetBit2 (FUN) ¶ FUNCTION SysCpuResetBit2 : RTS_IEC_RESULT <description> Reset a bit in an BYTE 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).</p></result> InOut: Scope Name Type Comment Return SysCpuResetBit2 RTS_IEC_RESULT Input pbyValue POINTER TO BYTE <param name=”pbyValue” type=”IN”>Pointer to the unsigned value to reset a bit inside in one atomic processor step</param> ulBit UDINT <param name=”ulBit” type=”IN”>Bit number inside the variable to reset. 0=first bit, 7=last bit</param>
SysCpuSetBit2 (FUN) ¶ FUNCTION SysCpuSetBit2 : RTS_IEC_RESULT <description> Set a bit in an BYTE 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).</p></result> InOut: Scope Name Type Comment Return SysCpuSetBit2 RTS_IEC_RESULT Input pbyValue POINTER TO BYTE <param name=”pbyValue” type=”IN”>Pointer to the unsigned value to set a bit inside in one atomic processor step</param> ulBit UDINT <param name=”ulBit” type=”IN”>Bit number inside the variable to set. 0=first bit, 7=last bit</param>
SysCpuSetBit (FUN) ¶ FUNCTION SysCpuSetBit : RTS_IEC_RESULT <description> 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).</p></result> InOut: Scope Name Type Comment Return SysCpuSetBit RTS_IEC_RESULT Input pulValue POINTER TO UDINT <param name=”pulValue” type=”IN”>Pointer to the unsigned value to set a bit inside in one atomic processor step</param> ulBit UDINT <param name=”ulBit” type=”IN”>Bit number inside the variable to set. 0=first bit, 31=last bit</param>
SysCpuTestAndReset (FUN) ¶ FUNCTION SysCpuTestAndReset : RTS_IEC_RESULT <description> Test and reset 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 reset and was set before, ERR_FAILED: If bit is still reset </p></result> InOut: Scope Name Type Comment Return SysCpuTestAndReset RTS_IEC_RESULT Input pulValue POINTER TO UDINT <param name=”pulValue” type=”IN”>Pointer to the unsigned value to test and reset a bit inside in one atomic processor step</param> ulBit UDINT <param name=”ulBit” type=”IN”>Bit number inside the variable to test and reset. 0=first bit, 31=last bit</param>
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>
SysCpuTestAndSetBit (FUN) ¶ FUNCTION SysCpuTestAndSetBit : RTS_IEC_RESULT <description> <p>The function test and set or clear a bit in a variable in one processor step. This operation must be atomic to provide a multitasking save operation.</p> <p>IMPLEMENTATION NOTE: Try to use a processor opcode, that provides this operation. If such an opcode is not available, use SysCpuTestAndSetBitBase in your platform adaptation.</p> </description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p> <ul> <li>ERR_OK: bSet=1: If bit could be set and was not set before bSet=0: If bit could be cleared and was set before</li> <li>ERR_FAILED: bSet=1: If bit is still set bSet=0: If bit is still cleared</li> <li>ERR_PARAMETER: If pAddress=NULL or pAddress is unaligned or iBit is out nSize range</li> <li>ERR_NOT_SUPPORTED: If function is not available because of missing components (e.g. SysInt for locking bit access)</li> <li>ERR_NOTIMPLEMENTED: If function is not implemented on this platform</li> </ul> </result> <SIL2/> InOut: Scope Name Type Comment Return SysCpuTestAndSetBit RTS_IEC_RESULT Input pAddress POINTER TO BYTE <param name=”pAddress” type=”IN”>Pointer to test and set or clear a bit inside in one atomic processor step. NOTE: The pointer must be natural aligned! nLen=2: pAddress must be 2Byte aligned; nLen=4: pAddress must be 4Byte aligned</param> nLen UDINT <param name=”nLen” type=”IN”>Size of the value behind the address. Can only be 1 (unsigned char), 2 (unsigned short) or 4 (unsigned long)</param> iBit DINT <param name=”iBit” type=”IN”>Bit number inside the variable to test and set or clear: <ul> <li>nLen = 1: iBit 0..7</li> <li>nLen = 2: iBit 0..15</li> <li>nLen = 4: iBit 0..31</li> </ul> </param> bSet DINT <param name=”bSet” type=”IN”>1=Set bit, 0=Clear bit</param>
File and Project Information ¶ Scope Name Type Content FileHeader creationDateTime date 20.04.2021, 16:01:57 companyName string 3S-Smart Software Solutions GmbH libraryFile SysCpuHandling.library primaryProject True productName CODESYS productProfile CODESYS V3.5 SP16 Patch 3 contentFile SysCpuHandling.clean.json version version 2.0.0.0 ProjectInformation LinkInSimulation bool True Released True LastModificationDateTime date 20.04.2021, 16:01:57 LibraryCategories library-category-list System|SysLibs Author string 3S - Smart Software Solutions GmbH Company System CompiledLibraryCompatibilityVersion CODESYS V3.5 SP15 Patch 4 Description See: Description Placeholder SysCpuHandling Project SysCpuHandling Title SysCpuHandling Version version 3.5.17.0
Library Reference ¶ This is a dictionary of all referenced libraries and their name spaces. CmpErrors2 Interfaces ¶ Library Identification ¶ Name: CmpErrors2 Interfaces Version: newest Company: System Namespace: CmpErrors Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: CmpErrors2 Interfaces, * (System) SysMem ¶ Library Identification ¶ Placeholder: SysMem Default Resolution: SysMem, * (System) Namespace: SysMem Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: SysMem SysTypes2 Interfaces ¶ Library Identification ¶ Name: SysTypes2 Interfaces Version: newest Company: System Namespace: SysTypes Library Properties ¶ LinkAllContent: False Optional: False QualifiedOnly: False SystemLibrary: False Key: SysTypes2 Interfaces, * (System)