1 type-specific errors – Sensoray 2600 User Manual

Page 50

Advertising
background image

Sensoray 2600 Programming Guide

46

Gateway Action Scheduling

Example:

// Restore calibrations on the 2612 at MM number 0, IOM port 10, channel 2.

S26_2612_RestoreCalibrations( 0, 10, 1000, 2 );

7.7 Model 2620 Counter IOM

The functions in this section are used to schedule IOM actions for Model 2620 4-channel Counter IOMs. These functions are
applicable only to Model 2620 IOMs. Any attempt to call these functions for other IOM types will result in a

GWERR_IOMTYPE

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

7.7.1 Type-Specific Errors

This IOM type has no type-specific IOM status flags.

7.7.2 S26_Sched2620_GetCounts()

Function:

Schedules the fetching of the latched counts from one counter channel on a model 2620 IOM.

Prototype:

u32 S26_Sched2620_GetCounts( XACT x, IOMPORT IomPort, u8 chan, u32 *value, u16 *tstamp );

Returns:

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

Benchmark: 1.1 ms when

tstamp

is zero, 1.6 ms when

tstamp

is non-zero.

Notes:

The fetched

value

will be the value contained in the target counter’s data latch at the moment the action executes

on the IOM. If tstamp is non-zero, the time stamp value will also be fetched; the fetched time stamp value will be
the value contained in the target counter’s time stamp latch at the moment the action executes on the IOM.

The time stamp value should be fetched only if it is needed as extra communication overhead is required to fetch
this value.

Example:

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

u32 counts;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2620_GetCounts( x, 12, 3, &counts, 0 );

S26_SchedExecute( x, 1000, 0 );

Example:

// Get counts and timestamp from counter 3 on the 2620 at MM number 0, IOM port 12.

u32 counts;

u16 tstamp;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2620_GetCounts( x, 12, 3, &counts, &tstamp );

S26_SchedExecute( x, 1000, 0 );

7.7.3 S26_Sched2620_GetStatus()

Function:

Schedules the fetching of the status of one counter channel from a model 2620 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.

chan

u8

The counter channel number that is to be accessed. Legal values range from 0 to 3.

value

u32 *

Pointer to a 32-bit application buffer that is to receive the counts.

tstamp

u16 *

Pointer to a 16-bit application buffer that is to receive the time stamp. Specify zero if
you do not need the time stamp value.

Advertising