SET.PORT.PARAMS()

SET.PORT.PARAMS()

Top  Previous  Next

 

The SET.PORT.PARAMS() function sets the communications parameters for a serial port.

 

 

Format

 

SET.PORT.PARAMS(fvar, params)

 

where

 

fvaris the file variable from the OPENSEQ statement that was used to open the port.

 

paramsis a dynamic array holding the new parameters to be set.

 

 

The SET.PORT.PARAMS() function returns True if successful, False if an error occurs.

 

The params dynamic array contains the following data:

 

Field 1Port name (ignored)
Field 2Baud rate
Field 3Parity mode (0 = off, 1 = odd, 2 = even)
Field 4Bits per byte (5 to 8)
Field 5Stop bits (1 or 2)

 

To allow for the possibility of additional fields being added in future releases, programs should use the GET.PORT.PARAMS() function to retrieve the current settings, modify this as required and then use SET.PORT.PARAMS() to set the new parameters.

 

 

Example

 

PARAMS = GET.PORT.PARAMS(PORT)

PARAMS<2> = 9600

IF NOT(SET.PORT.PARAMS(PORT, PARAMS) THEN STOP 'Error setting parameters'