Publication 1756-RM004B-EN-P - October 2000
4-34 CIP Messaging API
MVIcip_GetConsoleMode
Syntax:
int MVIcip_GetConsoleMode(MVIHANDLE handle, int *mode, int
*baud);
Parameters:
handle handle returned by previous call to MVIcip_Open
mode pointer to an integer that is set to 1 if the console is
enabled, or 0 if the console is disabled.
baud pointer to an integer that is set to the console baud rate
index if the console is enabled.
Description:
This function is used to query the state of the console.
handle
must be
a valid handle returned from MVIcip_Open.
mode
is a pointer to an integer. When this function returns, mode will
be set to 1 if the console is enabled, or 0 if the console is disabled.
baud
is a pointer to an integer. When this function returns,
baud
will be
set to the console’s baud index value if the console is enabled. The
baud index values are shown in table
(4)
.
baud
is not set if the console
is disabled.
It may be useful for an application to detect that the console is enabled
and allow user interaction.
Note:
If the Setup Jumper is installed, the console is enabled at 19200
baud.
Return Value:
MVI_SUCCESS no errors were encountered
MVI_ERR_NOACCESS
handle
does not have access
Example:
MVIHANDLE handle;
int mode;
MVIcip_GetConsoleMode(handle, &mode);
if (mode)
// Console is enabled - allow user interaction
else
// Console is not available - normal operation