SerRTS

(Engine-Level Function)

Description: Sets or clears the RTS line on a serial communication port.
Returns: Nothing
Usage: Script or steady state.
Function Groups: Serial Port
Related to: COMPort | SerCheck | SerialStream | SerIn | StrLen | SerOut | SerRcv | SerSend | SerStrEsc | SerString | SerWait
Format:  SerRTS(Port, Level)
Parameters:  
Port
Required. Any numeric expression for the serial port number (opened with a ComPort function) or serial stream value (returned from a SerialStream function).
Level
Required. TRUE if the RTS line is to be turned on or false if the RTS line is to be turned off.
Comments: The corresponding ComPort statement must have the RTS parameter set to 2 or 3.

Example:

RTS = 0;
...
ComPort(2 { COM2: },
        1024 { Buffer 1024 bytes of received data },
        1024 { Buffer 1024 bytes of transmitted data },
        9600 { Baud rate },
        8, 1 { Data bits/byte, stop bits/byte },
        0 { No parity bit },
        3 { RTS may be controlled by SerRTS function },
        0, 0, 0 { Obsolete parameters },
        3 { Control: DTR On, CTS control enabled },
        0, 0, 0, 0, 0, 0, 0, 0, 0 { Obsolete parameters });
If MatchKeys(2, "R");
[
  RTS = 1 - RTS { Toggles RTS between 1 and 0 };
  SerRTS(2, RTS);
]

Comport 2 is opened to allow the setting of the RTS line. The second statement then toggles the RTS line of serial port 2 on and off every time the letter R is pressed on the keyboard.