Sensoray 2600 User Manual

Page 39

Advertising
background image

Sensoray 2600 Programming Guide

35

Gateway Action Scheduling

Prototype:

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

Notes:

This function fetches the programmed output driver states of all DIO channels. Note that the programmed output
driver states may not correspond exactly to the physical channel states because some channels may be driven by
external signal sources. In the case of channels that have been configured for the PWM mode, this function returns
indeterminate state values.

Example:

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

u8 douts[6];

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2610_GetOutputs( x, 2, douts );

S26_SchedExecute( x, 1000, 0 );

7.5.6 S26_Sched2610_GetPwmRatio()

Function:

Schedules the fetching of the PWM ratio for one DIO channel from a model 2610 IOM.

Prototype:

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

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

u8 ontime;

u8 offtime;

void *x = S26_SchedOpen( 0, 1 );

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

S26_SchedExecute( x, 1000, 0 );

7.5.7 S26_Sched2610_SetModes()

Function:

Schedules the programming of the operating modes for DIO channels 0 to 7 on a model 2610 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 6-byte application buffer that is to receive the output states of the 48 digital
I/O channels. The first byte receives channels 0 (lsb) to 7 (msb), the second byte
receives 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 queried. 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 *

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.

Advertising