Intel® Fortran Compiler 18.0 Developer Guide and Reference

SPORT_SET_STATE (W*S)

Serial Port I/O Function: Sets the baud rate, parity, data bits setting, and stop bits setting of the communications port.

Module

USE IFPORT

result = SPORT_SET_STATE (port [,baud] [,parity] [,dbits] [,sbits])

port

(Input) Integer. The port number.

baud

(Input; optional) Integer. The baud rate of the port.

parity

(Input; optional) Integer. The parity setting of the port (0-4 = no, odd, even, mark, space).

dbits

(Input; optional) Integer. The data bits for the port.

sbits

(Input; optional) Integer. The stop bits for the port (0, 1, 2 = 1, 1.5, 2).

Results

The result type is INTEGER(4). The result is zero if successful; otherwise, a Windows* error value.

The following restrictions apply:

NOTE

This routine must not be used when any I/O is pending. Since a read operation is always pending after any I/O has been started, you must first call SPORT_CANCEL_IO before port parameters can be changed.

Example

USE IFPORT
INTEGER(4) iresult
iresult =  SPORT_SET_STATE( 2, 9600, 0, 7, 0 )
END

See Also