DioReadIOPinsValue

Applies To

GC5050, GX5050, GX5150, GX5280, GX5290, GX5290e, GX5295

Purpose

Read back the current input pins value.

Syntax

DioReadIOPinsValue (nHandle, pdwValue, pnStatus)

Parameters

Name

Type

Comments

nHandle

SHORT

Master or Slave board handle.

pdwValue

PDWORD

Data read from the I/O pins.

pnStatus

PSHORT

Returned status: 0 on success, negative number on failure.

Comments

GC5050, GX5050, GX5150, GX5280:

     The board must be in a HALT or PAUSE state in order for the user to read the I/O lines.

     If the memory I/O configuration width was set to 16-bit or 8-bit, then only the 16 or 8 lower bits are applicable and the remaining bits return 0.

GX5055:

     The board must be in a HALT or PAUSE state in order for the user to read the I/O lines.

     If the memory I/O configuration width was set to 16-bit or 8-bit, then only the 16 or 8 lower bits are applicable and the remaining bits return 0.

The function should be used with conjunction of DioReadIOPinsValidity in order to get a complete picture of each input voltage level state. The following table summarizes the different results on a per bit basis:

Bit x read with

DioReadIOPinsValidity

Bit x read with

DioReadIOPinsValue

Comments

0

0

Valid input voltage and input voltage level is less than the input low threshold level.

0

1

Valid input voltage and input voltage level is greater than the input high threshold level.

1

x

Invalid input voltage, input voltage is greater than input low threshold level and less then high threshold level

GX5290/GX5290e:

     Firmware version 0x8828 and above: allow reading the I/O pins data when the card is in PUASE/HALT state, otherwise the board must be in a HALT state.

GX5295:

     The board must be in a HALT or PAUSE state in order for the user to read the I/O lines.

The function should be used with conjunction of DioReadIOPinsValidity in order to get a complete picture of each input voltage level state. The following table summarizes the different results on a per bit basis:

Bit x read with

DioReadIOPinsValidity

Bit x read with

DioReadIOPinsValue

Comments

0

0

Valid input voltage and input voltage level is less than the input low threshold level.

0

1

Valid input voltage and input voltage level is greater than the input high threshold level.

1

x

Invalid input voltage, input voltage is greater than input low threshold level and less then high threshold level

Example

The following example reads the I/O pins values:

 

SHORT   nStatus;

DWORD   dwValue;

DioReadIOPinsValue (nHandle, &dwValue, &nStatus);

 

See Also

DioWriteIOPinsValue,DioSetupIOConfiguration, DioGetIOConfiguration, DioGetErrorString