The library SysLibComEx.lib
Functions
The SysLibComEx library contains the following functions:
ï‚· SysComSetMode: For the switching over to RS-485 and vice versa.
SysComSetMode
This function must be used in order to switch between RS-485 and RS-422.
The parameters for the serial communication module are set.
Input variable Data type Description
dwHandle DWORD Handle for the COM port (is received by calling of
SysComOpen). See functions of the library
SysLibCom.lib.
dwMode DWORD Option for COM port (COM_MODE_xxx *)
*) Global constant for the switching On/Off of the RS-485 operation.
(* RS4xx module operating mode: RS422/RS485 *)
COM_MODE_RS485_ENABLE : DWORD := 1;
COM_MODE_RS485_DISABLE : DWORD := 2;
Output variable Data type Description
SysComSetMode BOOL Return value:
TRUE ... Function successfully executed,
FALSE ... Function was not successfully
completed.
Example:
Setting of the serial interface module to RS-485 operating mode.
Handle := SysComOpen(
COM_PORT_EXT_ADDR0+COM_PORT_EXT_UPPER+COM_PORT_EXT_RS4XX);
SysComSetMode(Handle, COM_MODE_RS485_ENABLE);
CECX-VIII 2