beautypg.com

Sensoray 2600 User Manual

Page 29

background image

Sensoray 2600 Programming Guide

25

Gateway Action Scheduling

Prototype:

u32 S26_Sched2601_GetInterlocks( XACT x, u8 *LockFlags );

Returns:

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

Benchmark: 0.1 ms.

Notes:

The MM includes two connectors for interlock power distribution. One connector receives power from up to six
interlock contacts, while the other connector serves as a daisy-chain to distribute the interlock power to IOMs.
Each interlock signal is called an interlock channel.

Every interlock channel occupies one circuit in each of the MM’s interlock power connectors. In addition, each
channel is routed to a metering circuit that enables the MM to monitor the channel’s voltage level. If a channel’s
interlock contact is closed, the interlock will supply voltage to the input connector, which in turn will convey the
voltage to the output connector and metering circuit.

Example:

// Fetch the interlock status from MM number 0.

u8 flags;

u8 mask;

int i;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2601_GetInterlocks( x, &flags );

S26_SchedExecute( x, 1000, 0 );

for ( i = 0, mask = 1; i < 6; i++, mask <<= 1 )

printf( "Power %d is %s\n", i, ( ( flags & mask ) ? "on" : "off" );

7.3.3 S26_Sched2601_GetLinkStatus()

Function:

Schedules the fetching of the status of the gateway’s sixteen IOM ports.

Prototype:

u32 S26_Sched2601_GetLinkStatus( XACT x, u16 *LinkFlags );

Returns:

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

Benchmark: 0.1 ms.

Notes:

The gateway automatically maintains a list of active IOM ports, called the Active Port List (APL). This function
returns a snapshot of the APL to the client.

Example:

// Fetch the link status from MM number 0.

u16 flags;

u16 mask;

int i;

void *x = S26_SchedOpen( 0, 1 );

S26_Sched2601_GetLinkStatus( x, &flags );

S26_SchedExecute( x, 1000, 0 );

for ( i = 0, mask = 1; i < 16; i++, mask <<= 1 )

Parameter

Type

Description

x

void *

Transaction handle obtained from S26_SchedOpen().

LockFlags

u8 *

Pointer to a 1-byte application buffer that is to receive the interlock power state flags.
Each bit is associated with an interlock channel number. For example, bit 4 is
associated with interlock channel 4. A bit flag is set to one to indicate that the
interlock input has applied power, or zero to indicate that the interlock input has no
applied power.

Parameter

Type

Description

x

void *

Transaction handle obtained from S26_SchedOpen().

LinkFlags

u16 *

Pointer to a 16-bit application buffer that is to receive the link status flags. Each bit is
associated with a single port. For example, bit 4 is associated with port 4. A bit flag is
set to one to indicate active link (IOM connected), or zero to indicate inactive link.