Gx6192/Gx6256/Gx6864GetRelayCount

Purpose

Returns the relay count associated with all the relays on the specified device

Syntax

Gx6256GetRelayCount (nHandle, nBlock, padwRelayCount, pnMaxLen, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6256/GX6864/GX6192 board.
nBlock
SHORT
The device to read the relay count from
0.      GX6256_BLOCK_BOARD: Read relay count for all relays on the switching board
1.      GX6256_BLOCK_RTM: Read relay count for all relays on the connected Rear Transition Module if it exists
2.     GX6256_BLOCK_SR: Read relay count for all relays on the connected Switching Router if it exists
padwRelayCount
PDWORD
Returns an array containing each relay's cumulative open/close count
pnMaxLen
PSHORT
Size of the array passed into the padwRelayCount parameter
The function returns the actual number of elements written to the array in this variable as well.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each board, Rear Transition Module, and Switching Router contain many relays. Whenever each relay is opened or closed, the count for the specific relays is incremented and then stored on an onboard EEPROM.

Each element in the relay count array, padwRelayCount, represents the total number of open/close events for the lifetime of a relay. The element index corresponds with the relay designation number minus one. For example, element 0 in the array contains the relay count for the relay designated "K1", element 1 in the array contains the relay count for the relay designated "K2", and so on.

Example

The following example returns the relay count for relay K200 on a rear transition board that is connected to slot 5:

 

SHORT nHandle, nStatus;

DWORD adwRelayCount[256];

 

Gx6256Initialize(5, &nHandle, &nStatus);

Gx6256GetRelayCount(nHandle, GX6256_BLOCK_RTM, adwRelayCount, 256, &nStatus);

printf("Relay K200 has been opened/closed %d times.", adwRelayCount[199]);

 

See Also

Gx6192/Gx6256/Gx6864GetRelayStates, GxSWGetErrorString