Transcript Profibus DP

Siemens Step 7 Project with Controllere in 7 Steps: Step 1
 click on the project
assistant to create a
new project
 select the correct CPU
 finish the assistant
© ifm electronic gmbh
Stand: 16.07.2015
Seite 1
Siemens Step 7 Project with Controllere in 7 Steps: Step 2
 select Hardware
configuration in
SIMATIC Station
 double click on insert
DPMaster
 Define a DP line by
clicking on New
 close all windows by
clicking on OK
© ifm electronic gmbh
Stand: 16.07.2015
Seite 2
Siemens Step 7 Project with Controllere in 7 Steps: Step 3
 select Profibus DP in
hardware config., then
aditional field devices,
gateways and ASi-DPController e
 drag the device with
the mouse to the
profibus line and drop
it there
 Define a DP address
© ifm electronic gmbh
Stand: 16.07.2015
Seite 3
Siemens Step 7 Project with Controllere in 7 Steps: Step 4
 drag modules to
the module list:
modules starting
with 1
in the first line,
with 2
in the
second...
© ifm electronic gmbh
Stand: 16.07.2015
Seite 4
Profibus DP
Gateway Digital I/O´s ( module 1-4 )
 The same structure of data for modules 1..4
Byte No. Bit 7..4
Bit 3..0
0
Status Nibble
Slave 1
1
Slave 2
Slave 3
:
:
:
14
Slave 28
Slave 29
15
Slave 30
Slave 31
© ifm electronic gmbh
Stand: 16.07.2015
Seite 5
Profibus DP
Multiplexed Analog Data (module 5+6)
15 14 13 12 11 10 9
2 words
per module:
Master
No
8
7
6
5
4
3
2
1
0
A
or
B
Slave Address
Channel
Value (16 bit)
Example: to read channel 2 of slave 17 / master 1, write to module 5:
0101 0001 0000 0010 to first word ( 16#5102 )
response in module 5 (2 words): 16#5142, 16#<analog input value>
(the „4“ [bit 6 in byte 2] indicates valid value)
to write „1024“ channel 1 of slave 18 / master 1, write to module 6:
16#5201 , 16#0400 (=1024)
response in module 6: 16#5201 , 16#0400
© ifm electronic gmbh
Stand: 16.07.2015
Seite 6
From
ControllerE
to PLC
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
0
0
1
0
0
0
0
0
0
1
0
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
0
1
0
valid
From PLC to
ControllerE:
PLC reads analog multiplexed input (module 5)
0
0
0
1
0
1
1
0
0
1
1
0
0
0
0
0
valid
Profibus DP
0
analog input value
© ifm electronic gmbh
Stand: 16.07.2015
Seite 7
Profibus DP
From PLC to
ControllerE:
PLC writes analog multiplexed output (module 6)
15 14 13 12 11 10 9
8
0
0 0
1 0
1 0
0 1
7
6
5
0 0
4
3
0 0
2
1
0
0 0
0
analog output value (M1, slave 18, chan0)
From
ControllerE
to PLC
15 14 13 12 11 10 9
8
0
0 0
1 0
1 0
0 1
7
6
5
0 0
4
3
0 0
2
1
0
0 0
0
echo of analog output value (M1, slave 18, chan0)
© ifm electronic gmbh
Stand: 16.07.2015
Seite 8
Profibus DP
Command Channel (module 7)
 Target slave is addressed like analog multiplex slave :
If not ok, bit 7 of command byte
is set. Byte 3 contains error code.
© ifm electronic gmbh
7
6
1
error
 response:
if execution was ok, byte 1 and
byte 2 are reflected and
byte 3 (4) contains result or
reflected command parameter
Byte
2
Master
No
5
4
3
2
1
0
Command
A
or
B
Slave Address
3
command parameter 1
4
command parameter 2
Stand: 16.07.2015
Seite 9
Siemens Step 7 Project with Controllere in 7 Steps: Step 5
 switch the PLC in RUNP mode
 store the configuration
 download the configuration to the PLC
 run the project in the
PLC; it may be
necessary to reset the
PLC by setting the
switch to stop and run
again
 an error is signallized
by a red sign
 refresh the screen with
F5
© ifm electronic gmbh
Stand: 16.07.2015
Seite 10
Siemens Step 7 Project with Controllere in 7 Steps: Step 6
 setup of parameters is
only possible in offline
mode
 double click on slave
opens properties where
you have to select
parameters
 values can be changed
by a double click on
the parameter
 the pop up window
shows the options of
the particular
parameter
 enable extended
profibus diagnostics,
download it and reset
the ControllerE
© ifm electronic gmbh
Stand: 16.07.2015
Seite 11
Profibus DP
Profibus Setup (Parameter)
Profibus parameters can be set up at configuration
of Profibus master. At „Power On“ they are
transmitted to controllerE.
The parameters are used to
 enable the transfer of AS-i paramter to the slaves
 project those AS-i parameters
 enable extended Profibus diagnostic functions
 configure the analog data area for parallel transmission
In most cases the parameters can be selected via a menu. The
meaning of the parameters is indicated there.
© ifm electronic gmbh
Stand: 16.07.2015
Seite 12
Profibus DP
Device Parameter (manual setup)
 Byte 1..4
 Byte 5:
 Byte 6..20




: 16#80, 16#00, 16#00, 16#00
(fixed)
: 16# AE (fixed) indicates begin of analog input area
: 16#41, 16#42, 16#43.. Define first, second, third...
Address of slave to be transmitted in module 10
Format of Address as with module 5,6,7,8
16#4A means Slave 10 of master 1
Byte 21
: 16#AA (fixed) begin of analog output area
Byte 22..36 : 16#51, 16#52, ...
Address of slave to be transmitted in module 11
Byte 37
: Bit 5 = 1 enables extended diagnostics of AS-i via
Profibus
Bit 4 = 1 enables parameter download
Bit 0..3 predefined parameter for Slave 1 Master 1
Byte 37..100 : predefined parameters for AS-i Slaves (2 slaves per byte)
© ifm electronic gmbh
Stand: 16.07.2015
Seite 13
Siemens Step 7 Project with Controllere in 7 Steps: Step 7
 if extended
diagnostics are
enabled in the
profibus parameters
AS-i diagnostics are
shown in online mode
 open the device
information window
with a double click on
the slave icon
 in the slave
diagnostics you can
see text messages
explaining the error
state of the AS-i line
© ifm electronic gmbh
Stand: 16.07.2015
Seite 14
Profibus DP
Diagnostics
 The first byte of module 1 and of module 2 contains general
master flags of master 1 and master 2
BIT7
CTRL run
BIT6
BIT5
BIT4
BIT3
Slave 1 DI3
BIT2
Slave 1 DI2
BIT1
Slave 1 DI1
BIT0
Slave 1 DI0
 To get details the command channel can be used.
 The AS-i diagnostics via extended Profibus Diagnostics in an
acyclic data service. It can be enabled by Profibus parameters
BIT7
BIT6
BIT5
BIT4
BIT3
enable Diag enable ASi Parameter
Slave1 P3
BIT2
Slave1 P2
BIT1
Slave1 P1
BIT0
Slave1 P0
 The Profibus parameter byte 32 enables diagnostcs and AS-i parameters and
contains the AS-i parameter for slave 1(A) of master 1
 The default value is 16#0F
© ifm electronic gmbh
Stand: 16.07.2015
Seite 15
Profibus DP
Diagnostics
 62 Bytes Diagnostics = 6 byte standard + 56 bytes extended
Byte
0
1
2
3
4
5
6
7
8
9
10, 11
12..19
20..27
28..35
36, 37
38..45
46..53
54..61
Inhalt
station status 1
station status 2
station status 3
station number DP master
manufacturer ID (high byte) 0x04
manufacturer ID (low byte ) 0x0D
length of external diagnosis (0x3A)
Status Type: status manufacturer specific
Slotnumber (0x04)
0
master flags
LDS: list of detected slaves
Config Error
LPF: list of periphery faults
master flags
LDS: list of detected slaves
Config Error
LPF: list of periphery faults
© ifm electronic gmbh
Stand: 16.07.2015
standard
diagnostic
Header of
extended
diagnostic
Diagnostic
AS-i Master 1
A and B-slaves
Diagnostic
AS-i Master 2
A and B-slaves
Seite 16
Profibus DP
extended Diagnostics
 LAS (List of activated slaves),LCE (List of configuration errors)
and LPF (List of periphery faults) have the same structure
Byte20
Byte21
Byte22
Byte23
Byte24
Byte25
Byte26
Byte27
BIT7
BIT6
BIT5
BIT4
BIT3
BIT2
BIT1
Slave
Slave
Slave
Slave
Slave
Slave
Slave
7(A)
6(A)
5(A)
4(A)
3(A)
2(A)
1(A)
Slave
Slave
Slave
Slave
Slave
Slave
Slave
15(A)
14(A)
13(A)
12(A)
11(A)
10(A)
9(A)
Slave
Slave
Slave
Slave
Slave
Slave
Slave
23(A)
22(A)
21(A)
20(A)
19(A)
18(A)
17(A)
Slave
Slave
Slave
Slave
Slave
Slave
Slave
31(A)
30(A)
29(A)
28(A)
27(A)
26(A)
25(A)
Slave 7B Slave 6B Slave 5B Slave 4B Slave 3B Slave 2B Slave 1B
Slave
31B
Slave
31B
Slave
31B
Slave
30B
Slave
30B
Slave
30B
Slave
29B
Slave
29B
Slave
29B
Slave
28B
Slave
28B
Slave
28B
Slave
27B
Slave
27B
Slave
27B
Slave
26B
Slave
26B
Slave
26B
Slave
25B
Slave
25B
Slave
25B
BIT0
Slave 0
Slave
8(A)
Slave
16(A)
Slave
24(A)
res.
Slave
24B
Slave
24B
Slave
24B
CErr Master1
Slave 0..7
CErr Master1
Slave 8..15
CErr Master1
Slave 16..23
CErr Master1
Slave 24..31
CErr Master1
Slave 1B..7B
CErr Master1
Slave 24B..31B
CErr Master1
Slave 24B..31B
CErr Master1
Slave 24B..31B
 example: List of configration errors
© ifm electronic gmbh
Stand: 16.07.2015
Seite 17
Profibus DP
extended Diagnostics
 The diagnostic data are transmitted from ControllerE to the DPMaster if a new error occures or one error disappers
 An AS-i error does not stop the application on DP-Master
 The diagnostics for every slave can be
 displayed at DP-master
 handled by PLC program
© ifm electronic gmbh
Stand: 16.07.2015
Seite 18