DioReadIoPinsValidity

Applies To

GX5055, GX5295

Purpose

Read back the validity of the current input pins levels.

Syntax

DioReadIOPinsValidity (nHandle, pdwValidity, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
DIO or File board handle.
pdwValidity
PDWORD
Read back the validity of the current input pins levels. Each bit represents a channel, e.g. bit 0 represents the validity of the input voltage at channels 0.
A low represent valid input voltage and a high represent invalid input voltage, see comments for details.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function should be used with conjunction of DioReadIOPinsValue 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.

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 dwValidity;

DioReadIOPinsValidity (nHandle, &dwValidity, &nStatus);

 

See Also

DioWriteIOPinsValue, DioReadIOPinsValue, DioGetIOPinsStaticDirection, DioSetupIOPinsStaticDirection, DioGetErrorString