F_IOPortRead

F_IOPortRead 1:

A digital I/O port is usually an I/O position with a width of 1 byte, which is mapped either in the memory or as a port. If a value is written at this point, the electrical signal at the output pins is modified according to the written bits. If a value is read from the input position, the current logical level at the input pins is returned as an individual bit value.

The function F_IOPortRead can be used to read an I/O position with a width of eSize. The function returns the read value as return parameter. See also description of the F_IOPortWrite function.

FUNCTION F_IOPortRead : DWORD

VAR_INPUT
    nAddr : UDINT;
    eSize : E_IOAccessSize;
END_VAR

nAddr: I/O port address.

eSize: Number of data bytes to be read (type: E_IOAccessSize).

Requirements

Development environment

Target system type

PLC libraries to include (Category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_System (System)