2 common iom actions, 1 type-specific errors – Sensoray 2600 User Manual

Page 26

Advertising
background image

Sensoray 2600 Programming Guide

22

Gateway Action Scheduling

u8 states;

// Buffer that will receive SSR states.

S26_Sched2652_GetInputs( x, 9, &states );

// Schedule the action.

}

void *x = S26_SchedOpen( 0, 1 );

// Obtain a transaction object.

ScheduleReadSSR( x );

// states NO LONGER EXISTS UPON RETURN !!!

S26_SchedExecute( x, 1000, 0 );

// Execute the transaction. ERROR!

In the above example,

states

has been designated as the buffer that will receive incoming data. Unfortunately,

states

will cease

to exist when

SchedultReadSSR()

returns, resulting in an error when the transaction executes.

7.2 Common IOM Actions

The functions in this section are used to schedule common IOM actions that apply to all IOM types, and in most cases, to the
gateway as well. Note that these functions only schedule actions into a transaction; they do not cause the actions to be immediately
executed. Usage of these functions is not dependent on the target IOM being any particular type, nor is it necessary for the IOM
type to be registered for the referenced IOM port.

7.2.1 Type-Specific Errors

In addition to the common bit flags (

STATUS_RST

and

STATUS_CERR

), some IOM types have type-specific bit flags. These special

flags may be asserted upon execution of any of the actions listed in this section. If any of these flags are asserted by any IOM, a
transaction error of type

GWERR_IOMSPECIFIC

will be generated.

7.2.2 S26_Sched2600_ClearStatus()

Function:

Schedules the resetting of one or more status bits for an IOM or the gateway.

Prototype:

u32 S26_Sched2600_ClearStatus( XACT x, IOMPORT IomPort, u8 BitMask );

Returns:

Error code as described in section 5.5. Zero is returned if the operation was successful.

Benchmark: 0.8 ms for IOMs, or 0.1 ms for the gateway.

Notes:

This function schedules a

ResetFlags

action, which will reset to zero the specified bit flags in the target IOM’s

status byte. Refer to the

ResetFlags

action in the Model 2600 Family Instruction Manual for more information.

Example:

// Clear the RST flag on the IOM connected to MM number 0, IOM port 6.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2600_ClearStatus( x, 6, STATUS_RST );

S26_SchedExecute( x, 1000, 0 );

7.2.3 S26_Sched2600_GetAddress()

Function:

Schedules the fetching of an IOM’s address shunt settings.

Prototype:

u32 S26_Sched2600_GetAddress( XACT x, IOMPORT IomPort, u8 *adrs );

Parameter

Type

Description

x

void *

Transaction handle obtained from S26_SchedOpen().

IomPort

u8

The IOM port number (on the MM) to which the target IOM is connected, or 0xFF if
the gateway is the target.

BitMask

u8

Specifies the status bits that are to be reset to zero.

Parameter

Type

Description

x

void *

Transaction handle obtained from S26_SchedOpen().

IomPort

u8

The IOM port number (on the MM) to which the target IOM is connected.

adrs

u8 *

Pointer to a 1-byte application buffer that is to receive the address.

Advertising