ProSoft Technology MVI69-ADM User Manual
Page 212

Backplane API Functions
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 212 of 342
ProSoft Technology, Inc.
February 20, 2013
MVIbp_WaitForOutputScan
Syntax
int MVIbp_WaitForOutputScan(MVIHANDLE handle, WORD timeout);
Parameters
handle
Handle returned by previous call to MVIbp_Open
timeout
Maximum number of milliseconds to wait for scan
Description
MVIbp_WaitForInputScan allows an application to synchronize with the scan of
the module’s output image. This function will return immediately after the
module’s output image has been written. . This function may also be used by a
module application to determine if the Flex I/O bus is active.
handle must be a valid handle returned from MVIbp_Open. timeout specifies the
number of milliseconds that the function will wait for the output scan to occur.
Notes: There is no distinction in the MVI94 module between input and output scans. Therefore, the
MVIbp_WaitForInputScan and MVIbp_WaitForOutputScan functions will perform exactly the same
function and are interchangeable.
The scan time of the Flex I/O bus varies according to the number of modules installed. If the MVI-
ADM module is the only module present, then it will be scanned approximately every 200
microseconds. The maximum scan time for a full rack of 8 modules is approximately 1.6
milliseconds. Note that the scan time referred to here is not the PLC scan time, but the Flex I/O bus
scan time. The PLC scan time will depend upon which Flex adapter is used and how it is
configured.
MVI56 Note: This function is not supported for the MVI56 and will return
MVI_ERR_NOTSUPPORTED.
MVI94 Note: There is no distinction in the MVI94 module between input and output scans.
Therefore, the MVIbp_WaitForInputScan and MVIbp_WaitForOutputScan functions will perform
exactly the same function and are interchangeable.
Return Value
MVI_SUCCESS
The output scan has occurred.
MVI_ERR_NOACCESS
handle does not have access
MVI_ERR_TIMEOUT
The timeout expired before an output scan occurred.
MVI_ERR_BADCONFIG
the data connection is not open (MVI56 only)
Example
MVIHANDLE Handle;
int rc;
/* Wait here until output scan, 50ms timeout */
rc = MVIbp_WaitForOutputScan(Handle, 50);
if (rc == MVI_ERR_TIMEOUT)
printf("Output scan did not occur within 50ms\n");
else