DioGetOutputState

Applies To

GC5050, GX5050, GX5150, GX5280, GX5290, GX5290e

Purpose

Returns the current output pins state.

Syntax

DioGetOutputState (nHandle, pnOutputState, pnStatus)

Parameters

Name

Type

Comments

nHandle

SHORT

Master or Slave board handle.

pnOutputState

PSHORT

States values are:

0. Enabled-Outputs retain last value.

1. Disabled-Outputs are set to Tri-state.

2. Disabled on Halt/Pause-Outputs are set to Tri-state only when in HALT or PAUSE.

3. Outputs are set to zero.

4. Outputs are set to one (GX5280 only).

pnStatus

PSHORT

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

Comments

The current state does not have any effect on the DIO running mode or the loaded vector. The function can be called while the DIO is in the PAUSE, HALT or RUN state.

The state setting does not have any affect if the board is in input mode.

Example

The following example returns the current output state from a board specified by the board handle:

 

SHORT nStatus, nOutputState;

DioGetOutputState (nHandle, &nOutputState, &nStatus);

 

See Also

DioSetupOutputState, DioSetupIOConfiguration, DioGetIOConfiguration, DioGetErrorString