Sensoray 2600 User Manual

Page 52

Advertising
background image

Sensoray 2600 Programming Guide

48

Gateway Action Scheduling

done, however, if you have configured a channel so that it’s core is automatically transferred to the latch in
response to an event (e.g., active index input).

Use

CTC_TRIG_PRELOAD

to manually transfer the Preload0 register into the counter core.

Example:

// Latch channel 3 counter core on the 2620 at MM number 0, IOM port 12.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2620_SetControlReg( x, 12, 3, CTC_TRIG_LATCH );

S26_SchedExecute( x, 1000, 0 );

7.7.5 S26_Sched2620_SetCommonControl()

Function:

Schedules the programming of the common control register for all counter channels on a model 2620 IOM.

Prototype:

u32 S26_Sched2620_SetCommonControl( XACT x, IOMPORT IomPort, u16 gperiod, u8 tstamp );

Returns:

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

Benchmark: 0.9 ms.

Example:

// Set gate period to 1 second, and timestamp resolution to 10 microseconds

// on the 2620 at MM number 0, IOM port 12.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2620_SetCommonControl( x, 12, 1000, 1 );

S26_SchedExecute( x, 1000, 0 );

7.7.6 S26_Sched2620_SetModeEncoder()

Function:

Schedules the programming of the operating mode of one counter channel on a model 2620 IOM.

Prototype:

u32 S26_Sched2620_SetModeEncoder( XACT x, IOMPORT IomPort, u8 chan, u16 xp, u16 pl, u16 m );

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.

gperiod

u16

Gate period, in milliseconds, for the time gate generator. This is the gate time applied
to all channels operating as frequency counters that use the internal time gate
generator. Any even value from 2 to 32766 may be specified, resulting in gate times
from 2 milliseconds to 32.766 seconds.

tstamp

u8

Timestamp resolution. May be set to one of the following values:
0 = 1 microsecond.
1 = 10 microseconds.
2 = 100 microseconds.
3 = 1 millisecond.

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.

Advertising