1 type-specific errors – Sensoray 2600 User Manual

Page 37

Advertising
background image

Sensoray 2600 Programming Guide

33

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; applications should not write to

any locations in this reserved address range. Addresses

0xB0

through

0xFF

are available for application use.

Note that this function executes an EEPROM write, rather than just scheduling one.

Example:

// Write 0x05 to EEPROM address 0xB0 on the 2608 at MM number 0, IOM port 1.

S26_2608_WriteEeprom( 0, 1, 1000, 0xB0, 0x05, 1 );

7.5 Model 2610 Digital IOM

The functions in this section are used to schedule IOM actions for Model 2610 48-channel Digital IOMs. These functions are
applicable only to Model 2610 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.

See section 6.2.2 for programming examples that show how to use these functions. For additional information on the IOM actions
that are invoked by these functions, see the Model 2600 Family Instruction Manual.

7.5.1 Type-Specific Errors

In addition to the common IOM status bit flags (

STATUS_RST

and

STATUS_CERR

), this IOM type supports the following

type-specific flag. If this flag is asserted, a transaction error of type

GWERR_IOMSPECIFIC

will be generated:

7.5.2 S26_Sched2610_GetInputs()

Function:

Schedules the fetching of all DIO input states from a model 2610 IOM.

Prototype:

u32 S26_Sched2610_GetInputs( XACT x, IOMPORT IomPort, u8 *states );

Returns:

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

Benchmark: 1.3 ms.

Notes:

The fetched state values represent the debounced, physical states of all DIO channels. Because the inputs are
sampled every 2 milliseconds, and the debounce period is 10 milliseconds, the returned state values will all have an
age ranging from 10 to 12 milliseconds, plus any network communication latency. The physical states of all DIO
channels are returned, regardless of their respective operating modes.

Example:

// Get all DIO input states from the 2610 at MM number 0, IOM port 2.

u8 dins[6];

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2610_GetInputs( x, 2, dins );

S26_SchedExecute( x, 1000, 0 );

Symbolic Name

Description

STATUS_2610_STRM

An error was detected in the serial data stream that is used to control the DIO
output drivers. This flag can be cleared by invoking a ClearStatus action.

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.

states

u8 *

Pointer to 6-byte application buffer that is to receive the input states of the
48 digital I/O channels. The first byte receives channels 0 (lsb) to 7 (msb),
the second byte receives channels 8 (lsb) to 15 (msb), and so on.

Advertising