Sensoray 2600 User Manual

Page 62

Advertising
background image

Sensoray 2600 Programming Guide

58

Gateway Action Scheduling

Returns:

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

Benchmark: 0.9 ms.

Example:

// Fetch the PWM ratio for SSR channel 5 on the 2652 at MM number 0, IOM port 2.

u8 ontime;

u8 offtime;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2652_GetPwmRatio( x, 2, 5, &ontime, &offtime );

S26_SchedExecute( x, 1000, 0 );

7.9.6 S26_Sched2652_SetModes()

Function:

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

Prototype:

u32 S26_Sched2652_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.8 ms.

Example:

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

// Channels 0 to 5: Standard mode, channels 6 and 7: PWM mode.

u8 modes = 0xC0;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2652_SetModes( x, 2, &modes );

S26_SchedExecute( x, 1000, 0 );

7.9.7 S26_Sched2652_SetOutputs()

Function:

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

Prototype:

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

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 queried. Legal values range from 0 to 7.

OnTime

u8 *

Pointer to a 1-byte application buffer that is to receive the programmed PWM on time
expressed in 2 msec increments.

OffTime

u8 *

Pointer to a 1-byte application buffer that is to receive the programmed PWM off time
expressed in 2 msec increments.

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 1-byte application buffer that contains the channel mode flags. The byte
indicates the operating modes for SSR channels 0 to 7. Each bit is associated with a
channel number. For example, bit 4 is associated with channel 4. 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 1-byte application buffer that contains the desired states of the SSR output
drivers. Each bit is associated with one SSR channel. For example, bit 7 is associated
with channel 7. Any bit set to 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

Advertising