Sensoray 2600 User Manual

Page 51

Advertising
background image

Sensoray 2600 Programming Guide

47

Gateway Action Scheduling

Prototype:

u32 S26_Sched2620_GetStatus( XACT x, IOMPORT IomPort, u8 chan, u16 *status );

The returned

status

value has the following format:

Returns:

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

Benchmark: 0.9 ms.

Notes:

The format of the fetched status word is described in the Model 2600 Family Instruction Manual.

Example:

// Get status info from counter 3 on the 2620 at MM number 0, IOM port 12.

u16 status;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2620_GetStatus( x, 12, 3, &status );

S26_SchedExecute( x, 1000, 0 );

7.7.4 S26_Sched2620_SetControlReg()

Function:

Triggers a data transfer action for one counter channel on a model 2620 IOM.

Prototype:

u32 S26_Sched2620_SetControlReg( XACT x, IOMPORT IomPort, u8 chan, u8 DataVal );

Returns:

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

Benchmark: 0.8 ms.

Notes:

Use

CTC_TRIG_LATCH

to manually transfer the core’s counts to the data latch just before reading the counter. This

must be done, for example, when a channel is configured to operate with a quadrature encoder. This should not be

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 counter channel number that is to be accessed. Legal values range from 0 to 3.

status

u16 *

Pointer to a 16-bit application buffer that is to receive the status info.

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 counter channel number that is to be accessed. Legal values range from 0 to 3.

DataVal

u8

Data transfer action to be triggered:
CTC_TRIG_PRELOAD

(1) - Preload counter core.

CTC_TRIG_LATCH

(2) - Latch counter core.

QDE: Quadrature decoder error. This bit is automatically
reset by this GetStatus action.

LAT: Counter core was latched. This bit is automatically
reset by a GetCounts action.

GO: Counter was enabled by a trigger.

LOD: Counter was pre-loaded. This bit is automatically
reset by this GetStatus action.

EXT: Counter extension bit 32.

UF: Counter underflowed. This bit is automatically reset by
this GetStatus action.

OF: Counter overflowed. This bit is automatically reset by
this GetStatus action.

ZER: Counter value is now zero.

All other bits are reserved for future use.

15

0

14

0

13

0

12

0

11

0

10

0

9

0

8

0

7

QDE

6

LAT

5

GO

4

LOD

3

EXT

2

UF

1

OF

0

ZER

Advertising