FB_PN_SCAN_UpTo255

FB_PN_SCAN_UpTo255 1:

The FB_PN_SCAN_UpTo255 function block scans the PROFINET network and returns the number of and a list with information on the PROFINET devices found.

FB_PN_SCAN_UpTo255 2: Inputs

VAR_INPUT
  bExecute        : BOOL;
  NETID           : T_AmsNetId;
END_VAR

Name

Type

Description

bExecute

BOOL

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

NETID

T_AmsNetId

AMS Net ID of the controller

FB_PN_SCAN_UpTo255 3: Outputs

VAR_OUTPUT
  iFind_Devices     : INT;
  ar_PN_DEVICE      : ARRAY [1..255] OF str_PN_SCAN;
  bBusy             : BOOL;
  bError            : BOOL;
  iErrorID          : UDINT;
END_VAR

Name

Type

Description

iFind_Devices

int

Number of PROFINET devices in the configuration.

ar_PN_DEVICE

str_PN_SCAN

PROFINET/IP settings of the PROFINET devices.

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.

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.4024.57

PC or CX (x64, x86, ARM)

Tc2_ProfinetDiag (>= v1.5.2.0)