Sensoray 2600 User Manual
Page 24

Sensoray 2600 Programming Guide
20
Gateway Transaction Control
Prototype:
u32 S26_SchedExecuteFinish( XACT x, u8 *IomStatus );
Returns:
Error code as described in section 5.5. Zero is returned if the operation was successful.
Notes:
This function assumes that a gateway response packet has already been received for the specified transaction. An
error code will be returned if a received packet is not available for processing. The response packet is checked for
errors and, if no errors are detected, all of the embedded IOM responses are extracted from the response packet and
copied to their target application buffers.
The specified transaction object will no longer exist and the transaction handle will no longer be valid when this
function returns. After calling this function, do not attempt to use the transaction handle again in calls to action
scheduling functions.
Example:
// Do some I/O operations on MM number 0 and its connected IOMs in a non-blocking way.
u8 status[16];
// All IOM status bytes will be put here.
u32 gwerr;
// Transaction error code will be put here.
// Create a new transaction for MM number 0.
void *x = S26_SchedOpen( 0, 1 );
//
// ToDo: Schedule the desired I/O operations into the transaction ...
//
// Start the transaction executing.
S26_SchedExecuteStart( x );
// Do some other things while the transaction executes.
while ( !S26_SchedExecuteIsResponded( x ) )
{
//
// ToDo: Do some other things ...
//
if ( no_more_things_to_do )
{
// Wait for transaction response packet, then exit the loop.
S26_SchedExecuteWait( x, 1000 )
break;
}
}
// Process the transaction response packet. Report if errors were encountered.
if ( ( gwerr = S26_SchedExecuteFinish( x, status ) ) != 0 )
printf( "Transaction error: %d\n", gwerr );
Parameter
Type
Description
x
void *
Transaction handle obtained from S26_SchedOpen().
IomStatus
u8 *
Pointer to a 16-byte buffer that will receive the status bytes from all IOMs. Set to zero
if you are not interested in receiving IOM status info.