beautypg.com

Sensoray 2600 User Manual

Page 64

background image

Sensoray 2600 Programming Guide

60

Gateway Action Scheduling

Prototype:

u32 S26_Sched2653_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.9 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 2653 at MM number 0, IOM port 9.

u8 states[2];

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2653_GetInputs( x, 9, states );

S26_SchedExecute( x, 1000, 0 );

7.10.3 S26_Sched2653_GetModes()

Function:

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

Prototype:

u32 S26_Sched2653_GetModes( XACT x, IOMPORT IomPort, u8 *modes );

Returns:

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

Benchmark: 0.9 ms.

Example:

// Get all SSR channel operating modes from the 2653 at MM number 0, IOM port 2.

u8 modes[2];

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2653_GetModes( x, 2, modes );

S26_SchedExecute( x, 1000, 0 );

7.10.4 S26_Sched2653_GetOutputs()

Function:

Schedules the fetching of the programmed states of all SSR drivers on a model 2653 IOM.

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 2-byte application buffer that is to receive the physical states of the SSR
channels. The first byte corresponds to channels 0 (lsb) to 7 (msb), and the second
byte to channels 8 (lsb) to 15 (msb). A logic one indicates the channel is in its active
state; logic zero indicates the inactive state.

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.

modes

u8 *

Pointer to a 2-byte application buffer that is to receive the SSR channel mode info.
The first byte corresponds to channels 0 (lsb) to 7 (msb), and the second byte to
channels 8 (lsb) to 15 (msb). A logic one indicates the channel is operating in PWM
mode; logic zero indicates Standard mode.