SysComSetSettingsΒΆ

This function serves to set values like baudrate, stopbits, parity, function-timout, buffer-size and scan-time for a serial port. The parameter value is of type POINTER TO COMSETTINGS; the structure COMSETTINGS is used.

As soon as the parameters could be set successfully, TRUE will be returned, otherwise FALSE.

Input Variable Data Type Description
ComSettings POINTER TO COMSETTINGS;

Pointer to the structure COMSETTINGS;

you can make use of the operator ADR (see below, example)

dwHandle DWORD Port handle, acquired by SysComOpen

The structure COMSETTINGS, which is also part of the library, is defined as follows:

TYPE COMSETTINGS :

STRUCT

Port:PORTS; Port number, see below: Enumeration PORTS
dwBaudRate:DWORD; 4800, 9600, 19200, 38400, 57600, 115200
byStopBits:BYTE; 0 = ONESTOPBIT, 1=ONE5STOPBITS, 2=TWOSTOPBITS
byParity:BYTE; 0 = NOPARITY, 1 = ODDPARITY, 2 = EVENPARITY
dwTimeout:DWORD; Timeout of the interface in ms, Default = 0
dwBufferSize:DWORD; Buffer size of the internal device buffer, Default = 0
dwScan:DWORD; Polling time of the serial interface; should be set to 0

END_STRUCT

END_TYPE

Enumeration PORTS:

TYPE PORTS : (COM1:=1, COM2, COM3, COM4, COM5, COM6, COM7, COM8);

END_TYPE