Sensoray 2600 User Manual

Page 54

Advertising
background image

Sensoray 2600 Programming Guide

50

Gateway Action Scheduling

Example:

// Configure counter 3 as a frequency counter on the 2620 at MM number 0, IOM port 12.

// Assumes: using previously configured internal time gate generator.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2620_SetModeFreqMeas( x, 12, 3, 1 );

// Set mode.

S26_SchedExecute( x, 1000, 0 );

7.7.8 S26_Sched2620_SetModePeriodMeas()

Function:

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

Prototype:

u32 S26_Sched2620_SetModePeriodMeas( XACT x, IOMPORT IomPort, u8 chan, u16 ActLowX );

Returns:

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

Benchmark: 2.0 ms.

Notes:

This function configures a counter channel so that it will measure the period of an external digital waveform
applied to the

index

input.

Example:

// Configure counter 3 as a frequency counter on the 2620 at MM number 0, IOM port 12.

// Assumes: both signal edges have similar jitter, so polarity is don’t care.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2620_SetModePeriodMeas( x, 12, 3, 0 );

// Set mode.

S26_SchedExecute( x, 1000, 0 );

7.7.9 S26_Sched2620_SetModePulseGen()

Function:

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

Prototype:

u32 S26_Sched2620_SetModePulseGen(XACT x, IOMPORT IomPort, u8 chan, u16 xp, u16 pl, u16 op);

Returns:

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

Benchmark: 1.5 ms.

Notes:

This function configures a counter channel so that it will generate a single output pulse in response to a hardware or
software trigger. The duration of the output pulse is determined by the value stored in the Preload0 register.

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.

ActLowX

u16

Index pin polarity: 1 = active low, 0 = active high. This doesn’t matter unless one
signal edge has more jitter than the other edge.

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.

xp

u16

Index pin polarity: 1 = active low, 0 = active high. This is a “don’t care” if pl is set to
zero.

pl

u16

Hardware triggered by index input: 0 = disable, 1 = enable. Note that a pulse can
always be triggered by software.

op

u16

Output pin polarity: 1 = active low, 0 = active high.

Advertising