LINESTATUS Function

The LINESTATUS function returns information on the status of the RTS and DTR signals for a specified line.

Format

LINESTATUS(line-expr)

Parameter(s)

line-expr

An expression evaluating to the line number to check.

Description

The LINESTATUS function returns two characters, representing whether the RTS or DTR signals are high for the specified line. The RTS signal is the Request-To-Send signal, which is high when the attached device is ready to send data. The DTR signal is the Data-Terminal-Ready signal, which is high when the attached device is ready to receive data.

The LINESTATUS function returns a two-digit string, of the form:

rd

Parameter(s)

r

0 if RTS is low, 1 if RTS is high.

d

0 if DTR is low, 1 if DTR is high.

Example

In this application a modem is linked to the line MODEMLINE. Before attempting to dial a modem, a program checks that DTR is high.

LS = LINESTATUS(MODEMLINE)

DTR = LS [ 2 , 1 ]

IF DTR = "1" THEN

   GOSUB DIAL

END ELSE

   PRINT "DTR IS LOW. CHECK MODEM CONNECTIONS"

   GOSUB EXIT

END

 

NOTE

The LINESTATUS function does not return information on the status of the RTS and DTR signals for the line linked to the console port.

See Also

Statement and Function Reference