ProSoft Technology MVI69-ADM User Manual
Page 208

Backplane API Functions
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 208 of 342
ProSoft Technology, Inc.
February 20, 2013
MVIbp_SetIOConfig
Syntax
int MVIbp_SetIOConfig(MVIHANDLE handle, MVIBPIOCONFIG *ioconfig);
Parameters
handle
Handle returned by previous call to MVIbp_Open
ioconfig
Pointer to MVIBPIOCONFIG structure which contains
configuration information
Description
This function defines the portion of the module’s I/O images that will be used for
direct I/O access, and to enable messaging.
handle must be a valid handle returned from MVIbp_Open.
By default, all of the module’s I/O image is available for direct I/O access, and
messaging is disabled. The MVIbp_SetIOConfig may be used to limit the amount
of I/O image available for direct access to only that which the application expects
to use. Attempts to access I/O outside of the range defined by this function will
result in an error.
If the application is to use the messaging functions (MVIbp_SendMessage and
MVIbp_ReceiveMessage), MVIbp_SetIOConfig must be called to enable
messaging and setup the maximum message size that will be allowed. The
message size is expressed in words.
The MVIBPIOCONFIG structure is defined as shown:
typedef struct tagMVIBPIOCONFIG
{
WORD TotalInputSize; // Size of entire input image in words
WORD TotalOutputSize; // Size of entire output image in words
WORD DirectInputSize; // Input words available for direct access
WORD DirectOutputSize; // Output words available for direct access
WORD MsgRcvBufSize; // Max size in words for received messages
WORD MsgSndBufSize; // Max size in words for sent messages
} MVIBPIOCONFIG;
The TotalInputSize and TotalOutputSize members are ignored by the API, since
the total I/O image sizes cannot be changed by the application. The
DirectInputSize and DirectOutputSize members should be set equal to the
number of words of the respective image that will be used for direct access via
the MVIbp_WriteInputImage or MVIbpReadOutputImage functions.
To enable the module to receive messages from the control processor via the
MVIbp_ReceiveMessage function, the MsgRcvBufSize member should be set to
the maximum message size expected. Likewise, to enable the module to send
messages to the control processor via the MVIbp_SendMessage function, the
MsgSndBufSize member should be set to the maximum message size expected.
The message sizes are expressed in words. The combined maximum message
size is 2048 words. If the sum of MsgRcvBufSize and MsgSndBufSize exceeds
2048, the error MVI_ERR_BADCONFIG will be returned.