1 type-specific errors – Sensoray 2600 User Manual

Page 58

Advertising
background image

Sensoray 2600 Programming Guide

54

Gateway Action Scheduling

7.7.13 S26_Sched2620_SetPreload()

Function:

Schedules the programming of a preload register for one counter channel on a model 2620 IOM.

Prototype:

u32 S26_Sched2620_SetPreload( XACT x, IOMPORT IomPort, u8 chan, u8 reg, u32 value );

Returns:

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

Benchmark: 1.1 ms.

Example:

// Set counter 3’s preload0 reg to 0x0001 on the 2620 at MM number 0, IOM port 12.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2620_SetPreload( x, 12, 3, 0, 0x0001 );

S26_SchedExecute( x, 1000, 0 );

7.8 Model 2650 Relay IOM

The functions in this section are used to schedule IOM actions for Model 2650 8-channel Relay IOMs. These functions are
applicable only to Model 2650 IOMs. Any attempt to call these functions for other IOM types will result in a

GWERR_IOMTYPE

transaction error. Note that these functions only schedule IOM actions into a transaction; they do not cause the actions to be
immediately executed.

7.8.1 Type-Specific Errors

In addition to the common IOM status bit flags (

STATUS_RST

and

STATUS_CERR

), this IOM type supports the following

type-specific flags. If any of these flags are asserted, a transaction error of type

GWERR_IOMSPECIFIC

will be generated:

7.8.2 S26_Sched2650_GetInputs()

Function:

Schedules the fetching of the measured states of all eight relay coil drivers on a model 2650 IOM.

Prototype:

u32 S26_Sched2650_GetInputs( XACT x, IOMPORT IomPort, u8 *states );

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.

chan

u8

The counter channel number that is to be accessed. Legal values range from 0 to 3.

reg

u8

Selects the preload register that is to be written to: 0 or 1.

value

u32

32-bit value to be written to the preload register.

Symbolic Name

Description

STATUS_2650_DRVR

One or more relay coil drivers failed to go to the commanded state. This may
be caused by a driver fault, a shorted relay coil or a serial data stream problem.
This flag can be cleared by invoking a ClearStatus action.

STATUS_2650_STRM

An error was detected in the serial data stream that is used to control the relay
drivers and monitor driver states. This flag can be cleared by invoking a
ClearStatus

action.

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.

states

u8 *

Pointer to a 1-byte application buffer that is to receive the measured states of the relay
drivers. Each bit is associated with one relay channel. For example, bit 7 is associated
with relay channel 7. Any bit set to one indicates the associated channel is set to the
active state; any bit set to zero indicates the channel is set to the inactive state.

Advertising