beautypg.com

Sensoray 2600 User Manual

Page 66

background image

Sensoray 2600 Programming Guide

62

Gateway Action Scheduling

Prototype:

u32 S26_Sched2653_SetModes( 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:

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

// Channels 6 and 7: PWM mode; all other channels: Standard mode.

u8 modes[] = { 0x00, 0xC0 };

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2653_SetModes( x, 2, modes );

S26_SchedExecute( x, 1000, 0 );

7.10.7 S26_Sched2653_SetOutputs()

Function:

Schedules the programming of all SSR output drivers on a model 2653 IOM.

Prototype:

u32 S26_Sched2653_SetOutputs( 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.

Example:

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

u8 states[] = {0x12, 0x5A };

// The desired relay states.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2653_SetOutputs( x, 9, states );

S26_SchedExecute( x, 1000, 0 );

7.10.8 S26_Sched2653_SetPwmRatio()

Function:

Schedules the programming of the PWM ratio for one SSR channel on a model 2653 IOM.

Prototype:

u32 S26_Sched2653_SetPwmRatio( XACT x, IOMPORT IomPort, u8 chan, u8 OnTime, u8 OffTime );

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 contains the channel mode flags. The first
byte corresponds to channels 0 (lsb) to 7 (msb), and the second byte to channels 8 (lsb)
to 15 (msb). Set a bit to one to operate in the PWM mode, or to zero to operate in the
Standard mode.

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 contains the desired states of the SSR output
drivers. The first byte corresponds to channels 0 (lsb) to 7 (msb), and the second byte
to channels 8 (lsb) to 15 (msb). Logic one indicates the associated channel is to be set
to the active state; zero indicates the channel is to be set to 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.

chan

u8

The SSR channel number that is to be programmed. Legal values range from 0 to 7.

OnTime

u8

PWM on time, expressed in 2 msec increments, to be programmed.

OffTime

u8

PWM off time, expressed in 2 msec increments, to be programmed.