Function EN Version 4.00

@SetNTComPortHandshake

NTComPort

Syntax

@SetNTComPortHandshake(OSCOMHANDLE1;RTS2;CTS3;DTR4;DSR5;XONXOFF6);

Description

Only for Engine under Windows!

Changes the current handshake setting for the COM port identified by OSCOMHANDLE OSCOMHANDLE1. Individual values can be preserved before changing by passing -1.

FN RTS2: (Ready-to-send)
Value   C symbol         Meaning
0      RTS_CONTROL_DISABLE   Disable RTS-line and leave it LOW
1      RTS_CONTROL_ENABLE   Enable RTS-line and leave it HIGH
2      RTS_CONTROL_HANDSHAKE   Enable normal RTS handshaking
3      RTS_CONTROL_TOGGLE   RTS HIGH if any data to transmit, else LOW

FN CTS3: (Clear-to-send)
Bit   HEX   Meaning
1      0001   Use CTS for output flow control (suspend if not HIGH)

FN DTR4: (Data-terminal-ready)
Value   C symbol         Meaning
0      DTR_CONTROL_DISABLE   Disable DTS-line and leave it LOW
1      DTR_CONTROL_ENABLE   Enable DTS-line and leave it HIGH
2      DTR_CONTROL_HANDSHAKE   Enable normal DTR handshaking

FN DSR5: (Data-set-ready)
Bit   HEX   Meaning
1      0001   Use DSR for output flow control (suspend if not HIGH)
2      0002   Use DSR for input control (ignore Bytes if not HIGH)

FN XONXOFF: (XON/XOFF)
Bit   HEX   Meaning
1      0001   Use XON/XOFF for output flow control
2      0002   Use XON/XOFF for input flow control

Common settings:

RTS/CTS:      @SetNTComPortHandshake(HANDLE;2;1;0;0;0);
RTS/CTS/DTR/DSR:   @SetNTComPortHandshake(HANDLE;2;1;2;1;0);
XON/XOFF:      @SetNTComPortHandshake(HANDLE;0;0;0;0;3);

Example: @SetNTComPortHandshake(OSCOMHANDLE1;RTS2;CTS3;DTR4;DSR5;XONXOFF6);

OSCOMHANDLE1:=@OpenNTComPort("COM1");
@SetNTComPortHandshake(OSCOMHANDLE1;2;1;1;0;0);OSCOMHANDLE1:=@CloseNTComPort(OSCOMHANDLE1);

Opens a COM port, sets its handshake settings to use RTS/CTS exclusively as normal handshake lines, sets DTR to HIGH, and then closes the port again.

Example: @SetNTComPortHandshake(OSCOMHANDLE1;RTS2;CTS3;DTR4;DSR5;XONXOFF6);

OSCOMHANDLE1:=@OpenNTComPort("COM1");
@SetNTComPortHandshake(OSCOMHANDLE1;-1;-1;0;-1;-1);OSCOMHANDLE1:=@CloseNTComPort(OSCOMHANDLE1);

Opens a COM port, sets DTR to LOW, and then closes the port again. This can be used to make a normally configured modem hang up.

Note : This text was machine-translated and may contain inaccuracies.