ProSoft Technology MVI69-ADM User Manual
Page 236

Serial Port Library Functions
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 236 of 342
ProSoft Technology, Inc.
February 20, 2013
The number of stop bits is set by stopbits. Valid values for stop bits are
STOPBITS1 and STOPBITS2.
The handshake lines DTR and RTS of the port specified by comport are turned
on by MVIsp_Open.
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_Open will return
MVI_SUCCESS, but the baud rate will not be affected. It is recommended that the console be
disabled in BIOS Setup if COM1 is to be accessed with the serial API.
IMPORTANT: After the API has been opened, MVIsp_Close should always be called before exiting
the application.
Return Value
MVI_SUCCESS
port was opened successfully
MVI_ERR_REOPEN
port is already open
MVI_ERR_NODEVICE
UART not found on port
Note: MVI_ERR_NODEVICE will be returned if the port is not supported by the module.
Example
if ( MVIsp_Open(COM1,BAUD_9600,PARITY_NONE,WORDLEN8,STOPBITS1) != MVI_SUCCESS)
{
printf("Open failed!\n");
} else {
printf("Open succeeded\n");
}
See Also
MVIsp_Close (page 239)