ProSoft Technology MVI69-ADM User Manual

Page 298

Advertising
background image

CIP Messaging Library Functions

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 298 of 342

ProSoft Technology, Inc.

February 20, 2013

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 queries 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

Advertising