Sensoray 2600 User Manual

Page 34

Advertising
background image

Sensoray 2600 Programming Guide

30

Gateway Action Scheduling

Example:

// Get the analog output channel 2 setpoint from the 2608 at MM number 0, IOM port 1.

double setpoint;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2608_GetAout( x, 1, 2, setpoint );

S26_SchedExecute( x, 1000, 0 );

7.4.9 S26_Sched2608_GetCalData()

Function:

Schedules the fetching of calibration data from a model 2608 IOM.

Prototype:

u32 S26_Sched2608_GetCalData( XACT x, IOMPORT IomPort, short *caldata );

Returns:

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

Benchmark: 3.3 ms.

Notes:

S26_Sched2608_GetCalData()

schedules the fetching of calibration data that is used internally by the

middleware. The middleware uses the calibration data to perform offset and gain corrections for voltage
measurements and for reference-junction compensation for thermocouple measurements. In most applications it is
sufficient to call this function with the

caldata

argument set to zero because the typical application has no need

for direct access to calibration data.

S26_Sched2608_GetCalData()

must be called at least once before calling

S26_Sched2608_GetAins()

. In

addition,

S26_Sched2608_GetCalData()

should be called as needed to minimize errors due to circuit warm-up,

ambient temperature drift and thermal transients. The individual situation dictates when and how often this
function should be called, but as general rules-of-thumb:

q

If

S26_Sched2608_GetAins()

is called infrequently, call

S26_Sched2608_GetCalData()

just before each

call to

S26_Sched2608_GetAins()

.

q

If

S26_Sched2608_GetAins()

is called frequently, call

S26_Sched2608_GetCalData()

periodically. The

rate at which these periodic calls are made depends mostly on the 2608’s environment. Higher rates are
required where the 2608 is subjected to sudden temperature changes; in such cases once-per-second is a
suitable rate. In more stable environments, once per ten seconds may be adequate. Of course, if time permits
it is also permissible to simply call

S26_Sched2608_GetCalData()

just before each call to

S26_Sched2608_GetAins()

.

Example:

See the example in section 7.4.6.

7.4.10 S26_Sched2608_ReadEeprom()

Function:

Schedules the fetching of one data byte from the EEPROM on a model 2608 IOM.

Prototype:

u32 S26_Sched2608_ReadEeprom( XACT x, IOMPORT IomPort, u8 address, u8 *value );

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.

caldata

short *

Pointer to a 12*16-bit application buffer that is to receive the calibration data. Set to
zero if the application is not interested in receiving calibration data (this is the case for
most applications).

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.

address

u8

EEPROM memory address, in range 0x00 to 0xFF.

value

u8 *

Pointer to application u8 buffer that is to receive the EEPROM data byte.

Advertising