SysComClose (FUN) ¶ FUNCTION SysComClose : RTS_IEC_RESULT <description>Close a serial communication device.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysComClose RTS_IEC_RESULT Input hCom RTS_IEC_HANDLE <param name=”hCom” type=”IN”>Handle to com port to close</param>
SysComGetSettings (FUN) ¶ FUNCTION SysComGetSettings : RTS_IEC_RESULT <description>Get the parameter of the interface specified by handle. Use SysComGetSettings2()! This function should only be used for backward compatibility! </description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysComGetSettings RTS_IEC_RESULT Input hCom RTS_IEC_HANDLE <param name=”hCom” type=”IN”>Handle to com port</param> pSettings POINTER TO SysComSettings <param name=”pSettings” type=”IN”>Pointer to get settings</param> pSettingsEx POINTER TO SysComSettingsEx <param name=”pSettingsEx” type=”IN”>Pointer to get extended settings</param>
SysComGetSettings2 (FUN) ¶ FUNCTION SysComGetSettings2 : RTS_IEC_RESULT <description>Get the parameter of the interface specified by handle.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysComGetSettings2 RTS_IEC_RESULT Input hCom RTS_IEC_HANDLE <param name=”hCom” type=”IN”>Handle to com port</param> pSettings POINTER TO SysComSettings <param name=”pSettings” type=”IN”>Pointer to get settings</param> pSettingsEx2 POINTER TO SysComSettingsEx2 <param name=”pSettingsEx2” type=”IN”>Pointer to get extended settings</param>
SysComOpen (FUN) ¶ FUNCTION SysComOpen : RTS_IEC_HANDLE <description>Open a serial communication device.</description> <result><p>RESULT: Handle to the opened com port or RTS_INVALID_HANDLE if failed</p></result> InOut: Scope Name Type Comment Return SysComOpen RTS_IEC_HANDLE Input sPort SYS_COM_PORTS <param name=”sPort” type=”IN”>Com port to open. SYS_COMPORT1 = COM1, …</param> pResult POINTER TO RTS_IEC_RESULT <param name=”pResult” type=”OUT”>Pointer to runtime system error code (see CmpErrors.library)</param>
SysComOpen2 (FUN) ¶ FUNCTION SysComOpen2 : RTS_IEC_HANDLE <description>Opens a serial communication device specified by settings</description> <result><p>RESULT: Handle to the opened com port or RTS_INVALID_HANDLE if failed</p></result> InOut: Scope Name Type Comment Return SysComOpen2 RTS_IEC_HANDLE Input pSettings POINTER TO SysComSettings <param name=”pSettings” type=”IN”>Settings for the communication device. See category “Com port settings” for detailed information</param> pSettingsEx POINTER TO SysComSettingsEx <param name=”pSettingsEx” type=”IN”>Optional extended settings for the serial device. Can be 0.</param> pResult POINTER TO RTS_IEC_RESULT <param name=”pResult” type=”OUT”>Pointer to runtime system error code (see CmpErrors.library)</param>
SysComOpen3 (FUN) ¶ FUNCTION SysComOpen3 : RTS_IEC_HANDLE <description>Opens a serial communication device specified by settings</description> <result><p>RESULT: Handle to the opened com port or RTS_INVALID_HANDLE if failed</p></result> InOut: Scope Name Type Comment Return SysComOpen3 RTS_IEC_HANDLE Input pSettings POINTER TO SysComSettings <param name=”pSettings” type=”IN”>Settings for the communication device. See category “Com port settings” for detailed information</param> pSettingsEx2 POINTER TO SysComSettingsEx2 <param name=”pSettingsEx2” type=”IN”>Optional extended settings for the serial device. Can be 0.</param> pResult POINTER TO RTS_IEC_RESULT <param name=”pResult” type=”OUT”>Pointer to runtime system error code (see CmpErrors.library)</param>
SysComPurge (FUN) ¶ FUNCTION SysComPurge : RTS_IEC_RESULT <description>Clear the fifo buffer of the serial interface</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysComPurge RTS_IEC_RESULT Input hCom RTS_IEC_HANDLE <param name=”hCom” type=”IN”>Handle to com port</param>
SysComRead (FUN) ¶ FUNCTION SysComRead : UDINT <description>Reads the number of bytes from the receive buffer of the specified device. <p>IMPLEMENTATION NOTE: If the timeout elapsed until the requested number of bytes are received, the function returns the number of bytes already received! This must be considered in the caller and the implementation!</p></description> <result><p>RESULT: Number of actual read bytes</p></result> InOut: Scope Name Type Comment Return SysComRead UDINT Input hCom RTS_IEC_HANDLE <param name=”hCom” type=”IN”>Handle to com port</param> pbyBuffer POINTER TO BYTE <param name=”pbyBuffer” type=”IN”>Pointer to data buffer for received data</param> ulSize UDINT <param name=”uiSize” type=”IN”>Requested number of bytes to read. Must be less or equal the size of the receive buffer!</param> ulTimeout SYS_COM_TIMEOUT <param name=”ulTimeout” type=”IN”>Timeout in milliseconds to read data from the device. [0]=Immediate return. If the timeout elapsed, the function returns with the still received data (could be less then the requested number of bytes!)</param> pResult POINTER TO RTS_IEC_RESULT <param name=”pResult” type=”OUT”>Pointer to return the runtime system error code (see CmpErrors.library).</param>
SysComSetSettings (FUN) ¶ FUNCTION SysComSetSettings : RTS_IEC_RESULT <description>Set the parameter of the interface specified by handle. Use SysComSetSettings2()! This function should only be used for backward compatibility! </description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysComSetSettings RTS_IEC_RESULT Input hCom RTS_IEC_HANDLE <param name=”hCom” type=”IN”>Handle to com port</param> pSettings POINTER TO SysComSettings <param name=”pSettings” type=”IN”>Pointer to new settings</param> pSettingsEx POINTER TO SysComSettingsEx <param name=”pSettingsEx” type=”IN”>OPTIONAL: Pointer to extended settings or 0</param>
SysComSetSettings2 (FUN) ¶ FUNCTION SysComSetSettings2 : RTS_IEC_RESULT <description>Set the parameter of the interface specified by handle.</description> <result><p>RESULT: Returns the runtime system error code (see CmpErrors.library).</p></result> InOut: Scope Name Type Comment Return SysComSetSettings2 RTS_IEC_RESULT Input hCom RTS_IEC_HANDLE <param name=”hCom” type=”IN”>Handle to com port</param> pSettings POINTER TO SysComSettings <param name=”pSettings” type=”IN”>Pointer to new settings</param> pSettingsEx2 POINTER TO SysComSettingsEx2 <param name=”pSettingsEx2” type=”IN”>OPTIONAL: Pointer to extended settings or 0</param>