Sensoray 2600 User Manual

Page 41

Advertising
background image

Sensoray 2600 Programming Guide

37

Gateway Action Scheduling

Prototype:

u32 S26_Sched2610_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: 1.3 ms.

Example:

// Program all DIO output states on the 2610 at MM number 0, IOM port 2.

u8 douts[6] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB };

// Desired DIO states.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2610_SetOutputs( x, 2, douts );

S26_SchedExecute( x, 1000, 0 );

7.5.10 S26_Sched2610_SetPwmRatio()

Function:

Schedules the programming of the PWM ratio for one DIO channel on a model 2610 IOM.

Prototype:

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

Returns:

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

Benchmark: 0.9 ms.

Example:

// Set the PWM ratio for DIO channel 5 on the 2610 at MM number 0, IOM port 2.

// PWM ratio = on for 20 msec, off for 30 msec.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2610_SetPwmRatio( x, 2, 5, 10, 15 );

S26_SchedExecute( x, 1000, 0 );

7.6 Model 2612 Analog IOM

The functions in this section are used to schedule IOM actions for Model 2612 Analog IOMs. These functions are applicable only
to Model 2612 IOMs. Any attempt to call these functions for other IOM types will result in a

GWERR_IOMTYPE

transaction error.

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

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 6-byte application buffer that contains the desired output states of the 48
digital I/O channels. The first byte contains channels 0 (lsb) to 7 (msb), the second
byte contains channels 8 (lsb) to 15 (msb), and so on.

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 DIO channel number that is to be programmed. Legal values range from 0 to 7 for
7410 firmware version 1.01 and below, or 0 to 31 for firmware versions 1.02 and
higher.

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.

Advertising