Sensoray 2600 User Manual

Page 35

Advertising
background image

Sensoray 2600 Programming Guide

31

Gateway Action Scheduling

Returns:

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

Benchmark: 0.8 ms.

Notes:

EEPROM addresses

0x00

through

0xAF

are reserved for use by the middleware. Addresses

0xB0

through

0xFF

are

available for general application use.

Example:

// Read EEPROM byte at address 0xB0 from the 2608 at MM number 0, IOM port 1.

u8 eeval;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2608_ReadEeprom( x, 1, 0xB0, &eeval );

S26_SchedExecute( x, 1000, 0 );

7.4.11 S26_Sched2608_SetAinTypes()

Function:

Schedules the programming of all analog input types on a model 2608 IOM.

Prototype:

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

Returns:

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

Benchmark: 0.9 ms.

Notes:

S26_Sched2608_SetAinTypes()

informs the middleware as to what sensor types and input ranges are being used

on the target IOM’s analog input channels. These type declarations are used by the middleware to convert
digitized input values to engineering units when

S26_Sched2608_GetAins

()

executes. In addition to registering

the input types with the middleware,

S26_Sched2608_SetAinTypes()

schedules the programming of the input

ranges for all analog input channels, as appropriate for the declared types.

Example:

// Specify the input types.

u8 SensorTypes[16] = {

V_10_TYPE, V_10_TYPE, V_10_TYPE, V_10_TYPE,

// Chan 0-7: ±10V range.

V_10_TYPE, V_10_TYPE, V_10_TYPE, V_10_TYPE,

V_001_TYPE, V_001_TYPE, V_001_TYPE, V_001_TYPE,

// Chan 8-11: ±100mV range.

TC_K_TYPE, TC_K_TYPE, TC_K_TYPE, TC_K_TYPE

// Chan 9-15: K thermocouples.

};

// Program the input types for the model 2608 at MM number 0, IOM port 1.

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2608_SetAinTypes( x, 1, SensorTypes );

S26_SchedExecute( x, 1000, 0 );

7.4.12 S26_Sched2608_SetAout()

Function:

Schedules the programming of one analog output setpoint on a model 2608 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.

types

u8 *

Pointer to a 16-byte application buffer that contains the enumerated analog input types
for all analog input channels. See section 7.4.2 for details.

Advertising