The library SysLibComEx.lib
The library SysLibComEx.lib
The SysLibComEx library is an extension for the handling of serial interfaces.
All serial interfaces can in principle be operated via the SysLibCom.lib. A special port must be specified
when opening the interface of a serial interface module.
The library SysLibComEx contains prepared global constants for the addressing of the ports and makes a
function for the switching between RS-422 and RS-485 available.
Global constants for the port addressing
(* COM port numbers *)
COM_PORT_ONBOARD : UINT := 1;
COM_PORT_SLOT : UINT := 2;
(* COM port numbers for extension modules (add 3 parts) *)
(* 1) module type *)
COM_PORT_EXT_RS232 : UINT := 21000;
COM_PORT_EXT_CURRENTLOOP : UINT := 22000;
COM_PORT_EXT_RS4XX : UINT := 23000;
(* 2) module address *)
COM_PORT_EXT_ADDR0 : UINT := 0;
COM_PORT_EXT_ADDR1 : UINT := 10;
COM_PORT_EXT_ADDR2 : UINT := 20;
COM_PORT_EXT_ADDR3 : UINT := 30;
(* 3) interface *)
COM_PORT_EXT_UPPER : UINT := 0;
COM_PORT_EXT_LOWER : UINT := 1;
Examples:
The port number for the serial interface on the CPU Baugruppe is determined as follows:
PortNo = COM_PORT_ONBOARD;
The port number for the upp
er port of a serial RS-232-C interface module with address 0 is calculated as
follows:
PortNo = COM_PORT_EXT_ADDR0+COM_PORT_EXT_UPPER+COM_PORT_EXT_RS232;
CECX-VIII 1