1 type-specific errors – Sensoray 2600 User Manual

Page 60

Advertising
background image

Sensoray 2600 Programming Guide

56

Gateway Action Scheduling

Example:

// Program all relay driver states on the 2650 at MM number 0, IOM port 9.

u8 states = 0x5A;

// The desired relay states.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2650_SetOutputs( x, 9, &states );

S26_SchedExecute( x, 1000, 0 );

7.9 Model 2652 Solid-State Relay IOM

The functions in this section are used to schedule IOM actions for Model 2652 8-channel Solid-State Relay IOMs. These functions
are applicable only to Model 2652 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.9.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.9.2 S26_Sched2652_GetInputs()

Function:

Schedules the fetching of the physical states of all eight SSR channels on a model 2652 IOM.

Prototype:

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

Returns:

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

Benchmark: 0.8 ms.

Notes:

Each SSR channel includes a monitoring circuit that enables the on-board processor to determine the physical state
of the channel. This scheduled action will fetch the monitored physical state of each channel, no matter whether
the channel is driven by its own output driver or by an external signal through an input SSR.

Physical states are sampled periodically at two millisecond intervals and passed through a 10 millisecond debounce
filter. Consequently, states may not accurately reflect the state of a channel that has changed its physical state
within the last twelve milliseconds.

Example:

// Get all physical SSR states from the 2652 at MM number 0, IOM port 9.

u8 states;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2652_GetInputs( x, 9, &states );

S26_SchedExecute( x, 1000, 0 );

7.9.3 S26_Sched2652_GetModes()

Function:

Schedules the fetching of the operating modes for all SSR channels on a model 2652 IOM.

Symbolic Name

Description

STATUS_2652_STRM

An error was detected in the serial data stream that is used to control the SSR
output drivers. 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 physical states of the SSR
channels. Each bit is associated with one channel. For example, bit 7 is associated
with channel 7. Any bit set to one indicates the associated channel is in the active
state; any bit set to zero indicates the channel is in the inactive state.

Advertising