Gx6377MatrixGetChannel

Purpose

Return the state of the relay in the specified group, row and column.

Syntax

Gx6377MatrixGetChannel (nHandle, nGroup, nRow, dwColumn, pnState, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6377 board.
nGroup
SHORT
If the Switch Matrix is configured as two groups of 2x16 (default configuration) Group numbers are:
  • GX6377_GROUP_A
  • GX6377_GROUP_B
If the Switch Matrix is configured as one group of 2x32 the only Group number is:
  • GX6377_GROUP_A
nRow
SHORT
Row numbers are:
  • GX6377_ROW_0
  • GX6377_ROW_1
dwColumn
DWORD
If the Switch Matrix is configured as two groups of 2x16 (default configuration) Column numbers are 0 to 15.
If the Switch Matrix is configured as one group of 2x32 the only Column numbers are 0 to 31.
pnState
PSHORT
Returned state of the relay. 1 for close and 0 for open.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The Switch Matrix can be configured via software as two groups of 2x16 or one group of 2x32. All the Switch Matrix channels will be opened prior to applying the new configuration settings. Applying the same configuration settings will not change the current group’s channels settings.

Use the Gx6377MatrixGetRow function to retrieve the state of all relays in the specified row and group.

Example

The following example checks whether relay at group A, row 0, relay 3 is closed:

 

Gx6377MatrixGetChannel(nHandle, GX6377_GROUP_A, GX6377_ROW_0, 3, &nState, &nStatus);

if (nClose==1)

    printf(“A0-3 relay is closed”);

else

    printf(“A0-3 relay is open”);

 

See Also

Gx6377Initialize, GxSWGetErrorString, Gx6377MatrixGetRow, Gx6377MatrixSetRow, Gx6377MatrixClose, Gx6377MatrixOpen