Publication 1756-RM004B-EN-P - October 2000
Serial Port API 5-9
Configuration
MVIsp_Config
Syntax:
int MVIsp_Config(int comport, BYTE baudrate, BYTE parity, BYTE
wordlen, BYTE stopbits);
Parameters:
comport communications port to open
baudrate baud rate for this port
parity parity setting for this port
wordlen number of bits for each character
stopbits number of stop bits for each character
Description:
MVIsp_Config allows the configuration of a serial port to be changed
after it has been opened.
comport specifies which port is to be opened. The valid values for the
1756-MVI module are COM1 (corresponds to PRT1), COM2
(corresponds to PRT2), and COM3 (corresponds to PRT3).
baudrate is the desired baud rate. The allowable values for baudrate
are shown in table 5.B.
Valid values for parity are PARITY_NONE, PARITY_ODD,
PARITY_EVEN, PARITY_MARK, and PARITY_SPACE.
wordlen sets the word length in number of bits per character. Valid
values for word length are WORDLEN5, WORDLEN6, WORDLEN7,
and WORDLEN8.
The number of stop bits is set by stopbits. Valid values for stop bits are
STOPBITS1 and STOPBITS2.
Note: If the console is enabled or the Setup jumper is installed, the
baud rate for COM1 is set as configured in BIOS Setup and cannot be
changed by MVIsp_Open. MVIsp_Config will return MVI_SUCCESS,
but the baud rate will not be affected.
Return Value:
MVI_SUCCESS no errors were encountered
MVI_ERR_NOACCESS comport has not been opened
MVI_ERR_BADPARAM invalid pointer