Specifications

187PLC Code for PROFINET Controller
(c) 2013 MITSUBISHI ELECTRIC CORPORATION
8
PLC Code for PROFINET Controller
GX Configurator-PN can export PLC program code for 'GX Works2' (GXW2) and 'GX IEC Devel-
oper' (GID), which assists the application programmer in accessing the PROFINET Controller.
8.1 Function Blocks
GX Configurator-PN can export PLC code for integrating PROFINET I/O into a 'GX IEC Devel-
oper' (GID) or a 'GX Works2' (GXW2) PLC application program. The exported code contains 'Function
Blocks' (FBs), 'Data Unit Types' (DUTs) and global variable lists (GVLs).
Call of Function Blocks
All services used in the function blocks access the same data area, defined in the instances of the
DUTs. If a function block is in use (output Busy is true), no other function block call is allowed. The
user must ensure that the function blocks are interlocked against simultaneous use. Two function
blocks can only be used simultaneously, if one uses a different request/response buffer pair than the
other.
GX Configurator-PN adds global variables to the exported PLC code, which are mapped to the corre-
sponding buffer devices. The PLC program can use the variable identifiers and does not have to ac-
cess the buffer devices directly. The following table lists the variable names for both acyclic commu-
nication buffer pairs.
Buffer
Global Variables for Acyclic Communication Buffers
Buffer Pair 1
Buffer Pair 2
Request handsha-
ke bits
vPN_MGMT_OUTPUTS.ACYC_HS
K_Y_REQ1_EXECUTE
vPN_MGMT_OUTPUTS.ACYC_HS
K_Y_REQ2_EXECUTE
Response hands-
hake bits
vPN_MGMT_INPUTS.ACYC_HSK_
X_RES1_ACCEPTED
vPN_MGMT_INPUTS.ACYC_HSK_
X_RES1_COMPLETED
vPN_MGMT_INPUTS.ACYC_HSK_
X_RES2_ACCEPTED
vPN_MGMT_INPUTS.ACYC_HSK_
X_RES2_COMPLETED
Request buffer
vPN_ACYCLIC_REQ1
vPN_ACYCLIC_REQ2
Response buffer
vPN_ACYCLIC_RES1
vPN_ACYCLIC_RES2
8.1.1 Function Block 'Net_Detect'
This FB detects IO-devices present on the network. It includes two services: network detection and
IO-device detection. The network detection returns only the number of IO-devices found on the net-
work. The following IO-Device detection reads type information from each detected IO-device and sto-
res it in the global variable 'vPN_DEVICE_DETECT_DATA'.