Documente Academic
Documente Profesional
Documente Cultură
WAGO-Software
CODESYS Library
WAGO_DPS_01.lib
for linking to PROFIBUS
Version 1.0.0
2 WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Hansastraße 27
D-32423 Minden
E-Mail: info@wago.com
Web: http://www.wago.com
Technical Support
E-Mail: support@wago.com
Every conceivable measure has been taken to ensure the accuracy and
completeness of this documentation. However, as errors can never be fully
excluded, we always appreciate any information or suggestions for improving the
documentation.
E-Mail: documentation@wago.com
We wish to point out that the software and hardware terms as well as the
trademarks of companies used and/or mentioned in the present manual are
generally protected by trademark or patent.
Library Description
Version 1.0.0
WAGO-Software Table of Contents 3
WAGO_DPS_01.lib CODESYS Library
Table of Contents
1 Notes about this Documentation ................................................................. 4
1.1 Copyright................................................................................................... 4
1.2 Symbols ..................................................................................................... 5
1.3 Number Notation ....................................................................................... 7
1.4 Font Conventions ...................................................................................... 7
2 WAGO_DPS_01.lib ..................................................................................... 8
2.1 Troubleshooting ........................................................................................ 9
2.2 DPS_GET_DEV_STATE ....................................................................... 11
2.3 DPS_GET_SYS_DIAG .......................................................................... 13
2.4 DPS_SEND_DIAG ................................................................................. 15
2.5 DPS_SET_ID_REL_DIAG..................................................................... 17
2.6 DPS_SET_MOD_STAT_DIAG ............................................................. 19
2.7 DPS_SET_CHAN_REL_DIAG ............................................................. 21
2.8 DPS_SET_STATUS_MSG..................................................................... 24
2.9 DPS_SET_ALARM ................................................................................ 27
2.10 DPS_SET_IM_DS .................................................................................. 30
2.11 DPS_GET_IM_DS .................................................................................. 32
List of Tables ........................................................................................................ 34
Library Description
Version 1.0.0
4 Notes about this Documentation WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Library Description
Version 1.0.0
WAGO-Software Notes about this Documentation 5
WAGO_DPS_01.lib CODESYS Library
1.2 Symbols
Personal Injury!
Indicates a high-risk, imminently hazardous situation which, if not avoided, will
result in death or serious injury.
Personal Injury!
Indicates a moderate-risk, potentially hazardous situation which, if not avoided,
could result in death or serious injury.
Personal Injury!
Indicates a low-risk, potentially hazardous situation which, if not avoided, may
result in minor or moderate injury.
Damage to Property!
Indicates a potentially hazardous situation which, if not avoided, may result in
damage to property.
Important Note!
Indicates a potential malfunction which, if not avoided, however, will not result in
damage to property.
Library Description
Version 1.0.0
6 Notes about this Documentation WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Additional Information:
Refers to additional information which is not an integral part of this
documentation (e.g., the Internet).
Library Description
Version 1.0.0
WAGO-Software Notes about this Documentation 7
WAGO_DPS_01.lib CODESYS Library
Library Description
Version 1.0.0
8 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
2 WAGO_DPS_01.lib
The “WAGO_DPS_01.lib” library provides PROFIBUS-specific functions for the
CODESYS application.
All functions and function blocks are non-blocking. This means that the maximum
time for calling up a function or a function block depends on the internal capacity
and loading of the device and not on the reaction time of the peripheral devices
(e.g., DP master confirmation for PROFIBUS alarms).
Note Only assign slot numbers that have actually been programmed for the
“SLOT” input parameter!
When programming the “SLOT” input parameter, only slot numbers which
have actually been configured may be assigned.
This applies to all function blocks of the “WAGO_DPS_01.lib” library
which have a “SLOT” input variable.
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 9
WAGO_DPS_01.lib CODESYS Library
2.1 Troubleshooting
Each CODESYS function from this library supplies after execution the following
return values for further troubleshooting:
• The return value of the function indicates whether the function call was
executed error-free. The data type of the return value is “BOOL,” for which
the value “FALSE” stands for error-free processing and “TRUE” for a
faulty processing.
The following table shows the possible status values that apply to each function in
this library. All status values not listed in this table indicate an internal system
error. In this case, contact WAGO Support stating the status value and the action
performed.
Library Description
Version 1.0.0
10 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 11
WAGO_DPS_01.lib CODESYS Library
2.2 DPS_GET_DEV_STATE
The “DPS_GET_DEV_STATE” function enables the current state of the
PROFIBUS interface to be called.
Category Diagnostics
Name DPS_GET_DEV_STATE
Type Function
Name of library WAGO_DPS_01.lib
Required libraries ---
Applicable to 750-8206
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call
DEV_STATE BYTE Current state of the PROFIBUS
interface
Output parameter
Name Data Type Description
DPS_GET_DEV_ BOOL Status of function execution (see
STATE Section “Troubleshooting”):
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Graphical illustration
Library Description
Version 1.0.0
12 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Description
The states are coded as follows:
Status Value Description
0 The PROFIBUS interface is not initialized.
1 The PROFIBUS interface is waiting for configuration data from
CODESYS.
2 The PROFIBUS-C0 channel is being opened.
3 The PROFIBUS-C0 channel is open.
4 The actual configuration is being processed.
5 The PROFIBUS-C2 channel is being opened.
6 The PROFIBUS-C0 channel is being started.
7 The PROFIBUS interface is waiting for valid PROFIBUS
parameter data.
8 The PROFIBUS interface is waiting for modified PROFIBUS
parameters or configuration data.
9 The PROFIBUS interface is waiting for valid PROFIBUS
configuration data.
10 The PROFIBUS interface is performing a check of the target and
actual configuration.
11 The PROFIBUS parameters are being processed.
12 The PROFIBUS process data exchange is being started.
13 The PROFIBUS process data exchange is being monitored.
14 The PROFIBUS-C0 channel is being stopped.
15 The processing of the active diagnostics objects (e.g., alarms) is
being aborted.
16 The PROFIBUS-C0 channel is being closed.
17 The PROFIBUS-C2 channel is being closed.
18 The PROFIBUS interface is being closed.
19
The PROFIBUS interface is in an error state.
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 13
WAGO_DPS_01.lib CODESYS Library
2.3 DPS_GET_SYS_DIAG
The “DPS_GET_SYS_DIAG” function enables the calling of the current
information of the WAGO system diagnostics.
Category Diagnostics
Name DPS_GET_SYS_DIAG
Type Function
Name of library WAGO_DPS_01.lib
Required libraries ---
Applicable to 750-8206
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call
SLOT BYTE Specifies the slot information of
the diagnostics
CODE BYTE Error code
ARG BYTE Error argument
ETX_ARG BYTE Extended error argument
Output parameter
Name Data Type Description
DPS_GET_SYS_DIAG BOOL Status of function execution (see
Section “Troubleshooting”):
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Graphical illustration
Library Description
Version 1.0.0
14 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Description
A detailed description of the individual parameters of the WAGO system
diagnostics is available in the device manual.
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 15
WAGO_DPS_01.lib CODESYS Library
2.4 DPS_SEND_DIAG
The “DPS_SEND_DIAG” function enables the PROFIBUS diagnostics telegram
managed by the PROFIBUS diagnostics management to be sent to the DP master.
Category Diagnostics
Name DPS_SEND_DIAG
Type Function
Name of library WAGO_DPS_01.lib
Required libraries ---
Applicable to 750-8206
Input parameter
Name Data Type Description
REQ BOOL Controls the send operation:
TRUE Starts the sending of the
station diagnostics
FALSE Only call of the status of
the send operation
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call
BUSY BOOL Returns the state of the send
operation:
TRUE Send operation running.
FALSE Send operation
completed.
DONE BOOL Returns the state of the send
operation:
TRUE Send operation
completed.
FALSE Send operation running.
DIAG_OVFL BOOL Indicates an overflow of the
diagnostic data:
TRUE More diagnostics data
present than fits in the
diagnostics data area
available.
FALSE The diagnostics data fits
in the diagnostics data
area available.
Library Description
Version 1.0.0
16 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Output parameter
Name Data Type Description
DPS_SEND_DIAG BOOL Status of function execution (see
Section “Troubleshooting”):
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Graphical illustration
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 17
WAGO_DPS_01.lib CODESYS Library
2.5 DPS_SET_ID_REL_DIAG
The “DPS_SET_ID_REL_DIAG” function enables a group error to be set in the
ID-based diagnostics object for the defined slot. The diagnostics management of
the PROFIBUS interface takes over the management of the diagnostics object.
Category Diagnostics
Name DPS_SET_ID_REL_DIAG
Type Function
Name of library WAGO_DPS_01.lib
Required libraries ---
Applicable to 750-8206
Input parameter
Name Data Type Description
SLOT USINT Slot at which the error state is to
be changed. *
ERR_FLAG BOOL Error state of the slot:
TRUE Error present.
FALSE No error present.
* The valid value range of this parameter is provided in the description of this
diagnostics object in the manual of the relevant device.
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call (see Section
“Troubleshooting”)
Output parameter
Name
PS_SET_ID_REL_ Data Type Description
IAG
BOOL Status of function execution (see
Section “Troubleshooting”):
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Library Description
Version 1.0.0
18 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Graphical illustration
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 19
WAGO_DPS_01.lib CODESYS Library
2.6 DPS_SET_MOD_STAT_DIAG
The “DPS_SET_MOD_STAT_DIAG” function enables diagnostics to be
controlled in the module status diagnostics object for a defined slot. The
diagnostics management in the PROFIBUS interface takes over the management
of the diagnostics object.
Category Diagnostics
Name DPS_SET_MOD_STAT_DIAG
Type Function
Name of library WAGO_DPS_01.lib
Required libraries ---
Applicable to 750-8206
Input parameter
Name Data Type Description
SLOT USINT Slot at which the error state is to
be changed.
MOD_STAT BYTE Error state of the slot:
0x00 Data valid
0x01 Data invalid
0x10 Incorrect fieldbus
variable
0x11 No fieldbus variable
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call (see Section
“Troubleshooting”)
Output parameter
Name Data Type Description
DPS_SET_MOD_ BOOL Status of function execution (see
STAT_DIAG Section “Troubleshooting”):
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Library Description
Version 1.0.0
20 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Graphical illustration
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 21
WAGO_DPS_01.lib CODESYS Library
2.7 DPS_SET_CHAN_REL_DIAG
The “DPS_SET_CHAN_REL_DIAG” function enables a channel diagnostics
object to be generated or deleted for the defined slot and channel. The diagnostics
management in the PROFIBUS interface takes over the management of the
diagnostics object.
Category Diagnostics
Name DPS_SET_CHAN_REL_DIAG
Type Function
Name of library WAGO_DPS_01.lib
Required libraries ---
Applicable to 750-8206
Input parameter
Name Data Type Description
REQ BOOL Controls the processing of the
diagnostics object:
TRUE Processing is started
according to the
“SET_DIAG”
parameter.
FALSE The “BUSY” and
“DONE” parameters are
updated.
SET_DIAG BOOL Controls the processing of the
diagnostics object:
TRUE Diagnostics object is
created. The
identification number of
the new diagnostics
object is output at the
“DIAG_ID” output.
FALSE Diagnostics object is
being deleted. The
identification number of
the diagnostics object to
be deleted must be
specified at the
“DIAG_ID” input.
Library Description
Version 1.0.0
22 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call (see Section
“Troubleshooting”)
BUSY BOOL Returns the current sending status:
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 23
WAGO_DPS_01.lib CODESYS Library
Output parameter
Name Data Type Description
DPS_SET_MOD_ BOOL State of the function execution
STAT_DIAG (see Section “Troubleshooting”)
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Graphical illustration
Description
The created diagnostics object is a fixed part of the station diagnostics until it is
deleted again.
If a diagnostics object is successfully created with the object parameters, a
diagnostics ID is returned at the “DIAG_ID” output.
This diagnostics ID must be specified at the “DIAG_ID” input in order to query
the state of the diagnostics object or delete it. This does not require the
specification of the object parameters.
A maximum of 64 diagnostics objects can be managed simultaneously by the
diagnostics management.
Library Description
Version 1.0.0
24 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
2.8 DPS_SET_STATUS_MSG
The “DPS_SET_STATUS_MSG” function enables a user-specific status message
to be generated or deleted. The diagnostics management in the PROFIBUS
interface takes over the management of the diagnostics object.
Category Diagnostics
Name DPS_SET_STATUS_MSG
Type Function
Name of library WAGO_DPS_01.lib
Required libraries ---
Applicable to 750-8206
Input parameter
Name Data Type Description
REQ BOOL Controls the processing of the
diagnostics object:
TRUE Processing is started
according to the
“SET_DIAG”
parameter.
FALSE The “BUSY” and
“DONE” parameters are
updated.
SET_DIAG BOOL Controls the processing of the
diagnostics object:
TRUE Diagnostics object is
created. The
identification number of
the new diagnostics
object is output at the
“DIAG_ID” output.
FALSE Diagnostics object is
being deleted. The
identification number of
the diagnostics object to
be deleted must be
specified at the
“DIAG_ID” input.
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 25
WAGO_DPS_01.lib CODESYS Library
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call (see Section
“Troubleshooting”)
BUSY BOOL Returns the current sending status:
Library Description
Version 1.0.0
26 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Output parameter
Name Data Type Description
DPS_SET_STATUS_ BOOL State of the function execution
MSG (see Section “Troubleshooting”)
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Graphical illustration
Description
The created diagnostics object is a fixed part of the station diagnostics until it is
deleted again.
If a diagnostics object is successfully created with the object parameters, a
diagnostics ID is returned at the “DIAG_ID” output.
This diagnostics ID must be specified at the “DIAG_ID” input in order to query
the state of the diagnostics object or delete it. This does not require the
specification of the object parameters.
A maximum of 32 diagnostics objects can be managed simultaneously by the
diagnostics management. The length of the user data must not exceed 4 bytes.
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 27
WAGO_DPS_01.lib CODESYS Library
2.9 DPS_SET_ALARM
The “DPS_SET_ALARM” function block enables PROFIBUS alarms to be
entered in the alarm memory of the diagnostics management. The diagnostics
management in the PROFIBUS interface takes over the management of the
diagnostics object.
Category Diagnostics
Name DPS_SET_ALARM
Type Function Block
Name of library WAGO_DPS_01.lib
Required libraries ---
Applicable to 750-8206
Input parameter
Name Data Type Description
REQ BOOL Controls the processing of the
diagnostics object:
TRUE Processing is started
according to the
“SET_DIAG”
parameter.
FALSE The “BUSY” and
“DONE” parameters are
updated.
SET_DIAG BOOL Controls the processing of the
diagnostics object:
TRUE Diagnostics object is
created. The
identification number of
the new diagnostics
object is output at the
“DIAG_ID” output.
FALSE Diagnostics object is
being deleted. The
identification number of
the diagnostics object to
be deleted must be
specified at the
“DIAG_ID” input.
Library Description
Version 1.0.0
28 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call (see Section
“Troubleshooting”)
BUSY BOOL Returns the current sending status:
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 29
WAGO_DPS_01.lib CODESYS Library
Output parameter
Name Data Type Description
DPS_SET_ALARM BOOL State of the function execution
(see Section “Troubleshooting”)
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Graphical illustration
Description
If the “SEND_DIAG” function block is called, all alarms waiting in the alarm
memory are also transferred to the DP master.
If a diagnostics object is successfully created with the object parameters, a
diagnostics ID is returned at the “DIAG_ID” output. This diagnostics ID must be
specified at the “DIAG_ID” input in order to query the state of the diagnostics
object or delete it. This does not require the specification of the object parameters.
A maximum of 32 diagnostics objects can be managed simultaneously by the
diagnostics management. The length of the user data must not exceed 4 bytes.
Library Description
Version 1.0.0
30 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
2.10 DPS_SET_IM_DS
The “DPS_SET_IM_DS” function enables the data of the defined I&M data set to
be written.
Input parameter
Name Data Type Description
DS_ID USINT Specifies the number of the I&M
data set. The data sets 0 to 4 are
supported.
DATA POINTER_TO_ Specifies the pointer to the
BYTE memory area of the data set data
Input/output parameter
Name Data Type Description
STATUS DWORD Detailed identification of a faulty
function call (see Section
“Troubleshooting”)
Output parameter
Name Data Type Description
DPS_SET_IM_DS BOOL Status of function execution (see
Section “Troubleshooting”):
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Graphical illustration
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 31
WAGO_DPS_01.lib CODESYS Library
Description
The write access is only possible to I&M data sets 1 to 4. When the function is
called, 64 bytes of data are always written from the defined memory to the I&M
data set.
Library Description
Version 1.0.0
32 WAGO_DPS_01.lib WAGO-Software
WAGO_DPS_01.lib CODESYS Library
2.11 DPS_GET_IM_DS
The “DPS_GET_IM_DS” function enables the data of the defined I&M data set to
be read and stored in the defined memory area.
Input parameter
Name Data Type Description
DS_ID USINT Specifies the number of the I&M
data set. The data sets 0 to 4 are
supported.
Input/output parameter
Name Data Type Description
DATA POINTER_TO_ Specifies the pointer to the
BYTE memory area for the data set data.
STATUS DWORD Detailed identification of a faulty
function call (see Section
“Troubleshooting”)
Output parameter
Name Data Type Description
DPS_GET_IM_DS BOOL State of the function execution
(see Section “Troubleshooting”)
TRUE An error occurred during
the function call.
See the “STATUS”
output parameter for the
detailed identification of
the error.
FALSE The function call was
executed error-free.
Graphical illustration
Library Description
Version 1.0.0
WAGO-Software WAGO_DPS_01.lib 33
WAGO_DPS_01.lib CODESYS Library
Description
The data length of the target memory must be at least 64 bytes in size.
Library Description
Version 1.0.0
34 List of Tables WAGO-Software
WAGO_DPS_01.lib CODESYS Library
List of Tables
Table 1: Number Notation ....................................................................................... 7
Table 2: Font Conventions ...................................................................................... 7
Table 3: Overview of Functions and Function Blocks ............................................ 8
Table 4: Overview of Status Values ........................................................................ 9
Library Description
Version 1.0.0
WAGO-Software 35
WAGO_DPS_01.lib CODESYS Library
Library Description
Version 1.0.0
WAGO Kontakttechnik GmbH & Co. KG
Postfach 2880 • D-32385 Minden
Hansastraße 27 • D-32423 Minden
Phone: +49/5 71/8 87 – 0
Fax: +49/5 71/8 87 – 1 69
E-Mail: info@wago.com
Internet: http://www.wago.com