3 s26_schedexecutestart() – Sensoray 2600 User Manual

Page 22

Advertising
background image

Sensoray 2600 Programming Guide

18

Gateway Transaction Control

time-out interval has elapsed, whichever occurs first. When it is received, 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.

This function is the equivalent of calling, in sequence,

S26_SchedExecuteStart()

,

S26_SchedExecuteWait()

and

S26_SchedExecuteFinish()

.

Important: 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.

If

IomStatus

is non-zero (i.e., it points to a 16-byte application buffer), this buffer will be populated with the status

bytes received from all 16 IOMs. One status byte is populated for each IOM; for example,

IomStatus[14]

contains the status byte for the IOM that is connected to the MM’s IOM port number 14. A status byte will be set
to zero in cases where no IOM is connected to the port or no actions have been scheduled for the IOM.

Multiple status bytes will be received from an IOM if two or more module commands (MCmds) are addressed to
the same IOM within a single transaction. This can happen for various reasons:

q

Two actions scheduled for an IOM are separated by an action that is scheduled for a different IOM. In this
case the new MCmd is implicitly forced by the application program, because a new MCmd is required
whenever an action is scheduled for an IOM that differs from the previous action’s IOM.

q

A new MCmd is automatically forced by an action that would have overflowed the IOM’s response buffer.
This causes the IOM response buffer to be flushed before the new action response is generated.

q

A new MCmd is automatically forced by an action that would have exceeded the maximum legal MCmd
size.

q

A new MCmd is automatically forced if status bits that are masked off in the current MCmd are regarded as
relevant by a scheduled action. For example,

S26_Sched2600_ClearStatus()

may mask the

RST

status bit

so that it will not generate an error, but most other actions, such as

S26_Sched2600_IomGetProductID()

,

treat the

RST

bit as relevant. Consequently, a new MCmd will be automatically started between sequential

calls to

S26_Sched2600_ClearStatus()

and

S26_Sched2600_IomGetProductID()

.

The status byte that is written to

IomStatus[]

for each IOM is formed by logically or’ing together the status

bytes, after masking non-relevant bits, that are received from each of the IOM’s MCmds. As a result, each of the
application’s IOM status bytes is the consolidation of all relevant status information from all actions with the
associated IOM.

Example:

// Execute some I/O operations on MM number 0, and its connected IOMs.

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

//

// Execute the transaction. Report if errors were encountered.

if ( ( gwerr = S26_SchedExecute( x, 1000, status ) ) != 0 )

printf( "Transaction error: %d\n", gwerr );

6.2.3 S26_SchedExecuteStart()

Function:

Starts a transaction execution.

Advertising