Structure of the PROFIBUS
Parameter Assignment and
Configuration Frame
References
Note on the CE Mark
Glossary
Index
B
C
D
E
Page 2
Classification of Safety-Related Notices
This manual contains notices which you should observe to ensure your own personal safety, as well as to protect the product and connected equipment. These notices are highlighted in the manual by a warning triangle and are marked as follows
according to the level of danger:
Danger
!
!
!
indicates that death or severe personal injury will result if proper precautions are
not taken.
Warning
indicates that death or severe personal injury can result if proper precautions are
not taken.
Caution
with warning triangle indicates that minor personal injury can result if proper
precautions are not taken.
Caution
without warning triangle indicates that damage to property can result if proper
precautions are not taken.
Notice
indicates that an undesirable result or status can result if the relevant notice is
ignored.
Note
highlights important information on the product, using the product, or part of the
documentation that is of particular importance and that will be of benefit to the
user.
2
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 3
Trademarks
SIMATICR, SIMATIC HMIR and SIMATIC NETR are registered trademarks of
SIEMENS AG.
Third parties using for their own purposes any other names in this document which
refer to trademarks might infringe upon the rights of the trademark owners.
Safety Instructions Regarding your Product:
Before you use the product described here, read the safety instructions below thoroughly.
Qualified Personnel
Only qualified personnel should be allowed to install and work on this equipment.
Qualified persons are defined as persons who are authorized to commission, to
ground, and to tag circuits, equipment, and systems in accordance with established safety practices and standards.
Correct Usage of Hardware Products
Note the following:
Warning
!
This device and its components may only be used for the applications described in
the catalog or the technical description, and only in connection with devices or
components from other manufacturers which have been approved or
recommended by Siemens.
This product can only function correctly and safely if it is transported, stored, set
up, and installed correctly, and operated and maintained as recommended.
Before you use the supplied sample programs or programs you have written
yourself, make certain that no injury to persons nor damage to equipment can
result in your plant or process.
EU Directive: Do not start up until you have established that the machine on which
you intend to run this component complies with the directive 89/392/EEC.
Correct Usage of Software Products
Note the following:
Warning
!
This software may only be used for the applications described in the catalog or the
technical description, and only in connection with software products, devices, or
components from other manufacturers which have been approved or
recommended by Siemens.
Before you use the supplied sample programs or programs you have written
yourself, make certain that no injury to persons nor damage to equipment can
result in your plant or process.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
3
Page 4
Prior to Startup
Prior to startup, note the following:
Caution
Prior to startup, note the information and follow the instructions in the latest documentation. You will find the ordering data for this documentation in the relevant
catalogs or contact your local Siemens office.
Disclaimer of LiabilityCopyright E Siemens AG 2001–2002 All rights reserved
The reproduction, transmission or use of this document or its contents is not
permitted without express written authority. Offenders will be liable for
damages. All rights, including rights created by patent grant or registration of
a utility model or design, are reserved.
Siemens AG
Automation and Drives
Postfach 4848, D-90327 Nuernberg
4
Siemens AktiengesellschaftG79000–G8976–C138–04
We have checked the contents of this manual for agreement with the hardware and software described. Since deviations cannot be precluded entirely,
we cannot guarantee full agreement. However, the data in this manual are
reviewed regularly and any necessary corrections included in subsequent
editions. Suggestions for improvement are welcomed.
Technical data subject to change.
DP/AS-InterfaceLink 20E
Release 11/2002
C79000-G8976-C138–04
Page 5
Preface
Purpose of the Manual
This manual supports you when using the DP/AS-Interface Link 20E module,
shortened to DP/AS-i Link 20E in the following chapters. It contains information
about how PROFIBUS DP masters can address AS-i actuators and AS-i sensors
via this module.
We recommend the following procedure when...
... You want an overall picture of the AS-Interface.
– First read the ‘AS-Interface Introduction and Basic Information’ manual (not
part of this documentation package). This contains general information
about the AS-Interface, abbreviated to AS-i in the following chapters.
... You want to set up an AS-i system and include the DP/AS-i Link 20E module in
it:
– You will find the information you require about connecting and operating the
DP/AS-i Link 20E module in Chapter 1.
... You want to know how to operate the DP/AS-i Link 20E from the point of view of
the PROFIBUS DP master:
– Read Chapter 2 in this manual.
– Chapter 3 explains the command interface.
Requirements
To understand this manual, you require the following:
SA working knowledge of PROFIBUS DP
SYou should be familiar with the ‘AS-Interface Introduction and Basic Information’
manual (not supplied with this documentation package).
Diskette with the GSD file
The accompanying diskette contains the GSD file that you require for configuring a
DP/AS-i Link 20E module with your DP master (see Section 1.9.1).
This chapter explains the performance, installation and basic functions of the
master module DP/AS-Interface Link 20E module (DP/AS-i Link 20E).
You will learn the following:
SHow to install the DP/AS-i Link 20E module
SThe display and control elements of the DP/AS-i Link 20E module
SHow to configure the DP/AS-i Link 20E module with the push button
SHow to configure a SIMATIC S7 DP master in STEP 7
SHow to set the PROFIBUS address for the DP/AS-i Link 20E module
When handling and installing the DP/AS-i Link 20E module, make sure that you
adhere to the ESD guidelines.
The DP/AS-i Link 20E module must only be connected when the AS-i power
supply unit is turned off.
Caution
Noise immunity/grounding
To ensure the noise immunity of the DP/AS-i Link 20E module, both the
DP/AS-i Link 20E module and the AS-i power supply unit must be grounded
correctly.
Caution
!
The AS-i power supply unit used must provide a low voltage, safely isolated from
the network. This safe isolation can be implemented according to the following
requirements:
SVDE 0100 Part 410 = HD 384-4-4 = IEC 364-4-41
(as functional extra-low voltage with safe isolation) or
SVDE 0805 = EN60950 = IEC 950
(as safety extra-low voltage SELV) or
SVDE 0106 Part 101
Note
The DP/AS-i Link 20E module can be configured, installed and started up
independent of the PROFIBUS installation.
The DP/AS-i Link 20E allows byte and word-consistent exchange of I/O data with a
DPV0, DPV1 master and the AS-i slaves.
SDPV0 mode
In the DPV0 mode and using a maximum of 32/32 bytes from the I/O area, up
to 62 digital AS-i slaves can be operated at a transmission rate of 9.6 Kbps up
to 12 Mbps. The command interface and the simple access to the AS-i analog
values using the AS-i slave profile 7.3/7.4 are not available in the DPV0 mode.
SDPV1 mode
In the DPV1–/DPx mode and using a maximum of 32/32 bytes from the I/O
area, up to 62 digital AS-i slaves can be operated at a transmission rate of 9.6
Kbps up to 12 Mbps. In addition to this, the services read_record/write_record
allow a maximum of 32 AS-i analog slaves with up to 4 analog I/O channels to
be operated.
Commands complying with the AS-i master specification M1e are implemented
with the read_record/write_record (record 2) services.
Components of the Product
The product DP/AS-i Link 20E includes the following components:
SDP/AS-i Link 20E
SProduct information for the DP/AS-i Link 20E
The DP/AS-i Link 20E module has the following technical data:
Table 1-1
Feature
AS-i cycle timeS5 ms for 31 slaves
Explanation/Values
S10 ms for 62 slaves with the extended
addressing mode
Configuration of the AS-InterfaceWith the button on the front panel or with STEP 7
Supported AS-i master profilesM1e
Connection of the AS-i cableVia a 7-pin terminal block
Permitted current loading from terminal 1 to
terminal 3 or terminal 2 to terminal 4, maximum 3 A
Connection to PROFIBUSVia 9-pin sub D female connector
PROFIBUS address setting– Address range 1 to 126
– Set with SET and DISPLAY buttons
Permitted loading 5V DC at PROFIBUS connectormax. 90 mA
Data rates supported (transmission rate) on
PROFIBUS
Power supply from the AS-i cable
Current consumption from the AS-i cable
Power consumption3.7 W
Ambient conditions
9.6 Kbps; 19.2 Kbps; 45.45 Kbps; 93.75 Kbps;
187.5 Kbps; 500 Kbps; 1.5 Mbps; 3 Mbps;
6 Mbps; 12 Mbps
According to the AS-i specification
max. 200 mA
SOperating temperatureHorizontal installation: 0 to 60°C
Vertical installation: 0 to 45°C
STransportation and storage temperature–40°C to +70°C
SRelative humiditymax. 95% at +25°C
Construction
SType of protectionIP 20
SDimensions (W x H x D) in mm90 x 80 x 62
SWeightapprox. 200 g
The DP/AS-i Link 20E module has type of protection IP 20.
SYou can install the DP/AS-i Link 20E module on a normal standard rail
(complying with EN 50022).
SAs an option, you can also install the module on a wall directly using the
mounting holes in the casing.
Installation on a Standard Rail
If you decide to install a module on a standard rail, please note the following
points:
1. The module is placed on the standard rail from above and then pushed down
until the catch at the bottom of the module locks into position.
2. Other modules can be installed to the left and right of the module.
Removing the Module from the Standard Rail
To remove the module from the standard rail, follow the procedure below:
1. When removing the module from the standard rail, the power supply and signal
cables must be removed first.
2. After the cables have been disconnected, press the catch on the module down
using a screwdriver and pull the module out of the rail towards the top.
Convection
Make sure that you leave at least 5 cm clearance above and below the module to
allow heat dissipation.
Vertical Installation
The standard rail can also be installed vertically. Due to the reduced convection,
the maximum permitted ambient temperature is reduced to 45°C.
Fit a grounding clip to the standard rail below the DP/AS-i Link 20E to prevent it
slipping down on the standard rail.
The DP/AS-i Link 20E module has the following connections:
STwo connections to the AS-i cable (bridged internally)
SOne connection for functional earth
SOne connection to PROFIBUS (9-pin sub D female connector)
The connectors are located below the upper cover of the front panel of the
DP/AS-i Link 20E module.
Connections to the AS-i cable
The DP/AS-i Link 20E module has two connections for AS-i cables that are
jumpered internally in the DP/AS-i Link 20E module.
This allows the DP/AS-i Link 20E module to be looped into the AS-i cable.
Caution
!
The permitted current loading of the AS-i connection contacts is 3 A. If this
value is exceeded on the AS-i cable, the DP/AS-i Link 20E module must not
be looped into the AS-i cable but must be connected with a tap line (only
one pair of connectors of the DP/AS-i Link 20E module is used).
The DP/AS-i Link 20E module is supplied with power entirely from the
AS-Interface.
The current consumption from the AS-Interface is 200 mA.
The free terminals 6 and 7 in the terminal block must not be connected.
Note
Functional Ground
The DP/AS-i Link 20E module has a connection for functional ground. This
connector should be connected to the PE conductor with as little resistance as
possible.
(terminal )
Connection to PROFIBUS DP
Connection to PROFIBUS DP is via a 9-pin sub D female connector.
Warning
!
When laying and installing the PROFIBUS DP cable and the bus connector, follow
the instructions in /5/.
To connect to PROFIBUS DP, bus connectors are available with cable outlets at
different angles (0°, 30° and 90°). Once again, follow the instructions in /5/.
The front panel of the DP/AS-i Link 20E module has a row with 8 LEDs (see Figure
1-2). All the LEDs are 2-color (red/green or yellow/green). The upper three LEDs
(ADR, BF and SF) make up the group display. They indicate the display status.
Changing the Display Status – DISPLAY Button
The following figure shows the possible display statuses of the group display.
You can change between the status display, slave display and PROFIBUS display
with the DISPLAY button. Each time you press the button, you change to the next
display status finally returning to the initial status.
Status display
(initial status)
ADR
BF
SF
0..4
1B..4B
Change to next display status
with the DISPLAY button
Display of the AS-i slaves
5..9
5B..9B
10..14
10B..14B
15..19
15B..19B
20..24
20B..24B
25..29
25B..29B
PROFIBUS
address
display
30..31
30B..31B
20
Key:
Static display: AS-i standard slaves and A slaves
Flashing display: B slaves
The status display is the default standard display in the
basic status of the DP/AS-i Link 20E module. No group
LED is lit green. The “ADR” LED must also not be lit red.
The lower 7 LEDs indicate the status of the
DP/AS-i Link 20E; the label to the right of the LEDs then
applies.
The bottom 5 LEDs indicate errors/states on the
AS-Interface. The BF LED indicates an error on
SF
red or off
PROFIBUS-DP
Meaning of the 7 Lower LEDs
When the status display is active, the LEDs have the following significance:
Table 1-2
LED (color)
BF (red)Bus FailureIndicates errors on PROFIBUS DP.
StatusMeaning
The LED is lit when:
SThe connection between the DP master and the DP/AS-i Link 20E
module has broken down or the DP master is not active.
SThe DP/AS-i Link 20E module was not or was incorrectly
configured/assigned parameters by the DP master.
SF (red)System errorThe LED is lit when:
SIn the protected mode, a diagnostic interrupt (entering state) was
triggered on the DP master.
SThe DP/AS-i Link 20E has detected an internal error (for example
EEPROM defective).
SWhile pressing the SET button, the DP/AS-i Link 20E module
cannot currently make the required mode change (for example a
slave exists with address 0).
PWR (green)RunThe LED is lit when the DP/AS-InterfaceLink 20E is supplied with
power.
APF (red)AS-i Power FailThis indicates that the voltage supplied to the AS-i cable by the AS-i
power supply unit is too low.
Note:
The DP/AS-i Link 20E module is supplied with power entirely from the
AS-Interface. Total failure of the AS-i power supply can therefore no
longer be displayed by AS-i Power Fail. You can recognize this
situation because the “PWR” LED is not lit.
This LED indicates whether the slave configuration detected on the
AS-i cable matches the expected configuration on the
DP/AS-i Link 20E module. If they do not match, the “CER” LED is lit.
The “CER” LED is lit in the following situations:
SWhen a configured AS-i slave does not exist on the AS-i cable (for
example failure of the slave).
SWhen an AS-i slave exists on the AS-i cable but it was not
previously configured.
SWhen an attached AS-i slave has different configuration data (I/O
configuration, ID code) from the slave configured on the
DP/AS-i Link 20E.
SWhen the DP/AS-i Link 20E module is in the offline mode.
AUP (green)Autoprog
available
CM (yellow)Configuration
Mode
In the protected mode of the DP/AS-i Link 20E module, the LED
indicates that automatic address programming of an AS-i slave is
possible. The automatic address programming makes it much easier
to exchange a defective AS-i slave on the AS-i cable (for more
detailed information refer to Chapter 5.1).
This LED displays the mode of the DP/AS-i Link 20E module.
The configuration mode is only required for installing and starting up
the DP/AS-i Link 20E module. In the configuration mode, the
DP/AS-i Link 20E module activates all connected AS-i slaves and
exchanges data with them. For more information about the
configuration mode, refer to Section 1.8.
The slave display can be recognized by the fact that at least
ADR
BF
green or off
green or off
one group LED is lit green and that the ADR LED is not red.
The lower 5 LEDs then indicate the slaves on the
AS-Interface. In this case, the label to the left of the LEDs
applies. The display always represents 5 slaves.
SF
green or off
Display Statuses and Operation in Detail
The AS-i slaves are displayed in groups of five. The upper three group LEDs
indicate (in green) which of the groups of 5 is displayed. The following distinction is
also made:
SStatic display: AS-i standard slaves and A slaves
SFlashing display: B slaves
The lower five LEDs are lit green to indicate the detected or active AS-i slaves
within the group.
You can move from group to group by pressing the DISPLAY button again.
The module returns to the status display in the following situations:
SAfter displaying the last group (AS-i slaves 30, 31) and pressing the DISPLAY
button twice. (In other words changing to the PROFIBUS address display and
then to the status display.)
SIf you do not press the DISPLAY button for approximately 8 minutes.
Characteristics of the Slave Display
SIf the DP/AS-i Link 20E module is in the configuration mode, all detected
AS-i slaves are displayed.
SIf the DP/AS-i Link 20E module is in the protected mode, all active AS-i slaves
are displayed. In the protected mode, failed or existing but unconfigured AS-i
slaves are indicated by the corresponding LED flashing.
If the top LED (“ADR”) of the group display is lit up red, the 7
ADR
red
lower LEDs indicate the PROFIBUS address of the
DP/AS-i Link 20E in binary format.
BF
SF
green or off
green or off
Setting the PROFIBUS Address
To set the PROFIBUS address of the DP/AS-i Link 20E module, follow the steps
outlined below:
1. Interrupt the connection to the DP master (for example by unplugging the
PROFIBUS connector) or switch the DP master to STOP.
Note
The PROFIBUS address can only be set in this mode.
2. Change the display on the DP/AS-i Link 20E module until the “ADR” LED is lit
red by pressing the DISPLAY button (note: starting from the status display, the
button must be pressed 15 times!).
The DP/AS-i Link 20E module then indicates the currently set PROFIBUS
address using the 7 lower LEDs.
3. If you now press the DISPLAY button, the DP/AS-i Link 20E returns to the
status display, the set PROFIBUS address is retained.
If, on the other hand, you press the SET button, you can set a new value for the
PROFIBUS address. First of all, the “BF” LED flashes and the most significant
bit of the PROFIBUS address is displayed.
4. If you press SET, this bit is set (LED on), if you press the DISPLAY button, the
bit is reset (LED off). The display then jumps to the “SF” LED (next address bit
of the PROFIBUS address).
5. By following the steps outlined above, you can now set or reset each of the
individual bits of the PROFIBUS address.
6. When all the bits have been entered, the display of the set address bits
alternates quickly red/green or yellow/green. If you press the SET button again,
the set PROFIBUS address is adopted by the DP/AS-i Link 20E module. If, on
the other hand, you press DISPLAY, the new address is discarded. The entry of
the new address must then be repeated (as in step 4 and 5).
The value of the address bits represented by the LEDs of the PROFIBUS address
is illustrated in the following example:
Figure 1-5
red
green
green
green
64
32
16
8
4
2
1
ADR
BF
SF
RUN
APF
CER
AUP
CM
In the example,
the LEDs indicate the
PROFIBUS address:
64 + 4 + 1 = 69
Value of the address bits
Labeling field
status display
LED row
In the example above, the PROFIBUS address 69 was set with the SET/DISPLAY
buttons.
The highest address that can be set is address 126. Remember that address 126
is reserved on PROFIBUS for special functions (address assignment). For data
exchange with a DP master, you can use addresses 1 to 125.
1.8Configuring the AS-Interface with the SET Button (Button
Configuration)
Meaning of Button Configuration
This method of configuration allows you to commission the AS–Interface on the
DP/AS–i Link 20E quickly and with little effort.
If you want to configure the AS–Interface using STEP 7 (see Section 1.9), you can
skip this section.
Interpreting the Display Status
The DP/AS-Interface Link 20E module has two modes:
Sconfiguration mode
Sprotected mode
If you press the SET button, the mode changes to the other mode.
Notice
Note that the SET button is only effective when the connection to the DP master is
interrupted or when the DP master is set to STOP.
Configuration Mode
The configuration mode is used during AS-i installation and startup.
In the configuration mode, the DP/AS-i Link 20E module can exchange data with
every AS-i slave connected to the AS-i cable (except for the AS-i slave with
address ‘0’). Any AS-i slaves that are added later are detected immediately by the
master and activated and included in the cyclic data exchange.
When installation and startup is completed, the DP/AS-i Link 20E module can be
switched to the protected mode using the SET button. Any AS-i slaves active at
this point are therefore configured. The AS-i slave information shown below is then
stored in non-volatile memory on the DP/AS-Interface Link 20E module:
Sthe addresses
Sthe ID codes
Sthe I/O configuration
If the DP/AS-Interface Link 20E is in the protected mode, it only exchanges data
with slaves that are “configured”. In this sense, “configured” means that the slave
addresses stored on the DP/AS-Interface Link 20E and the configuration data
stored on the DP/AS-Interface Link 20E match the values of the existing AS-i
slaves.
Preparing to Configure using Buttons
Make sure that the following situation applies:
SThe data exchange between the DP master and DP/AS-i Link 20E module is
interrupted or the DP master is in the STOP mode.
SThe DP/AS-i Link 20E module and all AS-i slaves must be connected to the AS
interface and supplied with power by the AS-i power supply unit.
SThe AS-i slaves must have unique addresses other than “0”.
Notice
It is only possible to configure the AS interface in the status display or slave display status. The DP/AS-i Link 20E module must not be in the PROFIBUS address
display mode; in other words when the SET button is pressed, the “ADR” LED display must not lights up red.
Configuring using Buttons
1. Press the DISPLAY button to set the DP/AS-i Link 20E display to the “status
display” mode (initial status).
2. Check whether the DP/AS-i Link 20E module is in the “configuration mode”.
(”CM” LED lit ). If not, change the DP/AS-i Link 20E to the configuration mode
using the SET button.
3. By changing to the slave display with the DISPLAY button, you can check
whether all the slaves connected to the AS-Interface exist and are displayed.
4. Press the SET button. This configures the DP/AS-i Link 20E, in other words the
actual configuration detected by the DP/AS-i Link 20E is stored as the default in
the non-volatile EEPROM. At the same time, the DP/AS-i Link 20E module is
switched to the protected mode, the “CM” LED goes off.
The “CER” LED also goes off since the “expected configuration” stored on the
DP/AS-i Link 20E module after configuration matches the existing “actual
configuration” on the AS-Interface.
Changing from the configuration mode to the protected mode is only possible
when there is no AS-i slave with address 0 connected to the AS-Interface. If a
slave 0 is connected, the “SF” LED lights up when the SET button is pressed.
1.9Configuring the DP/AS-i Link 20E as a DP Slave on the
DP Master
Significance of the Configuration
Communication with the DP slaves differs depending on the device you are using
as the DP master. Generally, you provide the information specifying the structure
of the DP master system during configuration.
The following aspects of DP configuration on the DP master are explained in this
section:
SThe use of the GSD file
SThe entries to be made in the configuration tool of the DP master
SConfiguration of a DP master from the SIMATIC S7 device range in STEP 7.
SCOM-PROFIBUS (ET 200)
SSTEP 7 (SIMATIC S7)
SSIMATIC NCM PC
SProducts from other manufacturers
Configurable Modes and Features of the DP Master
The following table lists the essential features of the possible DP master modes
complying with DPV0 and DPV1 (see also Section 1.2)
Table 1-3
Functions Available Via the AS-i Link 20E
Access to binary I/O dataXX
Convenient access to AS-i analog values
complying with AS-i slave profile 7.3/7.4
AS-i command interface–X
1) With SIMATIC S7 masters with an integrated interface and with the CP 443-5 EXT, these
functions are also available (at the time of printing, these functions were being prepared for
the CP 342-5).
Configuring the DP Master
The following table provides an overview of how to configure the possible modes
dependent on the DP master and tool used.
You should also refer to the information in the manual of the relevant configuration
tool.
Table 1-4
Type of DP Master
SS7 with DP interface
integrated in the
CPU
or
SS7 with DP
attachment via CP
342-5 and CP 443-5
STEP 7 from Version 5
with SP3 onwards
STEP 7 up to Version 5
with SP2
DPV0 ModeDPV1 Mode
–X
DP master configured with...Mode/Features
ToolProcedure
Take DP/AS-i Link 20E
from the hardware
catalog and configure it
in HW Config
Import GSD file and set
S7 mode
DPV1 + configured
slave configuration
during startup (see
Type of DP MasterMode/FeaturesDP master configured with...Mode/FeaturesType of DP Master
ProcedureTool
Standard complying with
DPV0
Standard complying with
DPV1
Depending on specific
master
Depending on specific
master
For example import
GSD file in COM
PROFIBUS
For example import
GSD file in COM
PROFIBUS
Enable DPV1 (see
Section 1.9.2)
GSD file
The GSD file also contains the information about the DP/AS-i Link 20E required by
the configuration tool (for example STEP 7 or COM PROFIBUS).
DPV0
DPV1
The GSD file is shipped on diskette along with this manual and can also be
downloaded via a modem from the Interface Center Fürth at the telephone number
+49 911 737972.
The GSD file can also be downloaded from the Internet at
http://www.ad.siemens.de/csinfo/ (under “All Downloads...”).
BMP File (bitmap)
To allow graphic representation of the DP/AS-i Link 20E, some configuration tools,
for example STEP 7, use bitmap files. These are also supplied on the
accompanying diskette.
Entries in the Configuration Tool of the DP Master
If you have imported the GSD file into the configuration tool of your DP master, you
can make various selections as follows:
SConfiguration
You can choose between the following:
– Max. 16/16 bytes (general identification format)
Select this configuration if your DP master can only handle DP configuration
frames with a general identification format. You can then only exchange data
with standard AS-i slaves or with A slaves.
– Maximum 32/32 bytes (special identification format)
Select this configuration if your DP master can handle DP configuration
frames with a special identification format. In this case, you can use the
entire binary data interface of the DP/AS Interface Link 20E.
SParameter Assignment
When setting parameters for DP operation with the DP/AS Interface Link 20E,
you can select between the following operating parameters:
With these operating parameters, the “Diagnostic Interrupt enable” mode is
the default. With this setting, the DP/AS Interface Link 20E triggers
diagnostic interrupts if an error occurs.
If you want to deactivate this response, select “Diagnostic Interrupt =
disable”
– S7 mode enable/disable (default “disable”)
This operating parameter must be set to enable if an S7 device is used as
the DP master and when the master is configured with STEP7 V5.0 SP2 or
with an earlier version.
Caution
!
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
If you use a DPV0 master, you must leave the “DPV1 disable” setting! Otherwise
the I/O transfer may be deactivated if AS-i errors occur.
If your DP master cannot process GSD files, under some circumstances, you can
enter the parameter assignment frame and configuration frame for the
DP/AS-i Link 20E module when you configure the DP master. The structure of the
parameter assignment and configuration frame for the DP/AS-i Link 20E module is
explained in Appendix C.
1.9.3Configuration in STEP 7 – Basic Configuration
Configuring the DP Master System
The DP/AS-i Link 20E is taken from the hardware catalog in STEP 7 HW Config
just like any other DP slave and inserted in the graphic display of the DP master
system.
After you have inserted the DP/AS-i Link 20E as a DP slave, there are still no AS-i
slaves to be seen in the detailed view of the station window. With this default
setting, the configuration rules of “configuration by button” apply initially (see
Section 1.8 ).
To configure general information, addresses, and operating parameters, change to
the properties dialog of the DP/AS-i Link 20E.
The settings you make in this dialog are adequate to start up the DP/AS-i Link 20E
with a SIMATIC S7 DP master. All further configuration information relevant to the
AS-i slaves can be stored on the DP/AS-i Link 20E by configuring with the button
(see Section 1.8).
If you require a more detailed AS-i configuration using STEP 7, follow the
instructions in the next section 1.9.4.
S”Digital Addresses” tab
To configure the address areas for the DP input data and DP output data,
change to the “Digital Addresses” tab.
Start addresses:
The settings must be identical for
inputs and outputs.
Pack:
The address utilization is optimized; all
gaps are eliminated
Configuring AS-i slaves completely in STEP 7 as described below allows you to
adapt the AS-Interface to the I/O address range of SIMATIC S7.
The settings you have made up to now in the basic configuration are adequate to
start up the DP/AS-i Link 20E with a SIMATIC S7 DP master. All other
configuration information relating to the AS-i slaves can then also be stored on the
DP/AS-i Link 20E using the configuration button (see Section 1.8).
If you want to configure the AS-i slaves in greater detail in STEP 7, follow the
instructions below.
Configuring AS-i Slaves
To set a specific slave configuration, take the AS-i slaves from the hardware
catalog and insert them in a free line in the detailed view of the station window.
This specifies the addresses of the AS-i slaves.
Notice
If you define the AS–I slave configuration in STEP 7, any button configuration on
the DP/AS–I Link 20E is overwritten during the DP startup.
There are two types of AS-i slave available:
SAS-i A/B slave
AS-i slave with extended addressing mode
SAS-i standard slave or AS-i analog slave
AS-i slave for the standard address area; if you use
this slave type, you cannot use an AS-i A/B slave
under the same AS-i address in the B address area.
Configuring the Properties of an AS-i Slave
By configuring the properties of the AS-i slaves, you can do the following:
SStore general information for the AS-i slaves
SEnter configuration data of the AS-i slaves
SSpecify the I/O configuration
SSpecify I/O address areas
If you want to configure analog slaves you should also use the AS-i standard slave.
You set the properties of the analog interface using the combination of the I/O
configuration and the three ID codes. Please refer to the manual of the AS-i slave
you are using for information about the parameter settings.
These parameters are specified in compliance with the DP standard V1.
Example:
General I/O configuration for analog
slaves.
1 For AS-i slaves that do not support the ID1/ID2
codes, enter the values F
.
H
ID codes for analog slaves that can
be found in the relevant manual.
Here, for example:
SID Code: 3h
SID1: Fh (is not evaluated)1
SID2: 5h = 2-channel analog slave
The AS-i A/B slave can be placed either in the A area or B area of an AS-i
address. The B area can only be used when no AS-i standard slave has been
placed in the A area.
The parameters in this box specify
the slave profile.
In addition to the I/O configuration:
SID Code: standardized meaning;
SID1/2 Code: Extended ID code
complying with the new standard
(2.1)
As an option, you can
also enable the use of
startup parameters
here.
Whether or not these
parameters are used
depends on the slave
type.
With A/B slaves, only
three bits are available!
Bit 4 is required for the
address changeover.
Depending on the I/O configuration,
you can specify the address area
for input/output data here.
You can upload the current actual configuration over the AS–i Link 20E to the open
STEP 7 project.
This allows you
Sto read in a complex configuration and to use it as a basis for further
configuration in STEP 7;
Sto check the current configuration.
Notice
The uploaded configuration is always the current actual configuration. The actual
configuration can differ from the configuration set with the buttons and stored on
the AS–i master, for example, when a slave was subsequently removed or added.
If you download the configuration from the STEP 7 project to the AS–i Link 20E,
the configuration detected during button configuration is overwritten.
Follow the steps below
Preparation: Create and download the basic configuration:
1. Create a basic configuration by inserting the AS–i Link 20E in a DP master
system of an S7–300 / S7–400 station.
2. Download this basic configuration to the S7 station with HW Config.
Uploading:
3. Then select the “Options AS–i Slaves” tab
4. Click the “Upload to PG” button.
An existing defined configuration is overwritten. Prior to accepting the
configuration, you must confirm a warning.
5. Then change to the “Slave Configuration” tab to view the current actual
configuration and, if necessary, edit it.
Tip:
To use this function simply for information despite an existing defined configuration
in STEP 7, you can upload the actual configuration, check it and then click the
“Cancel” button in the dialog.
The DP/AS-i Link 20E supports the following transmission rates on PROFIBUS
DP:
9.6 Kbps19.2 Kbps45.45 Kbps93.75 Kbps187.5 Kbps
500 Kbps1.5 Mbps3 Mbps6 Mbps12 Mbps
-
44
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 45
Data Exchange Between the DP Master
and AS-i Slave
This chapter contains the information you require to access the AS-Interface from
the DP master via the DP/AS-Interface Link 20E (DP/AS-i Link 20E)
The chapter explains the transfer of the following:
SBinary values using the cyclic DP services
SAnalog values using the acyclic DP services
2
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
45
Page 46
Data Exchange Between the DP Master and AS-i Slave
2.1Preparation for Operation – an Overview
Before putting the system into operation, the following independent steps must first
be worked through:
You can configure a DP master
system, for example, in HW
Config of STEP 7
Configure DP master
with DP/AS-i Link as
DP slave and AS-i
Write a user program
with binary value
access for the DP
master
–> Section 2.3
For example, create a program
for an S7 CPU with a DP interface in
LAD/CSF/STL
Write a user program
master
–> Section 1.9
with analog value
access for the DP
master
–> Section 2.4
46
Putting into
operation
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 47
Data Exchange Between the DP Master and AS-i Slave
2.2How the Interfaces Work
Accessing the AS-Interface via PROFIBUS DP
The DP master communicates with the AS-i slaves via the DP/AS-i Link 20E. The
AS-i communication objects are mapped in one continuous data area for input data
and one for output data in the DP master.
Due to its function, the DP/AS-i Link 20E must operate two interfaces:
1. Interface to the DP master : PROFIBUS-DP
2. Interface to the AS-i slaves : AS-Interface
DP master
Cyclic services
Write binary values
Read binary values
Acyclic services
write_record
SWrite analog values
SCommand job
read_record
SAnalog values
SCommand response
PROFIBUSAS-Interface
Interface to DP master : PROFIBUS-DP
DP/AS-i Link
ADR
DP-AS Interface
BF
Link 20
DIA
19
24
29
SF
4
14
23
28
APF
3
8
13
18
22
2
7
12
17
27
CER
AUP
1
6
11
16
21
26
31
CM
0910
15
20
25
30
5
6GK7 1415 2AA0
AS-i slaves
AS-i
slave 1
X 2
3 4
AS-i
slave 2
AS-i
slave n
At the PROFIBUS end, the cyclic services and the acyclic services of
PROFIBUS-DP V1 are used:
SCyclic services
The cyclic services are used to transfer binary values.
SAcyclic services of PROFIBUS-DP V1
In the remainder of this description, these services are known as read_record
and write_record. They are used for the following:
– The transfer of analog values
– To operate the command interface
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
47
Page 48
Data Exchange Between the DP Master and AS-i Slave
2.3Transferring AS-i Binary Values
Purpose
This section explains how the binary values of attached AS-i slaves can be
accessed by the user program on the DP master.
Interface Between the DP Master and DP/AS-i Link 20E
Via the DP/AS-i Link 20E, the DP master accesses the binary inputs and outputs
of the AS-i slaves in the cyclic DP mode. The inputs and outputs of the AS-i
slaves are mapped in a continuous data area in the DP master.
DP master
Cyclic services
DP
Output area
DP
Input area
Figure 2-1
Write binary values
Read binary values
PROFIBUSAS-Interface
DP/AS-i Link
ADR
DP-AS Interface
BF
Link 20
DIA
19
24
29
SF
4
14
23
28
APF
3
8
13
18
22
2
7
12
17
27
CER
AUP
1
6
11
16
21
26
31
CM
0910
15
20
25
30
5
6GK7 1415 2AA0
AS-i slaves
AS-i
slave 1
X 2
3 4
AS-i
slave 2
AS-i
slave n
48
From the point of view of the PROFIBUS DP master, the DP/AS-i Link 20E
occupies
SA maximum of 32 input bytes and a maximum of 32 output bytes
Addressing these bytes within the DP master (in the user program etc.) depends
on the PROFIBUS DP master being used.
You will find examples of this below. For more detailed information, refer to /3/ and
the manuals for your PROFIBUS DP master.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 49
Data Exchange Between the DP Master and AS-i Slave
2.3.1Addressing AS-i Slaves
Notice
The following information relating to addressing applies in this form only to button
configuration (see Section 1.8 ) of the DP/AS-i Link 20E.
If you configure the AS-i slave using STEP 7, you must take into account the I/O
addresses documented there (see Section 1.9.4).
Interface to the AS-i Slaves
The DP/AS-i Link 20E assigns four bits (a nibble) of input data and four bits of
output data to every AS-i slave on the AS-i cable. The PROFIBUS DP master can
access this data cyclically.
Addressing the AS-i Input or Output Data on the DP Master
In total, the maximum of 62 AS-i slaves occupy 32 bytes of input data and 32 bytes
of output data (see table below). The start addresses of the input or output data
depend on the configuration of the PROFIBUS DP master.
In SIMATIC S7, the address range selected for the input and output data area
must always be identical.
Byte Number *)Bits 7–4Bits 3–0
m+0Status Nibble **)Slave 1 or 1A
Bit 3 | Bit 2 | Bit 1 | Bit 0
m+1Slave 2 or 2ASlave 3 or 3A
m+2Slave 4 or 4ASlave 5 or 5A
m+3Slave 6 or 6ASlave 7 or 7A
m+4Slave 8 or 8ASlave 9 or 9A
m+5Slave 10 or 10ASlave 11 or 11A
m+6Slave 12 or 12ASlave 13 or 13A
m+7Slave 14 or 14ASlave 15 or 15A
m+8Slave 16 or 16ASlave 17 or 17A
m+9Slave 18 or 18ASlave 19 or 19A
m+10Slave 20 or 20ASlave 21 or 21A
m+11Slave 22 or 22ASlave 23 or 23A
m+12Slave 24 or 24ASlave 25 or 25A
m+13Slave 26 or 26ASlave 27 or 27A
m+14Slave 28 or 28ASlave 29 or 29A
m+15Slave 30 or 30ASlave 31 or 31A
m+16reservedSlave 1B
m+17Slave 2BSlave 3B
m+18Slave 4BSlave 5B
m+19Slave 6BSlave 7B
m+20Slave 8BSlave 9B
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
49
Page 50
Data Exchange Between the DP Master and AS-i Slave
*)
m = start address of the input or output data on the DP master
**)
Bits 4–7 in the first byte of the input data are known as the status nibble; they are
reserved for the command interface of the DP/AS-i Link 20E (see Section 3.1).
Bits 4–7 in the first byte of the output data are also reserved and have no further
significance.
Bits 3–0Byte Number *)Bits 7–4
Slave 31B
Bit 3 | Bit 2 | Bit 1 | Bit 0
Masking I/O Addresses
I/O addresses that are not used in the lower part of the table can be masked
during DP configuration (for example in the STEP 7 configuration using the
“Reserved Length” parameter (see Section 1.9.3).
Example:
You are not using any B slaves as AS-i slaves with binary inputs and the highest
address of a standard slave is 20; this means that you can set the “Reserved
Length” of the input data to 11.
Special Feature of AS-i Analog Slaves
If you use AS-i analog slaves complying with profile 7.3 /7.4, the following applies:
SThe input nibbles of these AS-i slaves are set to the value “0” by the DP/AS-i
Link 20E;
SThe output nibbles of these AS-i slaves are ignored by the DP/AS-i Link 20E;
How to access AS-i analog slaves is described in Section 2.4.
50
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 51
Example of a Configuration
Figure 2-2 shows an example of the PROFIBUS DP master addressing four AS-i
slaves. In the DP master, the start addresses m = 0 are used for the I/O data.
The bits relevant for the user program (existing AS-i slaves) are shown on a gray
background. The bits shown on a white background are irrelevant for the user
program since no AS-i slaves are assigned here.
DP master
Data Exchange Between the DP Master and AS-i Slave
32
Input bytes
AS-i slaves
Figure 2-2
32
Output bytes
0
1
Bit 3
2
Bit 3
.
.
.
31
Bit 3
Bit 1
Bit 2
Bit 3
slave 2slave 3
Bit 1
slave 4
Bit 1
Bit 2
Slave 30B
Bit 1
Bit 2
567
slave 1
Bit 0
Bit 3
Bit 3
Bit 0
slave 5
Bit 0
Bit 3
Slave 31B
Bit 3
Bit 0
Slave no. 2Slave no. 3Slave no. 4
4 I module4 I/3 O module2 I/2 O module4 O module
4 I module
Bit 2Bit 2
Bit 2
Bit 2
Bit 0
Bit 1Bit 2
Bit 1
Bit 0
Bit 0
Bit 1
Bit 0
Bit 1
0
234
1
0
Bit 2
Bit 3
slave 2slave 3
1
Bit 2
Bit 3Bit 1 Bit 0
slave 4
2
Bit 2
Bit 3
...
Slave 30B
31
Bit 3
Bit 2
7
Bit 1
Bit 1
Bit 1
56
slave 1
Bit 0Bit 0
Bit 0
Bit 0
4
Slave no. 31B
Bit 3
Bit 3
Bit 3
Bit 3
Bit 1
Bit 2
Bit 1
Bit 2
slave 5
Bit 1
Bit 2
Slave 31B
Bit 2
Bit 1
Bit 0
Bit 0
Bit 0
0
In the figure above, for example, the 2I/2O module (AS-i slave number 3 with two
inputs and two outputs) occupies bits 0 and 1 in input byte 1 and bits 2 and 3 in
output byte 1.
The assignment of the AS-i terminals of the AS-i bus modules to the data bits of
the input/output bytes is shown below based on the example of slave number 3:
Input byte 1
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
10Bit no.
Terminal 2 on the AS-i bus
module
Terminal 1 on the AS-i bus
module
51
Page 52
Data Exchange Between the DP Master and AS-i Slave
Output byte 1
Terminal 4 on the AS-i bus
module
Terminal 3 on the AS-i bus
module
32Bit no.
52
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 53
Data Exchange Between the DP Master and AS-i Slave
2.3.2Accessing AS-i Binary Data
The DP Master is the Decisive Factor
The way in which you access binary data of the AS-i slaves depends on the DP
master you are using. Please refer to the relevant user documentation.
A SIMATIC S7 is the DP master
If you have configured the I/O addresses of the DP/AS-i Link 20E in the area of the
process image, you can access the AS-i bit values using single bit commands.
Example (see also Figure 2-2):
A I 1.0//Attachment 1 on AS–i module 3
= Q 1.3//Attachment 4 on AS–i module 3
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
53
Page 54
Data Exchange Between the DP Master and AS-i Slave
2.4Transferring AS-i Analog Values
Purpose
This section explains how you can access analog values of attached AS-i slaves in
the user program of the DP master.
Notice
The following explanations apply only to AS-i slaves that handle analog value
transfer in compliance with the AS-i slave profile 7.3 or 7.4.
Analog value transfer in compliance with AS-i slave profile 7.1/7.2 is not supported
by the DP/AS-i Link 20E. In this case, analog transfer must be implemented in
your software.
Analog Interface Between the DP Master and DP/AS-i Link 20E
Analog values are read and written using the acyclic services of PROFIBUS-DP
V1. In the user program of the DP master you use the read_record and
write_record services.
You can operate up to 31 AS-i slaves each with up to 4 analog input or 4 analog
output values. You access the analog values using up to 8 data records (data
record numbers 140–147).
54
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 55
Data Exchange Between the DP Master and AS-i Slave
DP master
Acyclic services
write_record
SAnalog valuesSCommand job
Data area for
analog
output values
Data area for
analog input
values
Figure 2-3
read_record
SAnalog values
SCommand response
PROFIBUSAS-Interface
DP/AS-i Link
19
24
29
23
28
18
22
17
27
16
21
26
31
15
20
25
30
Data records
140–147 for
analog
values
outputs
Data records
140–147 for
analog
values inputs
AS-i slaves
ADR
DP-AS Interface
BF
Link 20
DIA
SF
4
14
APF
3
8
13
2
7
12
CER
AUP
1
6
11
5
X 2
3 4
CM
0910
6GK7 1415 2AA0
AS-i
slave 1
AS-i
slave 2
AS-i
slave n
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
55
Page 56
Data Exchange Between the DP Master and AS-i Slave
2.4.1Calling Acyclic Services
DP Master with Acyclic Services
The acyclic services complying with the DP standard DP-V1 for PROFIBUS-DP
allow further jobs for sending output data to the DP slaves or for receiving input
data from the DP slaves in addition to cyclic data transfer.
The acyclic services are used for the following with the DP/AS-i Link 20E:
SReading/writing analog values
SCommand interface (see Chapter 3)
Certain parameters must have values assigned to specify the job. The names of
these parameters and the type of parameter setting can vary depending on the
type of the DP master.
The following table provides you with an overview of the parameters according to
the DP-V1 specification and shows examples of how they are mapped in the
parameter assignment of a user program for a SIMATIC S7 CPU and a user
program for a PC/programming device in which the SIMATIC NET programming
interface is used.
Call
With SIMATIC S7With the DP programming
interface
56
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 57
Data Exchange Between the DP Master and AS-i Slave
Table 2-2Parameters for Sending/Receiving
DP-V1
PROFIBUS
address
Slot_numberIs calculated from LADDR;
IndexRECNUMIndexData record number
LengthRECORD
DataRECORD
SIMATIC S7 (SFC 58/59)For PC: DP programming
interface (dpc*_read/write)
LADDR
(the start address of the
cyclic input bytes of the
DP/AS-i Link must be
specified (see also Section
1.9). The S7 CPU calculates
the PROFIBUS address from
this information.)
IOID
The following fixed value
must be entered: B#16#54
Not an SFC parameter
Referenced using ANY
pointer
Referenced using ANY
pointer
RET_VAL
BUSY
C_RefPROFIBUS address of the
–Fixed value
Slot_numberWith DP/AS-i Link:
Length_sLength of the input/output
Data_sAddress of the input/output
DP/AS-i Link (DP slave)
Any value
(140–147; see Table 2-3)
data area
data area
Return parameter for
execution check
Meaning
You will find sample programs for SIMATIC S7 in Section 2.4.3
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
57
Page 58
Data Exchange Between the DP Master and AS-i Slave
2.4.2Programming
Job Parameters
Make the parameter settings for the read_record and write_record jobs as
described in Section 2.4.1. Access to the analog values is controlled by the
following parameters:
SIndex:
Specifies the data record number in which the analog values are stored on the
DP/AS-i Link 20E. How the available data record numbers 140 to 147 are used
is explained below.
SLength:
Specifies the length of the input/output data area; the specified length must be
adapted to the data record being used and the address area of the analog
slaves. This is explained in greater detail and with examples below.
SData:
Specifies the address of the input/output data area in which your user program
accesses the analog values or makes the analog values available.
You will find sample calls at the end of this chapter.
Data Consistency
In terms of one AS-i slave, the analog values transferred to the DP master are
always consistent.
Mapping the Analog Values in the Data Records
To access analog values, you can select one of the data records 140 to 147. The
data records differ from each other in their length. This allows you to optimize the
data area to be reserved in your application if you are using less AS-i analog
slaves than the maximum number supported by the interface.
An 8-byte area is used for each slave address to manage 4 analog channels.
Remember that slave address 31 is not used in data record 140.
Table 1-1 below shows which address area in the selectable data records the
analog values of which AS-i slave are transferred to. How the analog values of an
analog slave are mapped in the address areas is shown in Table 2-4.
The table can be used equally for the analog input area and the analog output
area.
58
Following the tables, you will find notes explaining how to read the tables.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 59
Data Exchange Between the DP Master and AS-i Slave
Table 2-3Accessing Analog Values using Data Records
Start addresses for analog values in the data record
1. Configuration: Analog slaves have the AS-i addresses 1–6
You use data record 140 and specify 48 as the data record length.
2. Configuration: 1 analog slave with AS-i address 7 is used
You use data record 141 and specify 24 as the data record length.
3. Configuration: The entire address range for 31 analog slaves is used
You use data record 140 and specify 224 as the data record length. This covers
analog slaves 1–28.
For the other analog slaves 29–31, you use data record 147 in a second job
and specify 24 as the data record length.
4. Configuration: Analog slaves are in the address range 29–31
You use data record 147 and specify 24 as the data record length.
Representation of the Analog Values
According to slave profile 7.3 or 7.4, the analog values are interpreted as 16-bit
values in two’s compliment
For further information regarding the range of values, the measurement range and
the accuracy please refer to the relevant documentation of the analog slaves.
60
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 61
Data Exchange Between the DP Master and AS-i Slave
Special Situations in Analog Value Transfer
SIn the input direction (read_record), the DP/AS-i Link 20E supplies the value
7FFFh in the following situations:
– The AS-i slave does not exist, has failed, or is not an analog slave
complying with profile 7.3 or 7.4.
– The channel number is not supported by the analog slave.
– The analog slave signals “Value Invalid”.
SIn the input direction (read_record) the DP/AS-i Link 20E supplies the value 0h
when the analog slave supplies transparent data complying with profile 7.3 (ext.
ID2 code, Bit 2=1) and when
– This analog slave has failed
– This analog slave signals “Value Invalid”.
SIn the output direction (write_record) the DP/AS-i Link 20E behaves as follows:
– In the CLEAR status of the DP master (corresponds to the STOP state of a
PLC), the DP/AS-i Link 20E stops transfer of the analog output values. How
the analog slave reacts depends on the particular device.
– When the DP/AS-i Link 20E starts up, all analog output values are set to
7FFFh. This value is, however, only sent by the DP/AS-i Link 20E after the
first data record transfer for the relevant analog slaves.
Note
In SIMATIC S7, the number of simultaneously active read_record and write_record
jobs is restricted. The maximum permitted number depends on the particular S7
CPU.
If more than the maximum number of jobs are triggered, they are terminated with
the error 80C3h (temporary lack of resources). The rejected job must then be
repeated.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
61
Page 62
Data Exchange Between the DP Master and AS-i Slave
2.4.3Programming Examples
Example of Programming for a SIMATIC S7
An analog input value of AS-i analog slave 6 is transferred as an analog output
value to AS-i analog slave 9:
//Fixed value
//Start of cyclic input data
//DS141 (slave 5 and following)
//Return parameter
//Return parameter
//Receive buffer (slaves 5...8)
//WR_REC
//Fixed value
//Start of cyclic input data
//DS142 (slave 9 and following)
//Send buffer (slaves 9...12)
//Return parameter
//Return parameter
62
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 63
Data Exchange Between the DP Master and AS-i Slave
2.5PROFIBUS DP Control Commands
The DP/AS-i Link 20E supports all the control commands defined in the
PROFIBUS DP standard:
Table 2-6
Control command
FREEZEThe values of the binary input data of the AS-i slaves are frozen by the
DP/AS-i Link 20E. The DP/AS-i Link 20E updates this data once with each
further FREEZE.
UNFREEZEThe FREEZE command is canceled.
SYNCThe values of the binary output data are frozen by the DP/AS-i Link 20E. The
DP/AS-Interface Link 20 updates this data once with each further SYNC.
UNSYNCThe SYNC command is canceled.
CLEARThe values of the binary output data passed on by the DP/AS-i Link 20E to the
AS-i slaves are set to ’0’ by the DP/AS-i Link 20E.
Effect
-
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
63
Page 64
Data Exchange Between the DP Master and AS-i Slave
64
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 65
Using the Command Interface
Via the command interface, you can control the response of the AS-i master
completely from within your user program.
This chapter contains the information you require to access the command interface
of the DP/AS-Interface Link 20E from your DP master.
Apart from a detailed description of the commands, the two interface variants are
explained in detail as follows:
SThe command interface of the DP/AS-Interface Link 20E
SThe command interface with SIMATIC S7
3
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
65
Page 66
Using the Command Interface
3.1Command Interface of the DP/AS-Interface Link 20E
Note
A special function block (FC ASI_3422) is available for the AS-i commands in a
SIMATIC S7 DP master. This FC handles the command protocol described below
independently (see Section 3.2).
You will find FC ASI_3422 in the programming example on the diskette supplied
with the printed version of this manual.
Significance and Functionality
Via the command interface, you can control the response of the AS-i master
completely from within your user program.
AS-i commands are read and written using the acyclic services of PROFIBUS-DP
V1. In the user program on the DP master, you use the services read_record and
write_record (data record 2).
DP master
Acyclic services
write_record
SCommand job
Send buffer
Receive buffer
for response
data or
error/status
information
Figure 3-1
Status nibble
in the DP input area
Status information
read_record
SCommand response
PROFIBUSAS-Interface
DP/AS-i Link
19
24
29
23
28
18
22
17
27
16
21
26
31
15
20
25
30
Data record 2
AS-i slaves
ADR
DP-AS-Interface
BF
Link 20
DIA
SF
4
14
APF
3
8
13
2
7
12
CER
AUP
1
6
11
0910
5
X 2
3 4
CM
6GK7 1415 2AA0
AS-i
slave 1
AS-i
slave 2
AS-i
slave n
66
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 67
Job Parameters
Set the parameters for the read_record and write_record jobs as described in
Section 2.4.1. Sending the commands is controlled by the following parameters:
SIndex:
Specifies the data record number = 2
SLength:
– The length of the data sent (with write_record) depends on the command;
– The length of the data received (with read_record) is indicated by the
DP/AS-i Link 20E using the status nibble.
Commands in the User Program
To work with commands, include the following in your user program:
1. Specify the command call in a send buffer in the user program.
2. Send this job with write_record (record 2) to the DP/AS-i Link 20E.
Using the Command Interface
3. Following this, query the status of command processing in the input area for
binary values (cyclic services – see Section 2.1). The status information is
entered in bits 4 to 7 in the reserved first byte of the DP input area (status
nibble).
4. Various reactions are possible depending on the result of the status evaluation
as shown in the following flowchart (for more detailed information on the
meaning of the status nibble, please refer to Table 3-1).
To complete command processing, you must always sent a read_record job
(data record 2) either to obtain further status information or to receive response
data.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
67
Page 68
Using the Command Interface
Evaluate status nibble
Command processing active
Further evaluation of status
nibble necessary
Read_record:
2–byte return value
Terminated with error
Figure 3-2
Table 3-1Coding of the Status Nibble
Command processing completed
Completed without error
and without response data
Completed without error and
with response data
or
terminated with error
Read_record:
n bytes of response data
Completed without error
and without response data
New command call (write_record) possible
Status nibble (1st byte of
Meaning
the digital input data)
Bit 7Bit 6Bit 5Bit 4
1000Startup ID 1:
Following a startup/restart of the AS-i master, the status nibble changes
between the values 1000 B and 1110 B.
It is possible to trigger a command with the user program
1110Startup ID 2:
Following a startup/restart of the AS-i master, the status nibble changes
between the values 1000 B and 1110 B.
It is possible to trigger a command with the user program
1100Reserved for SIMATIC S7 application FC “ASI_3422”
It is possible to trigger a command with the user program
0010Command processing active
It is not possible to trigger a command with the user program
68
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 69
Table 3-1Coding of the Status Nibble, continued
Using the Command Interface
Status nibble (1st byte of
Meaning
the digital input data)
0001Command processing is completed. With an asynchronous read job, a
2-byte return value can be fetched by the AS-i master. Two situations
must be distinguished:
The return value is 0: A command without response data was completed
without error
The return value is a value not equal to 0: The command was terminated
with error.(See Table 3-3)
A new command can be triggered by the user program
0011Command processing was completed without error. Using an
asynchronous read job, 1 byte of response data can be fetched by the
AS-i master.
A new command can be triggered by the user program
0101Command processing was completed without error. Using an
asynchronous read job, 4 bytes of response data can be fetched by the
AS-i master.
A new command can be triggered by the user program
0111Command processing was completed without error. Using an
asynchronous read job, 14 bytes of response data can be fetched by the
AS-i master.
A new command can be triggered by the user program
1001Command processing was completed without error. Using an
asynchronous read job, 16 bytes of response data can be fetched by the
AS-i master.
A new command can be triggered by the user program
1011Command processing was completed without error. Using an
asynchronous read job, 32 bytes of response data can be fetched by the
AS-i master.
A new command can be triggered by the user program
1101Command processing was completed without error. Using an
asynchronous read job, 56 bytes of response data can be fetched by the
AS-i master.
A new command can be triggered by the user program
1111Command processing was completed without error. Using an
asynchronous read job, 221 bytes of response data can be fetched by the
AS-i master.
A new command can be triggered by the user program
0100Job processing is completed. The response data or the return value of the
previous job have already been read by the user.
A new command can be triggered by the user program
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
69
Page 70
Using the Command Interface
Example:
Based on the following table, you can see how the display in the status nibble
changes due to the device state and the command processing in the user program.
Table 3-2
Action
Reaction in the Status Nibble
1. AS-i power supply switched on for the DP/AS-iLink 20E.1110B....1000B.....1110B....
2. The user program transfers a command (for example
write_parameter) with an asynchronous write job to the
0010B (briefly, depending on the
command)
DP/AS-i Link 20E.
3. The AS-i master completes the command. The return value can
0001
B
be read by the user program.
4. The user program reads a 2-byte return value using an
0100
B
asynchronous read job.
5. ....further program execution .......
6. The user program transfers a command (for example, Get_LPS,
Get_LAS, Get_LDS, Get_Flags) with an asynchronous write
0010B (briefly, depending on the
command)
access to the DP/AS–i Link 20E.
7. The AS-i master completes the command without error. The
1011
B
response data can be read by the user program
8. The user program reads 32 bytes of response data with an
0100
B
asynchronous read job.
Return Value
Error free processing is encoded in the return value of the response buffer. There
is an error when value in the status nibble is “completed without error and without
response data or terminated with error” (Coding: 0001H).
Table 3-3Return Value in the Response Buffer
STATUS
0000HJob completed without error
8381HThe AS-i slave address is incorrect
8382HThe AS-i slave is not activated (not in LAS).
8383HError on AS-Interface.
8384HCommand not permitted in the current status of the AS-i master.
8385HAn AS-i slave with address 0 exists.
8386HThe AS-i slave has illegal configuration data (I/O or ID codes).
83A1HThe addressed AS-i slave was not found on the AS-Interface.
83A2HAn AS-i slave with address 0 exists.
70
Meaning
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 71
Using the Command Interface
Table 3-3Return Value in the Response Buffer, continued
STATUSMeaning
83A3HAn AS-i slave with the new address already exists on the AS-Interface.
83A4HThe AS-i slave address cannot be deleted.
83A5HThe AS-i slave address cannot be set.
83A6HThe AS-i slave address cannot be stored permanently.
83A7HError reading the extended ID1 code.
83A8HThe target address is not plausible (for example a B slave address was used for a
standard slave).
83B1HA length error has occurred transferring a string according to profile 7.4.
83B2HA protocol error has occurred transferring a string according to profile 7.4.
83F8HThe job number or the job parameter is unknown.
83F9HThe AS-i master has detected an EEPROM error.
Note
Errors that occur during processing of the acyclic services and that are indicated
by call parameters such as “Return Value” can be found in the documentation of
the relevant programming interface.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
71
Page 72
Using the Command Interface
3.2Command Interface for SIMATIC S7
Purpose
In SIMATIC S7, a convenient command interface is available with FC ASI_3422.
By calling FC ASI_3422, you can handle both the transfer of the command and the
acceptance of the response data. After it has been called, FC ASI_3422 instigates
and handles the write_record and read_record calls independently.
Call Interface
ASI_3422
STATUS
DONE
BOOL
BOOL
DWORD
BOOL
BOOL
WORD
ANY
DWORD
ACT
STARTUP ERROR
LADDR
SEND
RECVANY
Table 3-4Formal Parameters
Name
Para TypeData TypeMemory AreaRemarks
ACTIBOOLI,Q,M,D,L,constantAs long as ACT = 1, command
processing is started provided no other
call is being processed.
STARTUPIBOOLI,Q,M,D,L,constantA CPU startup is indicated to the FC by
STARTUP = 1. After the function is run
through the first time, STARTUP must
be reset by the user.
LADDRIWORDI,Q,M,D,L,constantStart address of the DP/AS-i Link 20E
in the S7 address area.
The module start address is specified
during STEP 7 configuration.
SENDIANYI,Q,M,D,LSend buffer
The parameter references a memory
area in which the command must be
specified by the user.
for example: P#DB20.DBX 20.0 byte
10
72
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 73
Using the Command Interface
Table 3-4Formal Parameters, continued
NameRemarksMemory AreaData TypePara Type
RECVIANYI,Q,M,D,LReceive buffer
This buffer is only relevant for
commands that supply response data.
The parameter references a memory
area in which the command response
is stored. The length information in the
ANY pointer specified here is
irrelevant. The FC itself obtains the
length of the response data.
STATUSI/QDWORDM,D1st word: Job status / error code (see
Table 3-5);
For ’job terminated with error’, an error
code is generated that describes the
error in greater detail.
2nd word: Required by the FC for
internal purposes and must not be
modified.
Note:
For FC calls to different
DP/AS-i Link 20E modules, different
double words must be used for the
ST ATUS parameter.
Commands in the User Program
To work with commands, you require the following in your user program:
1. In the warm restart branch of your S7 user program, call FC ASI_3422 once
with the parameter value STARTUP = TRUE.
2. Specify the command call in a send buffer in the user program. You transfer this
send buffer with the SEND call parameter.
3. Depending on the command type you will also require a response buffer. You
transfer this response buffer with the RECV call parameter. For status
information, the response buffer is not required for this FC interface.
4. Activate the job with the parameter ACT=1
5. You then query the parameters DONE, ERROR and STATUS. For handling
these parameters in the user program, note the signal sequence of the
parameters explained below.
The diskette supplied with this manual contains sample programs.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
73
Page 74
Using the Command Interface
Points to Note
SIf you use the FC interface FC ASI_3422 for command processing, you must
not send other commands via the read_record and write_record with data
record number 2 at the same time.
SYou must use version 2.0 or higher of the FC ASI_3422
SFC ASI_3422 is not reentrant! FC calls must not be programmed in priority
classes that can interrupt each other (for example by a call in OB1 and in
OB35).
SIn SIMATIC S7, the number of simultaneously active read_record and
write_record jobs is restricted. The maximum number of jobs depends on the
S7 CPU.
If more jobs are triggered, these are terminated with the error 80C3h
(temporary lack of resources). The rejected job must then be repeated.
Signal Sequence of the Formal Parameters ACT, DONE, ERROR and STATUS
ACT
DONE
ERROR
A command call is started by ACT = 1. During the processing of the job, the first
word of STATUS has the value 8181H. This indicates that a job is being processed.
On completion of the job, the user is informed of the result in the DONE or ERROR
parameters.
If no error occurred, DONE is set. In jobs involving response data from the
DP/AS-i Link 20E, these are available in the receive buffer specified for RECV. In
this case, 0000H is entered in the first word of STATUS.
If an error occurred, ERROR is set. In this case, no receive data are available from
the DP/AS-i Link 20E for jobs with response data. To identify the error in greater
detail, an error code is entered in the first word of STATUS.
The DONE, ERROR and STATUS parameters remain unchanged until the next job
is processed.
STATUS8181h0000h8181h0000h8181h
Figure 3-3
74
8181h
8381h
0000h
DP/AS-Interface Link 20E
C79000-G8976-C138–04
8181h
0000h
Release 11/2002
Page 75
Table 3-5Error Coding
Using the Command Interface
DONE
ERRORSTATUSMeaning
100000HJob completed without error
018090HAddress in LADDR invalid
018092HA type other than BYTE is specified in the ANY reference.
018093HThis SFC is not permitted for the module selected with
LADDR and IOID. (S7-300 modules are permitted for
S7-300, S7-400 modules for S7-400, S7-DP modules for
S7-300 and S7-400.)
0180A0HNegative acknowledgment when reading from AS-i master.
0180A1HNegative acknowledgment when writing to AS-i master
0180A2HDP protocol error at Layer 2
0180A3HDP protocol error involving user interface/user
0180A4HCommunication problems on K bus
0180B0HAS-i master does not recognize the data record
0180B1HSpecified data record length incorrect
0180B2HThe configured slot is not in use.
0180B3HActual module type does not match the expected module
type in SDB1
0180C0HData record cannot be read
0180C1HThe specified data record is currently being processed
0180C2HThere is a job pileup
0180C3HResource (memory) in use
0180C4HCommunication error
0180C5HDistributed I/Os not available
0180C6HData record transfer aborted due to priority class abort
(warm restart or background) of the distributed I/Os.
008181HJob active (no error)
018182HID following warm restart (STARTUP=TRUE)
018184HData type of the RECV formal parameter illegal
018381HThe AS-i slave address is incorrect
018382HThe AS-i slave is not activated (not in LAS).
018383HError on the AS-Interface
018384HCommand not permitted in the current status of the AS-i
master.
018385HAn AS-i slave with address 0 exists.
8386HThe AS-i slave has illegal configuration data (I/O or ID
codes).
0183A1HThe addressed AS-i slave was not found on the
AS-Interface.
0183A2HAn AS-i slave with address 0 exists.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
75
Page 76
Using the Command Interface
Table 3-5Error Coding, continued
DONEMeaningSTATUSERROR
0183A3HAn AS-i slave with the new address already exists on the
AS-Interface.
0183A4HThe AS-i slave address cannot be deleted.
0183A5HThe AS-i slave address cannot be set.
0183A6HThe AS-i slave address cannot be stored permanently.
0183A7HError reading the extended ID1 code.
0183A8HThe target address is not plausible (for example a B slave
address was used for a standard slave).
0183B1HA length error has occurred transferring a string according
to profile 7.4.
0183B2HA protocol error has occurred transferring a string
according to profile 7.4.
0183F8HThe job number or the job parameter is unknown.
0183F9HThe AS-i master has detected an EEPROM error.
018F22HArea length area reading a parameter
8F23HArea length error writing a parameter
This error code indicates that a parameter is entirely or
partly outside the address area or that the length of a bit
array of an ANY parameter cannot be divided by 8.
018F24HArea error reading a parameter
8F25HArea error writing a parameter
This error codes indicates that a parameter is located in an
area that is illegal for a system function.
018F28HAlignment error reading a parameter
8F29HAlignment error writing a parameter
This error code indicates that the reference to a parameter
is a bit address other than 0.
018F30HThe parameter is in the write-protected global DB
8F31HThe parameter is in the write-protected instance DB
This error code indicates that a parameter is located in a
write-protected data block.
018F32HThe DB number in the parameter is too high
018F3AHThe parameter contains the number of a DB that is not
loaded
018F42HAn access error has occurred while the system attempted
to read out a parameter from the peripheral area of the
inputs.
01 8F43HAn access error occurred while the system was attempting
to write a parameter to the peripheral area of the outputs
76
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 77
Using the Command Interface
Table 3-5Error Coding, continued
DONEMeaningSTATUSERROR
018F44HThis parameter code indicates that read access to a
parameter was denied
018F45HThis error code indicates that write access to a parameter
was denied
018F7FHInternal error
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
77
Page 78
Using the Command Interface
3.3Description of the AS-i Slave Commands
Overview
This section describes the command calls that can be sent by the DP master to
the DP/AS-i Link 20E. With these command calls, the DP/AS-i Link 20E provides
the complete functionality of the master profile M1e of the AS-i master
specification. In addition to this, the DP/AS-i Link 20E can be configured
completely by the DP master using command calls.
The use of the jobs is described in the individual descriptions of the jobs
themselves, in the PICS appendix and in the detailed explanations in /1/ and /2/.
The available commands are listed in the table below:
Table 3-6AS-i Slave Commands
Name
Set_Permanent_Parameter
–> described in Section 3.3.1
Get_Permanent_Parameter
–> described in Section 3.3.2
Write_Parameter
–> described in Section 3.3.3
Read_Parameter
–> described in Section 3.3.4
Store_Actual_Parameters
–> described in section 3.3.5
Set_Extended_Permanent_Configurati
on
–> described in section 3.3.6
Get_Extended_Permanent_Configurati
on
–> described in section 3.3.7
Store_Actual_Configuration
–> described in Section 3.3.8
Get_Extended_Actual_Configuration
–> described in section 3.3.9
Set_LPS
–> described in section 3.3.10
Set_Offline_Mode
–> described in section 3.3.11
Select_Autoprogramming
–> described in section 3.3.12
Set_operation_mode
–> described in section 3.3.13
ParameterReturnCoding
Slave address,
00
parameter
Slave addressParameter01
Slave address,
parameter
Parameter echo
(optional)
02
Slave addressParameter value03
04
Slave address 25
Slave address,
specified configuration 26
configuration
07
Slave addressactual configuration28
LPS29
Mode0A
Mode0B
Mode0C
H
H
H
H
H
H
H
H
H
H
H
H
H
78
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 79
Table 3-6AS-i Slave Commands, continued
NameCodingReturnParameter
Change_AS-i_Slave_Address
–> described in Section 3.3.14
Get_AS-i_Slave_Status
Address 1,
Address2
Slave addressError record of the AS-i
–> described in Section 3.3.15
Get_LPS, Get_LAS, Get_LDS,
NoneLDS, LAS, LPS, flags30
Get_Flags
–> described in section 3.3.16
Get_Extended_Total_Configuration
–> described in section 3.3.17
Store_Extended_Total_Configuration
–> described in section 3.3.18
Write_Extended_Parameter_List
Total
configuration
Parameter list3C
–> described in Section 3.3.19
Read_Extended_Parameter_Echo_List
–> described in section 3.3.20
Read_Version_ID
–> described in section 3.3.21
Read_AS-i_Slave_ID
Slave addressID*Code17
–> described in section 3.3.22
Read_AS-i_Slave_Extended_ID1
Slave addressExtended ID1 code37
–> described in section 3.3.23
Write_AS-i_Slave_Extended_ID1
–> described in section 3.3.24
Read_AS-i_Slave_Extended_ID2
Extended ID1
code
Slave addressExtended ID2 code38
–> described in section 3.3.25
Read_AS-i_Slave_I/O
Slave addressI/O configuration18
–> described in section 3.3.26
Get_LPF
–> described in section 3.3.27
Write_AS-i_Slave_Parameter_String
–> described in section 3.3.28
Read_AS-i_Slave_Parameter_String
Slave address,
parameter string
Slave addressParameter string41
–> described in section 3.3.29
Read_AS-i_Slave_ID_String
Slave addressID string42
–> described in section 3.3.30
Read_AS-i_Slave_Diagnostic_String
Slave addressDiagnostic string43
–> described in section 3.3.31
Using the Command Interface
0D
0F
slave
Actual configuration,
current parameters,
LAS, flags
Parameter echo list33
Versions*String14
LPF
39
3A
3F
3E
40
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
79
Page 80
Using the Command Interface
General Structure of the Send Buffer
The basic structure of the send buffer for commands is shown below. The bytes
only relevant with certain commands are shown on a gray background.
ByteMeaning
q+0Command number
q+1Job data
q+...Job data
q = start address of the send buffer on the DP master
General Structure of the Receive Buffer
The basic structure of the response buffer is shown below. The bytes only relevant
with certain commands are shown on a gray background.
ByteMeaning
n+0Response data
n+1Response data
n+...Response data
n = start address of the response buffer on the DP master
80
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 81
General Structure of the AS-i Slave Address
If an AS-i slave is addressed in a command or in a response, the address is
structured as shown below:
Bit 7Bit 6Bit 5 Bit 4Bit 0
S bitSlave address
Where the S(elect) bit for selecting the slave type is specified as follows:
SS bit = 0
Standard AS-i slave or AS-i slave with extended addressing mode in address
area A
SS bit = 1
AS-i slave with extended addressing mode in address area B
Using the Command Interface
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
81
Page 82
Using the Command Interface
3.3.1Set_Permanent_Parameter
Purpose
With this call, a parameter value for the specified AS-i slave is configured on the
DP/AS-i Link 20E. The value is stored permanently in the EEPROM of the
DP/AS-i Link 20E.
The configured parameter is not transferred immediately by the DP/AS-i Link 20E
to the AS-i slave. The configured parameter value is only transferred when the
AS-i slave is activated after turning on the power supply on the DP/AS-i Link 20E.
This call is not permitted for AS-i slaves that comply with the AS-i slave standard
profile 7.4. For these AS-i slaves, the AS-i master handles the AS-i slave
parameter assignment itself. In this case, the configured parameters are always
set to FH.
Note
If you use CPUs from the SIMATIC S7 system as the PROFIBUS DP master, then
dependent on the configuration in STEP 7, these may send a complete AS-i slave
configuration to the DP/AS-i Link 20E during the DP startup. Use of the call
described here is then generally unnecessary.
With this call, a slave-specific parameter value stored on the EEPROM of the
DP/AS-i Link 20E is read.
Structure of the Job Data in the Send Buffer
ByteMeaning
0Command number: 01
1Slave address
Using the Command Interface
H
Structure of the Response Data in the Receive Buffer
ByteMeaning
Bit 7Bit 4 Bit 3Bit 0
0reservedconfigured parameters
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
83
Page 84
Using the Command Interface
3.3.3Write_Parameter
Purpose of the Command
The AS-i slave parameter value transferred with the command is passed on to the
addressed AS-i slave.
The parameter is stored on the DP/AS-i Link 20E only temporarily and is not
entered as a configured parameter in the EEPROM!
The AS-i slave transfers its current parameter value in the response (parameter
echo). This can deviate from the value that has just been written according to the
AS-i master specification (/2/). The AS-i slave response is returned as a parameter
echo in the response data.
This call is not permitted for AS-i slaves that comply with the AS-i slave standard
profile 7.4. For these slaves, the AS-i master handles the AS-i slave parameter
assignment itself.
Structure of the Response Data in the Receive Buffer
ByteMeaning
Bit 7Bit 4 Bit 3Bit 0
0reservedParameter echo
H
84
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 85
3.3.4Read_Parameter
Purpose
This call returns the current parameter value (actual parameter) of an AS-i slave
sent by the DP/AS-i Link 20E.
This value must not be confused with the parameter echo that is supplied by the
AS-i slave as a response to the write_parameter job.
Structure of the Job Data in the Send Buffer
ByteMeaning
0Command number: 03
1Slave address
Using the Command Interface
H
Structure of the Response Data in the Receive Buffer
ByteMeaning
Bit 7Bit 4 Bit 3Bit 0
0reservedParameter
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
85
Page 86
Using the Command Interface
3.3.5Store_Actual_Parameters
Purpose
With this call, the configured parameters stored on the EEPROM are overwritten
with the current, permanently stored (actual) parameters; in other words, the
parameters of all the AS-i slaves are configured.
For AS-i slaves that comply with the AS-i slave standard profile 7.4, the AS-i
master manages the AS-i slave parameter assignment itself. The configured
parameters for these AS-i slaves always have the value FH.
Structure of the Job Data in the Send Buffer
ByteMeaning
0Command number: 04
H
86
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 87
3.3.6Set_Extended_Permanent_Configuration
Purpose
This call sets the following configuration data for the addressed AS-i slave.
The configuration data are stored permanently on the EEPROM of the
DP/AS-i Link 20E and are used as the expected configuration by the AS-i master
in the protected mode. The configuration data are specified by the manufacturer of
the AS-i slave. The meaning of the configuration data is described in /2/.
If the addressed AS-i slave does not support an extended ID code 1/2, the value
FH must be specified.
Using the Command Interface
When this command is executed, the AS-i master changes to the offline phase and
then changes back to the normal mode (warm restart on the AS-i master).
This call is not made in the protected mode.
Note
If you use CPUs from the SIMATIC S7 system as the PROFIBUS DP master, then
dependent on the configuration in STEP 7, these may send a complete AS-i slave
configuration to the DP/AS-i Link 20E during the DP startup. Use of the call
described here is then generally unnecessary.
With this call, the (actual) configuration data (I/O configuration, ID code, extended
ID1 code and extended ID2 code) of all AS-i slaves are stored permanently in the
EEPROM as the (expected) configuration data. The list of activated AS-i slaves
(LAS) is adopted in the list of permanent AS-i slaves (LPS).
When this command is executed, the AS-i master changes to the offline phase and
then changes back to the normal mode (warm restart on the AS-i master).
The call is not executed in the protected mode.
Note
If you use CPUs from the SIMATIC S7 system as the PROFIBUS DP master, then
dependent on the configuration in STEP 7, these may send a complete AS-i slave
configuration to the DP/AS-i Link 20E during the DP startup. Use of the call
described here is then generally unnecessary.
Using the Command Interface
Structure of the Job Data in the Send Buffer
ByteMeaning
0Command number: 07
H
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
89
Page 90
Using the Command Interface
3.3.9Get_Extended_Actual_Configuration
Purpose of the Command
With this call, the following configuration data of an addressed AS-i slave obtained
by the AS-i master on the AS-Interface are read.
With this call, the list of configured AS-i slaves is transferred for permanent storage
in the EEPROM of the master.
When this command is executed, the AS-i master changes to the offline phase and
then changes back to the normal mode (warm restart on the AS-i master).
The call is not executed in the protected mode.
Note
If you use CPUs from the SIMATIC S7 system as the PROFIBUS DP master, then
dependent on the configuration in STEP 7, these may send a complete AS-i slave
configuration to the DP/AS-i Link 20E during the DP startup. Use of the call
described here is then generally unnecessary.
The bits in the LPS data have the following meaning: 0: AS-I slave not configured
1: AS-I slave configured.
12B
Slave
20B
Slave
28B
H
Slave
13B
Slave
21B
Slave
29B
Slave
14B
Slave
22B
Slave
30B
Slave
15B
Slave
23B
Slave
31B
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
91
Page 92
Using the Command Interface
3.3.11Set_Offline_Mode
Purpose
This call switches between the online and offline mode.
The online mode is the normal operating situation for the AS-i master. Here, the
following jobs are processed cyclically:
SDuring the data exchange phase, the fields of the output data are transferred to
the slave outputs for all AS-i slaves in the LAS. The addressed AS-i slaves
transfer the values of the slave inputs to the master when the transfer was free
of errors.
SThis is followed by the inclusion phase in which there is a search for the existing
AS-i slaves and newly added AS-i slaves are entered in the LDS or LAS.
SIn the management phase, jobs from the user such as writing parameters are
executed.
In the offline mode, the DP/AS-i Link 20E only processes jobs from the user.
(Jobs that involve the immediate addressing of an AS-i slave are rejected with an
error.) There is no cyclic data exchange with the AS-i slaves.
The OFFLINE=TRUE bit is not permanently stored; in other words, following a
cold/warm restart, the DP/AS-i Link 20E is once again in the online mode.
Structure of the Job Data in the Send Buffer
ByteMeaning
Bit 7Bit 1Bit 0
0Command number: 0A
1reservedMode
H
(0=online
1=offline)
92
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 93
3.3.12Select Autoprogramming
Purpose
This call can enable or disable the “automatic address programming” function (see
also section 5.1).
The AUTO_ADDR_ENABLE bit is stored permanently; in other words, it is
retained after a warm/hot restart on the AS-i master.
Structure of the Job Data in the Send Buffer
ByteMeaning
Bit 7Bit 1Bit 0
0Command number: 0B
1reservedV alue for AUTO_ADDR_ENABLE
Using the Command Interface
H
1= Automatic address program-
ming enabled
0= Automatic address program-
ming disabled
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
93
Page 94
Using the Command Interface
3.3.13Set_Operation_Mode
Purpose of the Command
This call changes the module between the configuration mode and the protected
mode.
In the protected mode, only AS-i slaves are activated that are entered in the LPS
and whose expected and actual configurations match, in other words, when the I/O
configuration and ID codes of the detected AS-i slaves are identical to the
configured values.
In the configuration mode, all detected AS-i slaves (except for AS-i slave “0”) are
activated. This also applies to AS-i slaves in which there are differences between
the expected and actual configuration.
The “OPERATION MODE” bit is stored permanently; in other words, it is retained
following a cold/warm restart.
When you change from the configuration mode to the protected mode, there is a
warm restart on the AS-i master (change to the offline phase followed by a change
to the online mode).
Notice
If an AS-i slave with address 0 is entered in the LDS, the DP/AS-i Link 20E module cannot change from the configuration mode to the protected mode.
Structure of the Job Data in the Send Buffer
ByteMeaning
Bit 7Bit 1Bit 0
0Command number: 0C
1reservedOperating mode
H
0= Protected mode
1=Configuration mode
94
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 95
3.3.14Change_AS-i_Slave_Address
Purpose of the Command
With this call, the AS-i address of an AS-i slave can be modified.
This call is mainly used to add a new AS-i slave with the default address “0” to the
AS-Interface. In this case, the address is changed from “AS-i slave address old”=0
to AS-i slave address new”.
This change can only be made when the following conditions are fulfilled:
1. An AS-i slave with “AS-i slave address old” exists.
2. If the old AS-i slave address is not equal to 0, then an AS-i slave with address 0
cannot be connected at the same time.
3. The “AS-i slave address new” must have a valid value.
4. An AS-i slave with “AS-i slave address new” must not exist.
Using the Command Interface
Note: When the AS-I slave address is changed, the AS-i slave is not reset, in other
words, the output data of the AS-i slave are retained until new data are received at
the new address.
Structure of the Job Data in the Send Buffer
ByteMeaning
0Command number: 0D
1Slave address old
2Slave address new
H
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
95
Page 96
Using the Command Interface
3.3.15Get_AS-i_Slave_Status
Purpose
With this call, the status register of the addressed AS-i slave can be read out.
Depending on the type of AS-i slave, the flags of the status register have the
following meaning:
Status
Bit
S 0Address volatileAddress/ID code volatile
AS-i slave complying with standard 2.0AS-i slave complying with standard
2.1
This flag is set when
Sthe internal slave routine for permanent storage of the AS-i slave address is
active. This can take up to 15 ms and must not be interrupted by a further
addressing call.
Sthe AS-i internal slave address comparison recognizes that the stored
address is not the same as the entry in the address register.
S 1Parity error detected
This flag is set when the AS-i slave has
recognized a parity error in a received
frame since the last “read and delete
status” job.
S 2End bit error detected
This flag is set when the AS-i slave has
recognized an end bit error in a frame
since the last “read and delete status” job.
S 3Read error in non-volatile memory
This bit is set when the AS-i slave has detected a read error when reading the
non-volatile memory.
I/O error detected
An AS-i slave can set this flag
when it has detected and error (for
example wire break) in the attached
I/Os.
reserved
Structure of the Job Data in the Send Buffer
ByteMeaning
0Command number: 0F
1Slave address
Structure of the Response Data in the Receive Buffer
ByteMeaning
Bit 7Bit 4 Bit 3Bit 2Bit 1Bit 0
00S 3S 2S 1S 0
96
H
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
Page 97
3.3.16Get_LPS, Get_LAS, Get_LDS, Get_Flags
Purpose
With this call, the following entries are read out of the DP/AS-i Link 20E:
SThe list of active AS-i slaves (LAS)
SThe list of detected AS-i slaves (LDS)
SThe list of permanent AS-i slaves (LPS)
Sthe flags according to the AS-i slave specification
Structure of the Job Data in the Send Buffer
ByteMeaning
0Command number: 30
Using the Command Interface
H
Structure of the Response Data in the Receive Buffer
OFFLINE_READYThe flag is set when the offline phase is active.
APFThis flag is set when the voltage on the AS-i cable is too low.
NORMAL_MODEThis flag is set when the DP/AS-i Link 20E is in the normal mode.
(The flag is set when the CP is in the normal mode.)
CONFIG_MODEThe flag is set in the configuration mode and reset in the protected mode.
AUTO_ADDR_AVAILThis flag is set when the automatic address programming can be executed
(in other words, exactly one AS-i slave is currently out of operation).
AUTO_ADDR_ASSIGNThis flag is set when the automatic address programming is possible (in
other words, AUTO_ADDR_ENABLE = 1 and there is no “incorrect” slave
connected to the AS-i Interface).
LDS_0This flag is set when an AS-i slave exists with address 0.
CONFIG_OKThis flag is set when the desired (configured) and actual configuration
match.
OFFLINEThis flag is set when the mode is to changed to OFFLINE or this mode has
already been adopted.
EEPROM_OKThis flag is set when the test of the internal EEPROM did not detect any
errors.
AUTO_ADDR_ENABLEThis flag indicates whether the automatic address programming is enabled
(BIT = 1) or disabled (BIT = 0) by the user.
INTERNALThis flag is always set.
PERIPHERY_FAULTThis flag is set when at least one AS-i slave is signaling a peripheral fault.
MPO startupThe “master_power_on_startup” flag is set after the power supply of the
AS-i slave master has been turned on. If the master is later
changed to OFFLINE, the bit is reset.
DP/AS-Interface Link 20E
Release 11/2002
C79000-G8976-C138–04
99
Page 100
Using the Command Interface
3.3.17Get_Extended_Total_Configuration
Purpose
This command reads the following data from the DP/AS-i Link 20E:
SThe list of active AS-i slaves (LAS) This indicates which of the connected AS-i
slaves are activated.
SThe current configuration data of the connected AS-i slaves (I/O configuration
and ID code).
SThe current parameters of the AS-i slaves (actual parameters)
SThe current flags.
This command can, for example, be used to find out the configuration of the
stations connected to the AS-i cable after installation. The configuration data read
in can, if necessary, be modified and saved on the DP/AS-i Link 20E as the
expected configuration using the command ‘Configure Total System’ (see Section
3.3.18).
Structure of the Job Data in the Send Buffer
ByteMeaning
0Command number: 39
H
Structure of the Response Data in the Receive Buffer