SysCpuAtomicAdd64 (FUN) ¶ FUNCTION SysCpuAtomicAdd64 : LINT <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 SysCpuAtomicAdd64 LINT Input piValue POINTER TO LINT <param name=”piValue” type=”INOUT”>Pointer to the value to increment</param> nSum LINT <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>
SysCpuAtomicCompareAndSwap (FUN) ¶ FUNCTION SysCpuAtomicCompareAndSwap : RTS_IEC_RESULT <description> Function for compare-and-swap in one atomic operation (task safe). Supports only 32- and 64-bit types The function compares the pAddress value with the pCompareValue value. If the pAddress value is equal to the pCompareValue value, the pSwapValue value is stored in the address specified by pAddress. Otherwise, no operation is performed. The function was successful if the * pSwapValue value is stored in the address specified by pAddress. </description> <result><p>RESULT: Returns ERR_OK if the swap was successful (if the pSwapValue value is stored in the address specified by pAddress) </p></result> <SIL2/> InOut: Scope Name Type Comment Return SysCpuAtomicCompareAndSwap RTS_IEC_RESULT Input pAddress POINTER TO BYTE pointer to the value to test pSwapValue POINTER TO BYTE pointer to new valid pCompareValue POINTER TO BYTE pointer to compare value valueSize USINT size of the value
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.
COM_Settings (STRUCT) ¶ TYPE COM_Settings : STRUCT <category>Com port settings</category> <description> <element name=”sPort” type=”IN”>Port number: 0=disabled, 1=COM1, 2=COM2, …. See category “Com ports”</element> <element name=”ulBaudRate” type=”IN”>Baudrate. See “category “Baudrates”</element> <element name=”byStopBits” type=”IN”>Stop bits. See category “Stop bits”</element> <element name=”byParity” type=”IN”>Parity. See category “Parity”</element> <element name=”ulTimeout” TYPE=”IN”>Hardware timeout. The Timeout is the TIME between two received OR sent characters until the read or write operation will return. Typically this value should be 0 (returns immediately)</element> <element name=”ulBufferSize” type=”IN”>Buffersize of FIFO buffer</element> </description> InOut: Name Type sPort COM_Ports byStopBits COM_StopBits byParity COM_Parity ulBaudrate COM_Baudrate ulTimeout COM_Timeout ulBufferSize UDINT
COM_SettingsEx (STRUCT) ¶ TYPE COM_SettingsEx : STRUCT <category>Com port extended settings</category> <description> <element name=”byByteSize” TYPE=”IN”>Number OF bits/BYTE, 4-8</element> <element name=”bBinary” TYPE=”IN”>binary mode, no EOF check</element> <element name=”bOutxCtsFlow” TYPE=”IN”>CTS handshaking on output</element> <element name=”bOutxDsrFlow” TYPE=”IN”>DSR handshaking on output</element> <element name=”bDtrControl” TYPE=”IN”>DTR Flow control</element> <element name=”bDsrSensitivity” TYPE=”IN”>DSR Sensitivity</element> <element name=”bRtsControl” TYPE=”IN”>Rts Flow control</element> <element name=”bTXContinueOnXoff” TYPE=”IN”>XOFF continues Tx</element> <element name=”bOutX” TYPE=”IN”>XON/XOFF out flow control</element> <element name=”bInX” TYPE=”IN”>XON/XOFF in flow control</element> <element name=”XonChar” TYPE=”IN”>Tx AND Rx XON character</element> <element name=”XoffChar” TYPE=”IN”>Tx AND Rx XOFF character</element> <element name=”XonLim” TYPE=”IN”>transmit XON threshold</element> <element name=”XoffLim” TYPE=”IN”>transmit XOFF threshold</element> </description> InOut: Name Type byByteSize BYTE bBinary BOOL bOutxCtsFlow BOOL bOutxDsrFlow BOOL bDtrControl BOOL bDsrSensitivity BOOL bRtsControl BOOL bTXContinueOnXoff BOOL bOutX BOOL bInX BOOL byXonChar BYTE byXoffChar BYTE wXonLim WORD wXoffLim WORD
COM_StopBits (ENUM) ¶ TYPE COM_StopBits : <category>Stop bits</category> <description></description> InOut: Name Initial SYS_ONESTOPBIT 1 SYS_ONE5STOPBITS SYS_TWOSTOPBITS
COM_Timeout (ENUM) ¶ TYPE COM_Timeout : <category>Timeouts</category> <description></description> InOut: Name Initial SYS_NOWAIT 0 SYS_INFINITE 16#FFFFFFFF
SysComClose30 (FUN) ¶ FUNCTION SysComClose30 : RTS_IEC_RESULT InOut: Scope Name Type Return SysComClose30 RTS_IEC_RESULT Input hCom RTS_IEC_HANDLE
SysComGetSettings30 (FUN) ¶ FUNCTION SysComGetSettings30 : RTS_IEC_RESULT InOut: Scope Name Type Return SysComGetSettings30 RTS_IEC_RESULT Input hCom RTS_IEC_HANDLE pSettings POINTER TO COM_Settings pSettingsEx POINTER TO COM_SettingsEx
SysComOpen30 (FUN) ¶ FUNCTION SysComOpen30 : RTS_IEC_HANDLE InOut: Scope Name Type Return SysComOpen30 RTS_IEC_HANDLE Input sPort COM_Ports pResult POINTER TO RTS_IEC_RESULT