Professional Documents
Culture Documents
Intelligent Decentralized
Automation System
PROFIBUS Library
PROFIBUS
ABB Schalt-
und Steuerungstechnik
Contents
The PROFIBUS library 2
PREREQUISITES FOR THE USAGE OF THE LIBRARY 2
COMPONENTS OF THE LIBRARY 2
DATA TYPES 2
ERR – ERROR MESSAGES OF THE PROFIBUS BLOCKS................................. 3
Glossary 27
Index 29
1 PROFIBUS library
8
907 AC 1131/Issued: 03.00
THE PROFIBUS LIBRARY
Function blocks
The PROFIBUS library contains the following function blocks:
General
PROFI_INFO – Reading out information concerning the installed couplers
DP master
DPM_SLVDIAG – Polling diagnostic data from a DP slave
DPM_STAT – Reading out the state of the PROFIBUS coupler operating as DP master
DPM_SYSDIAG – Displaying status surveys of all DP slaves
DP slave
DPS_STAT – Reading out the state of the PROFIBUS coupler operating as DP slave
Detailed information about the various blocks can be found in the following topics.
DATA TYPES
In the PROFIBUS library the following data types (structures) are defined:
DP master
COM_ERR_TYPE – Communication error
DPM_STATE_BITS_TYPE – Bits for specifying the coupler state
STATIONSTATUS_1_TYPE – Stationstatus_1 (DP slave diagnosis according to standard)
STATIONSTATUS_2_TYPE – Stationstatus_2 (DP slave diagnosis according to standard)
STATIONSTATUS_3_TYPE – Stationstatus_3 (DP slave diagnosis according to standard)
DP slave
DPM_STATE_BITS_TYPE – Bits for specifying the coupler state
For detailed information about the different data types please refer to the particular description of the corresponding
block.
PROFIBUS library 2
8
907 AC 1131/Issued: 03.00
THE PROFIBUS LIBRARY
3 PROFIBUS library
8
907 AC 1131/Issued: 03.00
OVERVIEW OF BLOCKS ARRANGED ALPHABETICALLY ACCORDING TO CALL NAMES
Character description:
FBmV … Function block with historical values
FBoV … Function block without historical values
F … Function
PROFIBUS library 4
8
907 AC 1131/Issued: 03.00
READING OUT INFORMATION ABOUT THE INSTALLED
PROFIBUS COUPLERS PROFI_INFO
Block type
Function block without historical values
Parameter
Instance PROFI_INFO Instance name
CONO INT Slot (module number) of the coupler
ERR INT Error message
TYP STRING(17) Coupler type
MODEL STRING(22) Coupler model
OP_MODE STRING(22) Operation mode of the coupler
MAN_DATE DATE Manufacturing date of the coupler
DEV_NO DWORD Device number of the coupler
SER_NO DWORD Serial number of the coupler
FW_NAME STRING(17) Designation of the coupler firmware
FW_VER STRING(17) Version of the coupler firmware
Description
The block PROFI_INFO is always active. It reads the ERR INT
slot number at the block input CONO and outputs the
An error identification is output at the output ERR if an
corresponding information about the selected coupler
invalid value is applied at input CONO. The error
at its outputs.
message encoding at the output ERR is applied to all
PROF_INFO recognizes different coupler types. For PROFIBUS blocks and is explained after the block
that reason, the block outputs do not only relate to the descriptions.
PROFIBUS coupler.
The block is not intended for usage in normal user TYP STRING(17)
programs. It should be used to support fault diagnosis
The output TYP displays the coupler type (i.e. the
and maintenance operations.
coupler design). Different types are recognized by the
block.
CONO INT
For the PROFIBUS coupler: output TYP = ‚ABB‘.
At input CONO the slot (module number) of the coupler
If a coupler type can not be determined the output TYP
is applied, for which information should be polled. The
is set to ‚unknown type‘.
module number depends on the PLC category.
07 KT 97 R0120 CONO = 1
07 KT 97 R0162 CONO = 2
5 PROFIBUS library
8
907 AC 1131/Issued: 03.00
READING OUT INFORMATION ABOUT THE INSTALLED
PROFIBUS COUPLERS PROFI_INFO
PROFIBUS library 6
8
907 AC 1131/Issued: 03.00
READING OUT INFORMATION ABOUT THE INSTALLED
PROFIBUS COUPLERS PROFI_INFO
7 PROFIBUS library
8
907 AC 1131/Issued: 03.00
POLLING DETAILED DIAGNOSTIC DATA
OF A DP SLAVE DPM_SLVDIAG
Block type
Function block with historical values
Parameter
Instance DPM_SLVDIAG Instance name
EN BOOL Enabling of the block processing
CONO INT Slot (module number) of the coupler
SLV INT Bus address of the specific DP slave
DONE BOOL Ready message of the block
ERR INT Error message
STAT_1 STATIONSTATUS_1_TYPE Stationstatus_1 according to standard
STAT_2 STATIONSTATUS_2_TYPE Stationstatus_2 according to standard
STAT_3 STATIONSTATUS_3_TYPE Stationstatus_3 according to standard
MSTR INT Bus address of the related DP master
EXT_DIAG_LEN INT Length of the extended diagnostic data
EXT_DIAG_DAT ARRAY [1..238] OF BYTE Extended diagnostic data according to standard
Description
The block DPM_SLVDIAG implements the PROFIBUS While the request is processed, state changes at input
function Slave_Diag. EN are recognized but not evaluated.
Every time a FALSE → TRUE edge is applied to the
input EN, DPM_SLVDIAG reads the data at its inputs CONO INT
and sends a corresponding request message to the
At input CONO the slot (module number) of the coupler
coupler. Further FALSE → TRUE edges at input EN is applied, which should process the request. The
are ignored until the processing of the active request is module number depends on the PLC category.
finished. The completion of the request processing is
indicated by DONE = TRUE.
07 KT 97 R0120 CONO = 1
07 KT 97 R0162 CONO = 2
EN BOOL
If a FALSE → TRUE edge is applied to input EN, all SLV INT
further inputs are read in.
At input SLV the bus address of the DP slave is
If the input values are valid, a corresponding request applied, for which diagnostic data are requested.
message is send to the coupler. While this request
message is processed, the output DONE is set to
FALSE. If at least on input value is invalid, an error is
indicated at output ERR. Additionally the termination of
the request processing is indicated by DONE = TRUE.
PROFIBUS library 8
8
907 AC 1131/Issued: 03.00
POLLING DETAILED DIAGNOSTIC DATA
OF A DP SLAVE DPM_SLVDIAG
9 PROFIBUS library
8
907 AC 1131/Issued: 03.00
POLLING DETAILED DIAGNOSTIC DATA
OF A DP SLAVE DPM_SLVDIAG
LD DIAG.DONE DIAG_DONE :=
ST DIAG_DONE DIAG.DONE;
LD DIAG.ERR DIAG_ERR :=
ST DIAG_ERR DIAG.ERR;
LD DIAG.STAT_1 DIAG_STAT_1 :=
ST DIAG_STAT_1 DIAG.STAT_1;
LD DIAG.STAT_2 DIAG_STAT_2 :=
ST DIAG_STAT_2 DIAG.STAT_2;
LD DIAG.STAT_3 DIAG_STAT_3 :=
ST DIAG_STAT_3 DIAG.STAT_3;
LD DIAG.MSTR DIAG_MSTR :=
ST DIAG_MSTR DIAG.MSTR;
LD DIAG.EXT_DIAG_LEN DIAG_EXT_DIAG_LEN :=
ST DIAG_EXT_DIAG_LEN DIAG.EXT_DIAG_LEN;
LD DIAG.EXT_DIAG_DAT DIAG_EXT_DIAG_DAT :=
ST DIAG_EXT_DIAG_DAT DIAG.EXT_DIAG_DAT;
PROFIBUS library 10
8
907 AC 1131/Issued: 03.00
POLLING DETAILED DIAGNOSTIC DATA
OF A DP SLAVE DPM_SLVDIAG
If this bit is set, the PROFIBUS coupler has not found a The DP slave sets this bit to TRUE if the parameter
DP slave at the bus address, which was applied at the data it received last are faulty.
block input SLV.
MASTER_LOCK BOOL
NOT_READY BOOL This bit is set to TRUE if the DP slave is assigned to
This bit is set to TRUE by the DP slave if the DP slave another DP master. In this case MSTR contains the
is not ready for I/O data exchange. bus address of this DP master.
CFG_FAULT BOOL
This bit is set to TRUE by the DP slave if the
configuration data (nominal configuration) received
from the DP master do not match the data stored in the
DP slave (actual configuration).
11 PROFIBUS library
8
907 AC 1131/Issued: 03.00
POLLING DETAILED DIAGNOSTIC DATA
OF A DP SLAVE DPM_SLVDIAG
Ident_Number
At this point the DP slave enters its Ident number in firm component of the GSD file. The block
the diagnosis telegram. The Ident number is DPM_SLVDIAG does not output the device Ident
assigned by the PNO (PROFIBUS number, because the number is not necessary for the
Nutzerorganisation e.V. = PROFIBUS user evaluation of the diagnostic data.
organisation) for each device type. This number is a
PROFIBUS library 12
8
907 AC 1131/Issued: 03.00
POLLING DETAILED DIAGNOSTIC DATA
OF A DP SLAVE DPM_SLVDIAG
13 PROFIBUS library
8
907 AC 1131/Issued: 03.00
POLLING DETAILED DIAGNOSTIC DATA
OF A DP SLAVE DPM_SLVDIAG
5 overtemperature 0 0 1 0 1
6 cable break 0 0 1 1 0
7 upper limit 0 0 1 1 1
exceeded
8 lower limit 0 1 0 0 0
exceeded
9 Error 0 1 0 0 1
10 reserved 0 1 0 1 0
: 0 1 x X x
15 reserved 0 1 1 1 1
16 manufacturer- 1 0 0 0 0
specific
: 1 x x x x
31 manufacturer- 1 1 1 1 1
specific
The valid length of the complete extended diagnostic
data is indicated at output EXT_DIAG_LEN of the block
DPM_SLVDIAG. When evaluating the diagnosis only
those data have to be considered, which are contained
in the range EXT_DIAG_DAT[1] to
EXT_DIAG_DAT[EXT_DIAG_LEN].
PROFIBUS library 14
8
907 AC 1131/Issued: 03.00
POLLING DETAILED DIAGNOSTIC DATA
OF A DP SLAVE DPM_SLVDIAG
EXT_DIAG_LEN = 15
7 6 5 4 3 2 1 0
EXT_DIAG_DAT[1] 0 0 0 0 0 1 0 0 Device-related diagnosis
Length: 4 bytes incl. header byte
EXT_DIAG_DAT[2] X x x x X x x x Device-related diagnosis
EXT_DIAG_DAT[3] X x x x X x x x Length: 3 bytes
Meaning of the data is manufacturer-
EXT_DIAG_DAT[4] X x x x X x x x
specifc
EXT_DIAG_DAT[5] 0 1 0 0 0 1 0 1 ID-related diagnosis
Length: 5 bytes incl. header byte
EXT_DIAG_DAT[6] 07 06 05 04 03 02 01 10 Module 0 with diagnosis
EXT_DIAG_DAT[7] 015 014 013 112 011 010 09 08 Module 12 with diagnosis
EXT_DIAG_DAT[8] 023 022 021 020 019 118 017 016 Module 18 with diagnosis
EXT_DIAG_DAT[9] 031 130 029 028 027 026 025 024 Module 30 with diagnosis
EXT_DIAG_DAT[10] 1 0 0 0 0 0 0 0 Channel-related diagnosis
Module 0
EXT_DIAG_DAT[11] 0 1 0 0 0 0 1 0 Channel 2, Input
EXT_DIAG_DAT[12] 0 0 1 0 0 1 0 0 Overload, channel bitwise organized
EXT_DIAG_DAT[13] 1 0 0 0 1 1 0 0 Channel-related diagnosis
Module 12
EXT_DIAG_DAT[14] 1 0 0 0 0 1 1 0 Channel 6, ouput
EXT_DIAG_DAT[15] 1 0 1 0 0 1 1 1 Upper limit exceeded,
Channel organized word-wise
15 PROFIBUS library
8
907 AC 1131/Issued: 03.00
READING OUT THE PROFIBUS COUPLER STATUS DPM_STAT
Block type
Function block without historical values
Parameter
Instance DPM_STAT Instance name
EN BOOL Enabling of the block processing
CONO INT Slot (module number) of the coupler
ERR INT Error message
STAT_BITS DPM_STATE_BITS_TYPE Atypical communication states
DPM_STATE INT DP master state according to standard
COM_ERR COM_ERR_TYPE communication error
BUS_ERR INT number of serious bus errors
TIME_OUT INT number of timeouts
Description
The block DPM_STAT outputs the current state of a applied to all PROFIBUS blocks and is explained after
PROFIBUS coupler in operation mode DP master. the block descriptions.
DPM_STAT is active if input EN = TRUE. If the block is
active, the current values are always displayed at the STATE_BITS DPM_STATE_BITS_TYPE
outputs.
At output STATE_BITS atypical communication states
at the PROFIBUS are displayed. STAT_BITS is only
EN BOOL valid if EN = TRUE and ERR = 0.
The block can be activated (EN = TRUE) or deactivated The structure of the type DPM_STATE_BITS_TYPE is
(EN = FALSE) via the input EN. If the block is active, defined in the PROFIBUS library and is described
the current values are applied to the outputs. below.
PROFIBUS library 16
8
907 AC 1131/Issued: 03.00
READING OUT THE PROFIBUS COUPLER STATUS DPM_STAT
Normally the coupler is in OPERATE state while a user At output TIME_OUT the number of timeout errors
program is running. In this state the DP master which occurred since the system start are output. A
exchanges I/O data with the DP slaves. If an error timeout error occurs if a DP slave does not response to
occurs during this process and ‘Auto Clear Mode’ was a DP master request within the configured time.
selected during the configuration, the coupler changes TIME_OUT is only valid if EN = TRUE and ERR = 0.
back to CLEAR state and tries again to parameterize
the DP slaves. If ‘Auto Clear Mode’ was not selected,
the coupler remains (in case of an error) in OPERATE
state. If the user program is stopped, the coupler also
changes back to STOP state.
DPM_STATE is only valid if EN = TRUE and ERR = 0.
17 PROFIBUS library
8
907 AC 1131/Issued: 03.00
READING OUT THE PROFIBUS COUPLER STATUS DPM_STAT
STATE_BITS DPM_STATE_BITS_TYPE
The structure STATE_BITS includes four boolean
variables which display the different communication
states. Within the PROFIBUS library the data type
DPM_STATE_BITS_TYPE is declared as follows:
TYPE DPM_STATE_BITS_TYPE:
STRUCT
CTRL: BOOL;
AUTO_CLR: BOOL;
NO_EXCH: BOOL;
FATAL: BOOL;
END_STRUCT
END_TYPE
CTRL BOOL
If this bit is set to TRUE, a parameter setting error
occurred. In normal operation CTRL should be FALSE.
If this is not the case, the parameter and configuration
data are to be checked.
AUTO_CLR BOOL
This bit is only valid if ‘Auto Clear Mode’ was selected
during the configuration. If AUTO_CLR is set to TRUE,
an error occurred during the communication with at
least one DP slave. As a result, the coupler has
stopped the data exchange with all DP slaves and has
changed back to CLEAR state (see DPM_STATE).
NO_EXCH BOOL
This bit is set to TRUE if the process data exchange
with one or several DP slaves is not possible. The
cause of the error can be found in the configuration
data as well as in the DP slaves itselves.
FATAL BOOL
If FATAL is set to TRUE, no communication via the
PROFIBUS is possible due to a serious bus error (e.g.
bus line short circuit). In this case, all bus lines have to
be checked.
PROFIBUS library 18
8
907 AC 1131/Issued: 03.00
READING OUT THE PROFIBUS COUPLER STATUS DPM_STAT
COM_ERR COM_ERR_TYPE
Communication errors can be located precisely via ADDRESS BYTE
COM_ERR. The output COM_ERR is represented as a
In cause of an error, ADDRESS contains the bus
structure of the type COM_ERR_TYPE. Within the
address of the faulty subscriber (0 to 255). If
PROFIBUS library this data type is declared as follows:
ADDRESS has the value 255, the error is located in the
TYPE COM_ERR_TYPE: coupler itself.
STRUCT
ADDRESS: BYTE;
EVENT BYTE
EVENT: BYTE;
END_STRUCT EVENT displays the cause of an error. The following
END_TYPE tables show the encoding of the various errors.
19 PROFIBUS library
8
907 AC 1131/Issued: 03.00
READING OUT THE PROFIBUS COUPLER STATUS DPM_STAT
PROFIBUS library 20
8
907 AC 1131/Issued: 03.00
READING OUT THE STATUS SURVEY OF ALL
DP SLAVES DPM_SYSDIAG
Block type
Function block without historical values
Parameter
Instance DPM_SYSDIAG Instance name
EN BOOL Enabling of the block processing
CONO INT Slot (module number) of the coupler
TYP INT Selection of the survey type
ERR INT Error message
SLV ARRAY [0..127] OF BOOL DP slaves status survey
Description
The block DPM_SYSDIAG outputs different status these DP slaves into operation which were assigned
surveys of all DP slaves. Three survey types can be during the generation of the configuration data.
selected:
TYP = 2 data exchange survey
- configuration survey
At output SLV is displayed with which DP slaves the
- I/O data exchange survey DP master exchanges data. The data exchange can
only be performed with DP slaves which were
- diagnosis survey
configured by the DP master itself. The data exchange
survey can only be requested if the coupler is in
EN BOOL OPERATE state.
The block can be activated (EN = TRUE) or deactivated TYP = 3 diagnosis survey
(EN = FALSE) via the input EN. If the block is active,
At output SLV is displayed which DP slaves have
the current values are applied to the outputs.
signalized an available diagnosis. The diagnosis survey
can only be requested if the coupler is in OPERATE
CONO INT state.
At input CONO the slot (module number) of the coupler
is applied, which should process the request. The ERR INT
module number depends on the PLC category. An error identification is output at the output ERR if an
07 KT 97 R0120 CONO = 1 invalid value is applied at an input. ERR has always to
be considered together with the input EN. The value
07 KT 97 R0162 CONO = 2 applied at ERR is only valid if EN = TRUE. All further
outputs are only valid if EN = TRUE and ERR = 0. The
TYP INT error message encoding at the output ERR is applied to
all PROFIBUS blocks and is explained after the block
The input TYP is used to select which status survey descriptions.
should be displayed at output SLV.
TYP = 1 configuration survey
At the output SLV it is displayed which DP slaves the
DP master has configured (i.e. set into operation)
successfully. Please note that the DP master sets only
21 PROFIBUS library
8
907 AC 1131/Issued: 03.00
READING OUT THE STATUS SURVEY OF ALL
DP SLAVES DPM_SYSDIAG
SLV ARRAY [0..127] OF BOOL DP slave which has bus address 2. However, if
SLV[2] = FALSE, the DP master currently exchanges
At output SLV, the status survey is output as a bit field.
no I/O data with the DP slave. The DP master is only
Every bit within this field represents a DP slave. With
able to exchange data with DP slaves which it has set
this, the index corresponds to the DP slave bus
successfully into operation before.
address. A bit which is set to TRUE means, that the
state selected via TYP is applicable for the For TYP = 3 e.g. SLV[2] = TRUE means, that the DP
corresponding DP slave. slave with bus address 2 has signalized a diagnosis.
The detailed diagnosis can be requested by using the
If e.g. TYP = 1 is selected and SLV[2] = TRUE, the DP
block DPM_SLVDIAG.
slave was configured successfully with bus address 2
by the DP master. If SLV[2] = FALSE, the configuration The bit field output at SLV is only valid if EN = TRUE
of the specific DP slave has not yet been completed or and ERR = 0.
the DP slave is not part of the DP master configuration
data.
If TYP = 2 was selected and SLV[2] = TRUE, this
means that the DP master exchanges I/O data with the
PROFIBUS library 22
8
907 AC 1131/Issued: 03.00
READING OUT THE STATUS OF THE PROFIBUS COUPLER DPS_STAT
Block type
Function block without historical values
Parameter
Instance DPS_STAT Instance name
EN BOOL Enabling of the block processing
CONO INT Slot (module number) of the coupler
ERR INT Error message
STATE_BITS DPS_STATE_BITS_TYPE Communication states
ERR_CNT INT Number of errors occurred since system start
LAST_ERR INT Identifier of the last occurred error
Description
STATE_BITS DPS_STATE_BITS_TYPE
The block DPS_STAT outputs the current
PROFIBUS coupler state in operation mode DP At output STATE_BITS the current communication
slave. states at the PROFIBUS are displayed. STAT_BITS
is only valid if EN = TRUE and ERR = 0.
EN BOOL The structure of the type DPS_STATE_BITS_TYPE
is defined in the PROFIBUS library and is described
The block can be activated (EN = TRUE) or
below.
deactivated (EN = FALSE) via the input EN. If the
block is active, the current values are applied to the
outputs. ERR_CNT INT
At output ERR_CNT the number of errors occurred
CONO INT since the last coupler reset are output. ERR_CNT is
only valid if EN = TRUE and ERR = 0.
At input CONO the slot (module number) of the
coupler is applied, which should process the request.
The module number depends on the PLC category. LAST_ERR INT
07 KT 97 R0120 CONO = 1 At output LAST_ERR the identifier of the last
occurred error is output. The error encoding in
07 KT 97 R0162 CONO = 2
LAST_ERR is described below. LAST_ERR is only
valid if EN = TRUE and ERR = 0.
ERR INT
An error identification is output at the output ERR if
an invalid value is applied at an input. ERR has
always to be considered together with the input EN.
The value applied at ERR is only valid if EN = TRUE.
All further outputs are only valid if EN = TRUE and
ERR = 0. The error message encoding at the output
ERR is applied to all PROFIBUS blocks and is
explained after the block descriptions.
23 PROFIBUS library
8
907 AC 1131/Issued: 03.00
READING OUT THE STATUS OF THE PROFIBUS COUPLER DPS_STAT
STATE_BITS DPS_STATE_BITS_TYPE
The structure STATE_BITS includes five boolean STATIC_DIAG BOOL
variables which display the different coupler states.
This bit is set to TRUE if the coupler itself has a statical
Within the PROFIBUS library the data type
diagnosis according PROFIBUS standard. If at least
DPS_STATE_BITS_TYPE is declared as follows:
one standard diagnosis cause according to the
TYPE DPS_STATE_BITS_TYPE: standard occurred (see block DPM_SLVDIAG), the
STRUCT coupler sends a diagnosis message via the bus
INIT: BOOL; independently. Until a statical diagnosis of the coupler
RUN: BOOL; exists, no I/O data are exchanged with the DP master.
STATIC_DIAG: BOOL;
DATA_EXCH: BOOL;
DATA_EXCH BOOL
NEW_PRM: BOOL;
END_STRUCT If this bit is set to TRUE, the cyclic I/O data exchange
END_TYPE between coupler and DP master is performed. In
normal operation DATA_EXCH should always be
INIT BOOL TRUE, provided that STATIC_DIAG is not set to TRUE.
If this bit is set to TRUE, an initialization error occurred.
In normal operation INIT should be FALSE. If this is not NEW_PRM BOOL
the case, the parameter and configuration data have to
be checked. NEW_PRM is set to TRUE if the coupler has received
new parameter data from the DP master.
RUN BOOL
This bit is set to TRUE if the initialization phase has
been completed successfully and the coupler is ready
for communication via PROFIBUS. An error has
occurred if RUN is FALSE for longer time.
PROFIBUS library 24
8
907 AC 1131/Issued: 03.00
READING OUT THE STATUS OF THE PROFIBUS COUPLER DPS_STAT
25 PROFIBUS library
8
907 AC 1131/Issued: 03.00
Glossary
BOOL
Variables of the type BOOL can have the values TRUE and FALSE. For this, 8 bit memory space are reserved.
DINT
DINT belongs to the integer data types.
The different numerical types are responsible for a different numerical range. For integer data types the following
range limits are valid:
Due to this, it is possible that information are lost when converting greater data types to smaller data types.
DWORD
DWORD belongs to the integer data types.
The different numerical types are responsible for a different numerical range. For integer data types the following
range limits are valid:
Due to this, it is possible that information are lost when converting greater data types to smaller data types.
INT
INT belongs to the integer data types.
The different numerical types are responsible for a different numerical range. For integer data types the following
range limits are valid:
Due to this, it is possible that information are lost when converting greater data types to smaller data types.
27 PROFIBUS library
8
907 AC 1131/Issued: 03.00
WORD
WORD belongs to the integer data types.
The different numerical types are responsible for a different numerical range. For integer data types the following
range limits are valid:
Due to this, it is possible that information are lost when converting greater data types to smaller data types.
Functions
Functions are subroutines which have multiple input parameters and return exactly one result element. The
returned result can be of an elementary or a derived data type. Due to this, a function may also return an array, a
structure, an array of structures and so on.
For the same input parameters, functions always return the same result (they do not have an internal memory).
Function blocks
Function blocks are subroutines which can have as much inputs, outputs and internal variables as required. They
are called from a program or from another function block.
As they can be used several times (with different data records), function blocks (code and interface) can be
considered as type. When assigning an individual data record (declaration) to the function block, a function block
instance is generated.
In contrast to functions, function blocks can contain statically local data which are saved from one call to the next.
Therefore, e.g. counters can be realized which may not forget their counter value. I.e. function blocks can have an
internal memory.
Functions and function blocks differ in two essential points:
• A function block has multiple output parameters, a function maximum one, but the output parameters differ
syntactically.
PROFIBUS library 28
8
907 AC 1131/Issued: 03.00
Index
C
COM_ERR_TYPE 2, 16, 19
D
DPM_SLVDIAG 2, 4, 8, 14, 22, 24
DPM_STAT 2, 4, 16
DPM_STATE_BITS_TYPE 2, 16, 18
DPM_SYSDIAG 2, 4, 21
DPS_STAT 2, 4, 23
O
Output ERR of a PROFIBUS block 3
P
PROFI_INFO 2, 4, 5
S
STATIONSTATUS_1_TYPE 2, 8, 11
STATIONSTATUS_2_TYPE 2, 8, 11
STATIONSTATUS_3_TYPE 2, 8, 12
29 PROFIBUS library
8
907 AC 1131/Issued: 03.00
PROFIBUS library 30
8
907 AC 1131/Issued: 03.00
Printed on chlorine-free bleached paper