FB_PN_IM0_READ

FB_PN_IM0_READ 1:

The PROFINET controller uses the function block FB_PN_Im0_READ to read all I&M 0 ( Identification & Maintenance ) data from a device referenced via the input Port.
The frame structure of the I&M0 function corresponds to the index 0xAFF0 according to the PROFINET standard.

FB_PN_IM0_READ 2: Inputs

VAR_INPUT
  bStart  : BOOL;
  NETID   : T_AmsNetId;
  PORT    : T_AmsPort;
END_VAR

Name

Type

Description

bStart

BOOL

The function block is enabled by a positive edge at this input.

NETID

T_AmsNetId

AMS Net ID of the controller

PORT

T_AmsPort

Port via which the controller communicates with the device (port = Device ID + 1000hex).

FB_PN_IM0_READ 3: Outputs

VAR_OUTPUT
    bBusy    : BOOL;
    IM_AFF0  : str_IM_0xAFF0;
    bError   : BOOL;
    iErrorID : UDINT;
END_VAR

Name

Type

Description

bBusy

BOOL

When the function block is enabled, this output is set and remains set until a feedback is received. While Busy = TRUE, no new command will be accepted at the inputs.

IM_AFF0

str_IM_0xAFF0

IM_AFF0: Output of the I&M0 frame supplied by the device in a structure.

bError

BOOL

If an error occurs during the transmission of the command, this output is set after the bBusy output is reset.

iErrorID

UDINT

Returns an ADS error number if bError output is set.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4018

PC or CX (x64, x86, ARM)

Tc2_ProfinetDiag