Sensoray 2600 User Manual

Page 33

Advertising
background image

Sensoray 2600 Programming Guide

29

Gateway Action Scheduling

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2608_GetCalData( x, 1, 0 );

S26_Sched2608_GetAins( x, 1, ain, 0 );

S26_SchedExecute( x, 1000, 0 );

7.4.7 S26_Sched2608_GetAinTypes()

Function:

Schedules the fetching of all programmed analog input types from a model 2608 IOM.

Prototype:

u32 S26_Sched2608_GetAinTypes( XACT x, IOMPORT IomPort, u8 *types );

Returns:

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

Benchmark: 0.9 ms.

Notes:

The fetched values are the enumerated input types that were registered with the middleware when they were
programmed, after validation against the gain flags that are returned from the 2608 in response to a
OP_AIO_GETINPUTRANGES action.

There are two possible reasons for differences between the fetched and previously programmed values: (1) an
illegal type was specified when the input types were programmed, or (2) the 2608 IOM was unexpectedly reset. In
either case, all sixteen of the IOM’s registered analog input types will be reset to their default values
(

RAW_LG_TYPE

) when this scheduled action is executed.

Example:

// Get the analog input types from the 2608 at MM number 0, IOM port 1.

u8 aintypes[16];

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2608_GetAinTypes( x, 1, aintypes );

S26_SchedExecute( x, 1000, 0 );

7.4.8 S26_Sched2608_GetAout()

Function:

Schedules the fetching of one analog output setpoint from a model 2608 IOM.

Prototype:

u32 S26_Sched2608_GetAout( XACT x, IOMPORT IomPort, u8 chan, double *volts );

Returns:

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

Benchmark: 0.9 ms.

Notes:

In most cases the fetched setpoint value will equal the last programmed value. The exception to this is if the 2608
IOM was unexpectedly reset, in which case the fetched setpoint will be reset to zero.

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.

types

u8 *

Pointer to a 16-byte application buffer that is to receive the programmed, enumerated
analog input types for all analog input channels.

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

Analog output channel number. Valid channel numbers range from 0 to 3 on model
2608-4, or from 0 to 7 on model 2608-8. There are no analog output channels on
model 2608-0.

volts

double *

Pointer to a double-precision value that is to receive the fetched setpoint value. The
fetched value will be expressed as a voltage, with a value in the range from -10.0 to
+10.0.

Advertising