GPIOReadPin block

Short summary

Name

GPIOReadPin

→POU type

→function

Category

more system blocks, Blocks for GPIOs, block with internal error diagnostic

Graphical interface

images/download/thumbnails/414780022/GPIOReadPin-version-1-modificationdate-1534490321625-api-v2.png

Available since

version 1.85.0 (for logi.CAD 3) and version 3.5.2 of logi.RTS
images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg This block is supported for →phyBOARD-Regor.

Functionality

The block reads the value of a GPIO pin.

Inputs, outputs


Identifier

→Data type

Description

Inputs:

port

USINT

0-based port index of the addressed GPIO

pin

USINT

0-based pin index of the addressed GPIO

Output:

pinValue

BOOL

the actual value of the input pin

  • TRUE: pin is active

  • FALSE: pin is passive

Return value:

UDINT

the return code of the operation

  • 0: OK

  • 1: common error

  • 3: System service not loaded

The inputs port and pin are hardware-specific. Consult the documentation of the corresponding manufacturer on how to connect the inputs.

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Internal error diagnostic for block

The block checks the following error cases and – if they occur – the block sets the output ENO of the block to the value FALSE (or an equivalent): The return code of the block is not 0 (see above).

Example for usage within ST-editor

At present, there is no example.

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.