PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 1 of 13
PROFIBUS DP – Telegrams
Telegram Frame Format:
SD LE LEr SDr DA SA FC DSAP SSAP PDU… FCS ED
SD: Start Delimiter
LE: Net Data Length = (DA+SA+FC+DSAP+SSAP+Len[PDU]) ≤ 249
(Protocol Data Unit [PDU] Length ≤ 244)
DA: Destination Address
SA: Source Address
FC: Function Code
DSAP: Destination Service Access Point
SSAP: Source Service Access Point
FCS: Frame Check Sequence
ED: End Delimiter, ED = 16 (22)
Function Code Byte:
0 b6 b5 b4 fc fc fc fc
DPV0 Master/Master and Master/Slave Interactions:
Slave
Get Master Diagnostics, Upload
Class 1
Master
Class 2
Master
Data Exchange, Slave Diagnostics,
Set Parameters, Check Configuration,
Global Control
Data Exchange, Read Inputs,
Read Outputs, Slave Diagnostics,
Set Parameters, Check Configuration,
Get Configuration, Global Control
Set Slave Address
Download, Activate Bus Parameters,
Broadcast, Activate/Deactivate Slave,
Change Master Mode, Start/End Sequence
Address encoding:
XYYY YYYY
Service Access Points:
Service Master SAP Slave SAP
Data Exchange None None
Set Slave Address 3E (62) 37 (55)
Read Inputs 3E (62) 38 (56)
Read Outputs 3E (62) 39 (57)
Global Control 3E (62) 3A (58)
Get Configuration 3E (62) 3B (59)
Slave Diagnostics 3E (62) 3C (60)
Set Parameters 3E (62) 3D (61)
Check Configuration 3E (62) 3E (62)
DPV0 Master to Master functions 36 (54) 36 (54)
DPV1 Master class 1 functions 33 (51) 33 (51) or 32 (50)
DPV1 Resource Manager 32 (50) 31 (49)
DPV1 Master class 2 32 (50) 0 (0) … 30 (48)
SD1 = 10 (16) - Telegrams of fixed length without a data field (eg Request_FDL_Status – look for new masters)
SD2 = 68 (104) - Telegrams with a variable length data field (SRD service)
SD3 = A2 (162) - Telegrams of fixed length with a constant-length data field (Data field is always 8 bytes)
SD4 = DC (220) - Token pass telegram
SC = E5 (229) - Short Acknowledgement telegram (Only one byte transmitted)
Always 0
1=Rqst, 0=Resp
Rqst: b5=frame count bit (alternates 0/1), b4=frame count valid
Resp: Station type (00=Slave, 01=Master not ready to enter token ring,
10= Master ready to enter token ring, 11= Master in token ring)
fc Request function (b6=1) Response function (b6=0)
0 ---- Ack positive (OK)
1 ---- Ack negative, user error (UE)
2 ---- Ack negative, no resource for response (RR)
3 SDA low (FMS only) Ack negative, SAP not activated (RS)
4 SDN low (Broadcast and multicast telegrams) ----
5 SDA high (FMS only) ----
6 SDN high (Broadcast and multicast telegrams) ----
7 ---- ----
8 ---- Low priority response to SRD (DL)
9 Request FDL status with reply Ack negative, no response (NR)
A (10) ---- High priority response to SRD (DH)
B (11) ---- ----
C (12) SRD low (Send and request data) Negative response to SRD, no resource (RDL)
D (13) SRD high (Send and request data) Negative response to SRD, no resource (RDH)
E (14) Request ID with reply ----
F (15) Request LSAP status with reply ----
Note all values shown on this page as: hex (dec)
X = Extended Addressing used (SAPs)
YYY YYYY = station address (7 bits)
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 2 of 13
Master/Slave startup sequence DP Slave state machine
Set slave address (from a class II master) can only be performed
before parameterisation (while slave is in wait PARAM state).
Master sends diagnostic request to check if slave is available.
Slave responds to diagnostic request.
Master sends a set parameters telegram
Slave responds with short acknowledgement (E5h)
Slave checks parameterisation and indicates ok or not ok to ASIC
Master sends check configuration telegram
Slave responds with short acknowledgement (E5h)
Slave checks configuration and indicates ok or not ok to ASIC
Master sends diagnostic request(s) to check for slave acceptance of
parameters and configuration and determine when slave is ready to
enter data exchange
Slave responds with diagnostic information
Master and slave enter data exchange mode
Bus Timing
Token Timing:
TTR = Target Rotation Time,
TTH = TTR – TRR; TTH = Token Hold Time,
TRR = Time between that master last releasing the
token and receiving it again.
Tbit = 1/bit rate.
Estimated Bus Cycle Time, TMC ≈ (380 + 300*S + 11*D)*Tbit + 75µs
Where S = Number of Slaves and D = Total number of bytes of I/O data
Parameterisation error
Parameterisation ok
Configuration error
Configuration ok
Watchdog timeout
Unlock, Config error,
Param error, Output
data length mismatch
Power on/
reset
Wait
PARAM
Wait
CONFIG
Data
Exchange
min TSDR
Previous slave response
Slave response
Master request
TID1
TSDR
max TSDR
Next master request
TTelegram + TTD
TID1
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 3 of 13
Set Parameterisation The Set_PRM.Req telegram from the master to the slave contains communication parameters, expected functions, device related parameters and Identification
Number. The Slave has to check whether the requested parameters and functions are allowed/supported or not.
Set_PRM.req: Entire transferred Request Telegram (Master Æ Slave):
SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED
68hex xx xx xx xx xx xx 3Dhex 3Ehex xx xx … xx 16hex
Entire transferred Response Telegram (Slave Æ Master):
E5hex Only one byte response, short character (SC)
Parameterisation Data Unit (DU) minimum 7bytes, but can contain up to 244 bytes
Description for the 7 mandatory parameter bytes (according to the PROFIBUS DP Standard):
Byte(Octet) 1: Byte (Octet) 2: Byte (Octet) 3: Byte (Octet) 4: Byte (Octet) 5: Byte (Octet) 6: Byte (Octet) 7: Byte (Octet) 8:
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Extended Parameters
0 0 0 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) x x x x x x x x Device and module related
x (DPV1 Status bytes, see p8)
x
x
x Watchdog Factor 1 Watchdog Factor 2 Min. station response PROFIBUS ID No. PROFIBUS ID No. Group assignment
x (WD1) (WD2) time ( TSDR) (MSB) (LSB)
LOCK
flag
(1=
Master
locks
slave
for
other
masters)
UNLOCK
flag
(1=
Master
unlocks
slave
for
other
masters)
Slave
is
to
support
SYNC
mode
(1=
Yes)
Slave
is
to
support
FREEZE
mode
(1=
Yes)
Watchdog
ON/OFF
(1=
ON)
Can
be
selected
by
the
user
Reserved
(must
be
0)
Reserved
(must
be
0)
Reserved
(must
be
0)
Watchdog time = WD1* WD2 * 10ms In a regular
PROFIBUS DP
system, the minimum
station delay
response time is 11
Tbit = 0Bhex
(1Tbit = Bit time for
1Bit)
Each bit represents a
group, therefore the
slave can be assigned
for one or multiple
groups.
The group assignment is
only relevant for the
global control functions
(SYNC, FREEZE…etc.)
First 7 bytes are mandatory for every Slave Device and module related Parameter Data (optional)
1……………………………………………………….. 7 8 ……………………………………………………………………………244
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 4 of 13
Check Configuration The purpose of the check configuration telegram is to compare the configured I/O (master system) with the real I/O of the slave. The slave will execute the compaison
and check the configuration whether it is valid or not.
Check_CFG.Req: Entire transferred Request Telegram (Master Æ Slave):
SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED
68hex xx xx xx xx xx xx 3Ehex 3Ehex xx xx … xx 16hex
Entire transferred Response Telegram (Slave Æ Master):
E5hex Only one byte response, short character (SC)
Configuration Data Unit (DU) can contain up to 244 bytes
Config Identifier ID 0 (mandatory) ID1 , ID2 , ID3 …………………………………. (optional)
The Data Unit of the check configuration telegram contains the desired I/O configuration. The configuration Identifier (ID) defines the number of inputs, outputs , the data type (byte/word) and the data consistency of
a data block (module). The Data Unit has to contain at least one ID.
With PROFIBUS we distinguish between normal and special configuration ID format.
Normal (compact) ID format (one byte)
Byte (octet) 1: 7 6 5 4 3 2 1 0 Bit
0 1 ID defines only Input configuration
1 0 ID defines only Output configuration
1 1 ID defines Input and Output configuration
0 0 Special ID format (use decoding table for special format)
00 - 15DEC
(0 - FHEX)
Number of configured data (inputs/outputs):
00dec (0hex) = 1 Unit (Byte/Word)
15dec (Fhex) = 16 Units (Byte/Word)
1 Unit = Word
0 Unit = Byte
1 Consistency over the whole configured data block (Module)
0 Consistency over one Unit (Byte/ Word)
Special (extended) ID format
Structure for one special configuration ID
Special Previous ID ID Header Length OUTP. Length INPUT Vendor spec. Data next ID
Configuration ID x x 0 0 x x x x only if outputs only if inputs (optional)
Decoding table for special format
Byte (octet) 1: 7 6 5 4 3 2 1 0 Bit
Configuration ID 0 0 Special ID format (use decoding table for special format)
header 00 - 15DEC
(0 - FHEX)
Number of vendor specific config ID data at the end
00dec (0hex) = no vendor specific data
14dec (Ehex) = 14 vendor specific data
15dec (Fhex) = no vendor specific data
0 0 Empty module, module has no input or output configuration
0 1 One length byte for Inputs follows
1 0 One length byte for Outputs follows
1 1 One length byte for each Outputs and Inputs follows
following Byte(s) 7 6 5 4 3 2 1 0 Bit
one length byte for 00 - 63DEC Number of configured data (inputs/outputs):
outputs followed by (00 - 3FHEX) 00dec (0hex) = 1 Unit (Byte/Word)
the length byte for 63dec (3Fhex) = 64 Unit (Byte/Word)
inputs, if both are 1 Unit = Word
defined. 0 Unit = Byte
1 Consistency over the whole configured data block (Module)
0 Consistency over one Unit (Byte/ Word)
following Byte(s) 7 6 5 4 3 2 1 0 Bit
Vendor spec. data 00 - 255DEC (00 –FFHEX) Vendor specific config ID, defined by the device vendor
(or DPV1 data types, see page 9)
1………………………………………………………………. ……………………………………………………………………………244
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 5 of 13
Diagnostic Response The purpose of the DIAG_res is to inform the master about the slave status and whether the slave accepted the parameter and configuration data from the
master or a parameterisation and configuration is still required.
Diag.req: Entire transferred Request Telegram (Master Æ Slave): Has no Data Unit (DU)
SD LE LEr SDr DA SA FC DSAP SSAP FCS ED
68hex xx xx xx xx xx xx 3Chex 3Ehex xx 16hex
Diag.res: Entire transferred Response Telegram (Slave Æ Master):
SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED
68hex xx xx xx xx xx xx 3Ehex 3Chex xx xx … xx 16hex
Diagnostic Data Unit (DU) min. 6bytes, but can contain up to 244 bytes
First 6 bytes are mandatory for every Slave
(mandatory)
device related Diag block
(optional)
Identifier-module related Diag block
(optional)
Channel related Diag block(s)
(optional)
Description for the fist 6 bytes Standard Diagnostic (mandatory)
Byte(Octet) 1: Byte (Octet) 2: Byte (Octet) 3: Byte (Octet) 4: Byte (Octet) 5: Byte (Octet) 6: Byte (Octet) 7-244:
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Extended Diag_Data (optional)
M X 0 0 0 0 0 0 0 0-125DEC (0-7DHEX) 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX)
x X x ⎢ Device related Diag Block
x 1 ⎢ Identifier related Diag Block
x X ⎢ Channel related Diag Block(s)
x X Master station address PROFIBUS ID No. PROFIBUS ID No.
M X (MSB) (LSB) (decoding see next page)
X 0 0-125DEC (0-7DHEX) :
M M Address of controlling
Slave
is
locked/controlled
from
another
Master
(set
by
Master)
Prm_Fault:
Slave
did
not
accept
last
parameter
data
Invalid
Slave
Response
(set
by
master)
Slave
does
not
support
requested
parameter
function
Slave
has
extended
Diag
data
to
report
an
error
Config_Fault:
slave
did
not
accept
last
config
data
Station
not
ready
for
Data_exchange
Station
not
existent
(Set
by
master
if
slave
does
not
respond)
Slave
is
deactivated
in
master
parameter
set
(set
by
master)
Reserved
Slave
is
in
SYNC
mode
(1=
ON
;
0=OFF)
Slave
is
in
FREEZE
mode
(1=
ON
;
0=OFF)
Response
monitoring/
Watchdog
ON
(1=ON
;
0=OFF)
Always
set
to
1
Static
diagnostic:
Master
requesting
diag
until
bit
is
reset
Slave
must
be
parameterised
Diag
overflow:
Has
more
diag
data
as
it
can
report
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Master
255DEC (FFHEX)
Slave is not controlled
or parameterised by
any Master
Real slave Identification number issued by
PROFIBUS International
1………………………………………………………………6 7……………………………………………………………………………………………………………………………………………....…244
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 6 of 13
Extended Diagnostic Data The extended Diag data are additional diagnostic information beside the 6 mandatory bytes. 3 different kind of ext. diag are possible ‘device
related’ ‘identifier related’ and ‘channel related’. The device vendor defines the order or existence of the extended Diag blocks.
Extended Diagnostic Data
First 6 bytes are mandatory for every Slave
(mandatory)
device related Diag block
(optional)
Identifier-module related Diag block
(optional)
Channel related Diag block(s)
(optional)
Header byte Device related diag. data bytes Header byte Identifier (module) related diag. data bytes Header byte Channel related diag. data
0 0 x x x x x x 1 - 62 bytes 0 1 x x x x x x 1 – 62 bytes 1 0 x x x x x x always 2 bytes (3 bytes incl. header)
Header Byte (device related Diag)
7 6 5 4 3 2 1 0 Bit
0 0 Header Byte device related Diag
2 – 63DEC Length of Diag. block incl. Header:
02HEX = 2 bytes
3FHEX = 63 bytes
Following device related diag. data bytes
7 6 5 4 3 2 1 0 Bit
Vendor determines
the meaning of the bits,
bit area or bytes
Device related diag. data bytes
(or DPV1 alarm/status see page 10)
Header Byte (identifier related Diag)
7 6 5 4 3 2 1 0 Bit
0 1 Header Byte identifier related Diag
2 – 63DEC Length of Diag. block incl. Header:
02HEX = 2 bytes
3FHEX = 63 bytes
Following identifier related diag. data bytes
7 6 5 4 3 2 1 0 Bit
X Identifier Byte 0 (Mod. 1) has Diag
X Identifier Byte 1 (Mod. 2) has Diag
X Identifier Byte 2 (Mod. 3) has Diag
X Identifier Byte 3 (Mod. 4) has Diag
X Identifier Byte 4 (Mod. 5) has Diag
X Identifier Byte 5 (Mod. 6) has Diag
X Identifier Byte 6 (Mod. 7) has Diag
X Identifier Byte 7 (Mod. 8) has Diag
…Next Bytes (only necessary if device has more than
8 Modules)….
7 6 5 4 3 2 1 0 Bit
X Identifier Byte 8 (Mod. 9) has Diag
…….
X Identifier Byte 15 (Mod.16) has Diag
7 6 5 4 3 2 1 0 Bit
X Identifier Byte 16 (Mod.17) has Diag
…….
X Identifier Byte 23 (Mod.24) has Diag
7 6 5 4 3 2 1 0 Bit
X Identifier Byte 24 (Mod.25) has Diag
…….
X Identifier Byte 31 (Mod.32) has Diag
………..
………..
Header Byte (channel related Diag)
7 6 5 4 3 2 1 0 Bit
1 0 Header Byte channel related Diag
0 – 63DEC Reporting Identifier (Module) number
e.g.
00HEX = Identifier Byte 0 (Mod. 1) has Diag
3FHEX = Identifier Byte 63 (Mod. 64) has Diag
Byte 2 : (channel related Diag)
7 6 5 4 3 2 1 0 Bit
0 – 63DEC Reporting Channel number
0 1 Channel type: Input
1 0 Channel type: Output
1 1 Channel type: Input & Output
Byte 3 : (channel related Diag)
7 6 5 4 3 2 1 0 Bit
0 0 1 Channel type: Bit
0 1 0 Channel type: 2 Bits
0 1 1 Channel type: 4 Bits
1 0 0 Channel type: Byte
1 0 1 Channel type: Word
1 1 0 Channel type: 2 Words
1DEC
2DEC
3 DEC
4 DEC
5 DEC
6 DEC
7 DEC
8 DEC
9 DEC
10-15 DEC
16-31 DEC
Error type: Short Circuit
Error type: Under Voltage
Error type: Over Voltage
Error type: Overload
Error type: Over Temperature
Error type: Wire Break
Error type: Upper Limit Exceeded
Error type: Lower Limit Exceeded
Error type: Error (General)
Error type: Reserved
Error type: Device Related
1………………………………………………………………6 7……………………………………………………………………………………………………………………………………………....…244
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 7 of 13
Global Control The global control telegram is broadcast (all slaves) or multicast telegram (group of slaves) in order to activate or deactivate certain functions for those slaves
simultaneous e.g. CLEAR, SYNC, FREEZE …etc. The telegram is the only PROFIBUS telegram with no response to prevent conflicts.
Global_Ctrl request: Entire transferred Request Telegram (Master Æ Slave):
SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED
68hex xx xx xx xx xx xx 3Ahex 3Ehex Always 2 bytes xx 16hex
No response Telegram
Description of the Data unit (DU) Global Control
Byte 1: Byte 2:
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0 0 0 X X X X X X X X
X
X Group Number
X Each bit represents a
X Group, multiple groups
X are possible.
Reserved
Reserved
Activates
SYNC
(freezes
output
data
of
the
slaves)
Activates
UNSYNC
(deactivates
SYNC)
Activates
FREEZE
(freezes
input
data
of
the
slaves)
Activates
UNFREEZE
(deactivates
FREEZE)
Activates
CLEAR
(clears
the
output
data
of
the
slaves
Reserved
The command
influences only slave
that belong to the group.
(group assignment see
Parameter telegram)
00Hex : That command
influences all slaves
no matter whether they
are assigned to a
group or not
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 8 of 13
DPV1 Extended Parameterisation Telegram
Set_PRM.req: Entire transferred Request Telegram (Master Æ Slave):
SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED
68hex xx xx xx xx xx xx 3Dhex 3Ehex xx xx … xx 16hex
Entire transferred Response Telegram (Slave Æ Master):
E5hex Only one byte response, short character (SC)
Parameterisation Data Unit (DU) minimum 7bytes, but can contain up to 244 bytes
Byte(Octet) 8: Byte (Octet) 9: Byte (Octet) 10: Byte (Octet) 11-244:
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0 x x
0 0 x
x x x
0 x x
0 x x
x x 0
x x 0
x x 0
DPV1_Enable
(0
=
Disable,
1
=
Enable)
Fail_Safe
mode
(0
=
No,
1
=
Yes),
DPV2
only
Publisher,
DPV2
only
Reserved
Reserved
WD_Base_1ms
(0
=
10ms,
1
=
1ms)
Reserved
Reserved
Enable_Pull_Plug_Alarm
Enable_Process_Alarm
Enable_Diagnostic_Alarm
Enable_Manufacturer_Specific
_Alarm
Enable_Status_Alarm
Enable_Update_Alarm
Reserved
Configuration_Check_Mode
(0=Standard,
1=
Vendor
Specific
)
Reserved
Reserved
Reserved
IsoM,
DPV2
only
Prm_Struc,
DPV2
only
Alarm
mode
(Maximum
Number
of
Active
alarms
of
each
type
0
=
1
Alarm,
1
=
2
Alarms,
2
=
4
Alarm,
3
=
8
Alarms,
4
=
12
Alarms
5
=
16
Alarms,
6
=
24
Alarm,
7
=
32
Alarms
First 7 bytes are mandatory for every Slave Device and module related Parameter Data (optional)
1……………………………………………………….. 7 8 …………………………10 11……………….…………………………………………………………244
DPV1_Status (3 bytes)
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 9 of 13
DPV1 Extended Configuration Telegram
DPV1 uses the vendor specific configuration data in the special format specifier to give additional information on the data types that are being transferred
Special (extended) ID format
Structure for one special configuration ID
Special Previous ID ID Header Length OUTP. Length INPUT Vendor spec. Data next ID
Configuration ID x x 0 0 x x x x only if outputs only if inputs (optional)
Decoding table for special format
Byte (octet) 1: 7 6 5 4 3 2 1 0 Bit
Configuration ID 0 0 Special ID format (use decoding table for special format)
header 00 - 15DEC
(0 - FHEX)
Number of vendor specific config ID data at the end
00dec (0hex) = no vendor specific data
14dec (Ehex) = 14 vendor specific data
15dec (Fhex) = no vendor specific data
0 0 Empty module, module has no input or output configuration
0 1 One length byte for Inputs follows
1 0 One length byte for Outputs follows
1 1 One length byte for each Outputs and Inputs follows
following Byte(s) 7 6 5 4 3 2 1 0 Bit
one length byte for 00 - 63DEC Number of configured data (inputs/outputs):
outputs followed by (00 - 3FHEX) 00dec (0hex) = 1 Unit (Byte/Word)
the length byte for 63dec (3Fhex) = 64 Unit (Byte/Word)
inputs, if both are 1 Unit = Word
defined. 0 Unit = Byte
1 Consistency over the whole configured data block (Module)
0 Consistency over one Unit (Byte/ Word)
following Byte(s) 7 6 5 4 3 2 1 0 Bit
Vendor spec. data 00 - 255DEC (00 –FFHEX) Vendor specific identifier defining data type(s)
Code for data type
1 − Boolean (bit) 10 − Octet String
2 − signed Integer8 (byte) 11 − Date
3 − signed integer16 (word) 12 − Time of Day
4 − signed integer32 (2 words) 13 − Time Difference
5 − unsigned8 (byte) 14 − Time of Day
6 − unsigned16 (word) 15 − Time Difference
7 − unsigned32 (2 words) 16…31 − Reserved
8 − Floating point (2 words) 32…63 − User specific
9 − Visible String 64…255 − Reserved
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 10 of 13
DPV1 Extended Diagnostics Telegram
Extended Diagnostic Data
First 6 bytes are mandatory for every Slave
(mandatory)
device related Diag block
(optional)
Identifier-module related Diag block
(optional)
Channel related Diag block(s)
(optional)
Header byte Device related diag. data bytes
0 0 x x x x x x 3 to 62DEC bytes
Byte (Octet) 1 Header Byte
7 6 5 4 3 2 1 0 Bit
0 0 Header Byte device related Diag
4 – 63DEC Length of Diag. block incl. Header:
04HEX = 4 bytes
3FHEX = 63 bytes
Byte (Octet) 2 Alarm OR
7 6 5 4 3 2 1 0 Bit
0 Alarm Type
1 to 6, 32 to 126
Alarm Type:
0 – Reserved
1 – Diagnostic Alarm
2 – Process Alarm
3 – Pull Alarm
4 – Plug Alarm
5 – Status Alarm
6 – Update Alarm
7 to 31 Reserved
32 to 126 Manufacturer Specific
127 Reserved
Byte (Octet) 3 Slot Number
7 6 5 4 3 2 1 0 Bit
0 to 254 Number of identifier (module) reporting Alarm
Byte (Octet) 4 Alarm Specifier
7 6 5 4 3 2 1 0 Bit
0 0 No further differentiation
0 1 Alarm appears
1 0 Alarm disappears
1 1 Alarm disappears but others still present
0 No Acknowledge Required
1 Acknowledge Required
0 to 63 Alarm sequence Number
Byte (Octet) 5… User data
7 6 5 4 3 2 1 0 Bit
Byte (Octet) 2 Status
7 6 5 4 3 2 1 0 Bit
1 Status Type
1 to 6, 32 to 126
Status Type:
0 – Reserved
1 – Status Message follows after
status specifier
2 – Module Status follows after
status specifier
3 to 31 Reserved
32 to 126 Manufacturer Specific data
follows after status specifier
127 Reserved
Byte (Octet) 3 Slot Number
7 6 5 4 3 2 1 0 Bit
0 to 254 Number of Slot reporting Status
Byte (Octet) 4 Status Specifier
7 6 5 4 3 2 1 0 Bit
0 0 No further differentiation
0 1 Status Appears
1 0 Status disappears
1 1 Reserved
0 0 0 0 0 0 Reserved
Byte (Octet) 5… User data OR if Status type = 2
7 6 5 4 3 2 1 0 Bit
Byte (Octet) 5… Module Status:
7 6 5 4 3 2 1 0 Bit
4 3 2 1 Module number
x x Module 1 status
x x Module 2 status
x x Module 3 status
x x Module 4 status
8 7 6 5 Module number
x x Module 5 status
x x Module 6 status
x x Module 7 status
x x Module 8 status
… Etc. 10 9 Module number
Etc.
x x Module status bits:
0 0 Data valid
0 1 Module fault
1 0 Wrong module plugged
1 1 Missing module
1………………………………………………………………6 7……………………………………………………………………………………………………………………………………………....…244
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 11 of 13
DPV0 Master-Master Functions and DPV1 Master-Slave Acyclic Functions
DPV1 Acyclic Functions: Entire transferred Request/Response Telegram (Master Æ Slave):
SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED
68hex xx Xx xx xx xx xx xx xx xx xx … xx 16hex
Function No. Parameters
xx xx xx …
DPVO Master-Master
Function
Function
No. Request Parameters Response Parameters
Poll None None None
Get master diagnostics 41 (65)
Start sequence 42 (66)
Download 43 (67)
Upload 44 (68)
End sequence 45 (69)
Activate parameter
broadcast
46 (70)
Activate/deactivate
parameter or master
mode change
47 (71)
Idle 48hex None None
Data_Transport 51hex Slot_Number, Index, Length, Data Slot_Number, Index, Length, Data
Resource Manager 56hex ---- Server_SAP, Send_Timeout
Initiate 57hex 3 Bytes Reserved, Send_Timeout,
Features_Requested, Profile_Features_Requested,
Profile_Ident_No, Additional_Address_Parameters
Max_Data_Length_Supported, Features_Supported,
Profile_Features_Supported, Profile_Ident_No,
Additional_Address_Parameters
Abort 58hex Subnet, Instance/Reason_Code ----
Alarm_Acknowledge 5Chex Slot_Number, Alarm_Type, Specifier Slot_Number, Alarm_Type, Specifier
Read 5Ehex Slot_Number, Index, Length Slot_Number, Index, Length, Data
Write 5Fhex Slot_Number, Index, Length, Data Slot_Number, Index, Length
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 12 of 13
PA Profile – Cyclic data and Status byte
Cyclic data exchange transmitted as 5 bytes, containing the process value as a 32-bit float plus status as an unsigned 8-bit byte:
Byte 0 Byte 1 Byte 2 Byte 3 Byte 4
Process value (IEEE floating point) Status
Status byte:
7 6 5 4 3 2 1 0 Bit
1 0 GOOD - non cascade
0 0 0 0 Ok
0 0 0 1 Update event
0 0 1 0 Active advisory alarm
0 0 1 1 Active critical alarm
0 1 0 0 Unacknowledged update event
0 1 0 1 Unacknowledged advisory alarm
0 1 1 0 Unacknowledged critical alarm
1 0 0 0 Initiate fail safe
1 0 0 1 Maintenance required
1 1 GOOD - cascade
0 0 0 0 Ok
0 0 0 1 Initialisation acknowledged
0 0 1 0 Initialisation request
0 0 1 1 Not invited
0 1 0 1 Do not select
0 1 1 0 Local override
1 0 0 1 Initiate fail safe
0 0 No limit
0 1 Low limit
1 0 High limit
1 1 Constant
7 6 5 4 3 2 1 0 Bit
0 0 BAD
0 0 0 0 Non-specific
0 0 0 1 Configuration error
0 0 1 0 Not connected
0 0 1 1 Device failure
0 1 0 0 Sensor failure
0 1 0 1 No communication (last usable value)
0 1 1 0 No communication (no usable value)
0 1 1 1 Out of service
0 1 UNCERTAIN
0 0 0 0 Non specifiv
0 0 0 1 Last usable value
0 0 1 0 Substitute value
0 0 1 1 Initial value
0 1 0 0 Sensor conversion not accurate
0 1 0 1 Engineering unit violation (unit not in the valid set)
0 1 1 0 Sub normal
0 1 1 1 Configuration error
1 0 0 0 Simulated value
1 0 0 1 Sensor calibration
0 0 No limit
0 1 Low limit
1 0 High limit
PROFIBUS_Telegrams.doc PROFIBUS Certified Engineer Course, Version 7.0, December 2008 © A. Verwer Page 13 of 13
Other Helpful Information
HEX - BIN - DEC conversion
Hex Binary Decimal
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15
Common Diagnostic Responses (first two bytes in PDU):
First two
Diag Bytes
Action
02 05 …. slave is not ready (no parameterisation received yet) Wait until Master has sent a PRM
and CFG telegram
02 04 …. no configuration received yet or slave not ready with
configuration check (Watchdog = OFF)
Check whether the master has sent
a CFG, otherwise check next cycles
02 0C …. no configuration received yet or slave not ready with
configuration check (Watchdog = ON)
Check whether the master has sent
a CFG, otherwise check next cycles
42 05 …. PRM_Fault: wrong ID, invalid WD factor (=00) or
wrong device related parameters
Check the set parameter telegram
(ID number, user PRM data and
length)
12 05 …. Function_not_supp: Either SYNC or FREEZE bits are
set in PRM telegram but not supported from slave
or reserved bits are set in PRM telegram
Check the set parameter telegram
and whether the slave supports the
requested function or not
52 05 …. wrong parameterisation + not supported functions
within PRM telegram
Check the set parameter telegram
(ID number, user PRM data and
length, supported functions)
08 04 …. slave has extended diagnostic data + is in Data
exchange mode (Watchdog = OFF)
Check the extended Diagnostic
data
08 0C …. slave has extended diagnostic data + is in Data
exchange mode (Watchdog = ON)
Check the extended Diagnostic
data
0A 05 …. slave has extended diagnostic data + no PRM and
config received yet
Wait until Master has sent a PRM
and CFG telegram, if the ext. Diag
is still ON check the ext. Diag. data
06 05 …. Config_Fault: slave received wrong configuration or
an output data telegram with wrong length
Check the configuration telegram
and compare the config data and
length with the expected (real) data
0E 05 …. slave received wrong configuration + has extended
diagnostics
Check the configuration telegram
00 04 …. slave is happy and in Data exchange (Watchdog =
OFF)
Slave just reports everything is OK.
Check the master addr. in the diag.
00 0C …. slave is happy and in Data exchange (Watchdog =
ON)
Slave just reports everything is OK.
Check the master addr. in the diag.
00 06 …. slave has static diagnostic, but is in data exchange
(master requests only diag, until bit is reset)
Try to reset the device or check the
manual for possible reasons
02 07 slave has static diagnostic and must be parameterised
and configured
Wait until Master has sent a PRM
and CFG telegram

Profibus DP Telegrams COURSE How to .pdf

  • 1.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 1 of 13 PROFIBUS DP – Telegrams Telegram Frame Format: SD LE LEr SDr DA SA FC DSAP SSAP PDU… FCS ED SD: Start Delimiter LE: Net Data Length = (DA+SA+FC+DSAP+SSAP+Len[PDU]) ≤ 249 (Protocol Data Unit [PDU] Length ≤ 244) DA: Destination Address SA: Source Address FC: Function Code DSAP: Destination Service Access Point SSAP: Source Service Access Point FCS: Frame Check Sequence ED: End Delimiter, ED = 16 (22) Function Code Byte: 0 b6 b5 b4 fc fc fc fc DPV0 Master/Master and Master/Slave Interactions: Slave Get Master Diagnostics, Upload Class 1 Master Class 2 Master Data Exchange, Slave Diagnostics, Set Parameters, Check Configuration, Global Control Data Exchange, Read Inputs, Read Outputs, Slave Diagnostics, Set Parameters, Check Configuration, Get Configuration, Global Control Set Slave Address Download, Activate Bus Parameters, Broadcast, Activate/Deactivate Slave, Change Master Mode, Start/End Sequence Address encoding: XYYY YYYY Service Access Points: Service Master SAP Slave SAP Data Exchange None None Set Slave Address 3E (62) 37 (55) Read Inputs 3E (62) 38 (56) Read Outputs 3E (62) 39 (57) Global Control 3E (62) 3A (58) Get Configuration 3E (62) 3B (59) Slave Diagnostics 3E (62) 3C (60) Set Parameters 3E (62) 3D (61) Check Configuration 3E (62) 3E (62) DPV0 Master to Master functions 36 (54) 36 (54) DPV1 Master class 1 functions 33 (51) 33 (51) or 32 (50) DPV1 Resource Manager 32 (50) 31 (49) DPV1 Master class 2 32 (50) 0 (0) … 30 (48) SD1 = 10 (16) - Telegrams of fixed length without a data field (eg Request_FDL_Status – look for new masters) SD2 = 68 (104) - Telegrams with a variable length data field (SRD service) SD3 = A2 (162) - Telegrams of fixed length with a constant-length data field (Data field is always 8 bytes) SD4 = DC (220) - Token pass telegram SC = E5 (229) - Short Acknowledgement telegram (Only one byte transmitted) Always 0 1=Rqst, 0=Resp Rqst: b5=frame count bit (alternates 0/1), b4=frame count valid Resp: Station type (00=Slave, 01=Master not ready to enter token ring, 10= Master ready to enter token ring, 11= Master in token ring) fc Request function (b6=1) Response function (b6=0) 0 ---- Ack positive (OK) 1 ---- Ack negative, user error (UE) 2 ---- Ack negative, no resource for response (RR) 3 SDA low (FMS only) Ack negative, SAP not activated (RS) 4 SDN low (Broadcast and multicast telegrams) ---- 5 SDA high (FMS only) ---- 6 SDN high (Broadcast and multicast telegrams) ---- 7 ---- ---- 8 ---- Low priority response to SRD (DL) 9 Request FDL status with reply Ack negative, no response (NR) A (10) ---- High priority response to SRD (DH) B (11) ---- ---- C (12) SRD low (Send and request data) Negative response to SRD, no resource (RDL) D (13) SRD high (Send and request data) Negative response to SRD, no resource (RDH) E (14) Request ID with reply ---- F (15) Request LSAP status with reply ---- Note all values shown on this page as: hex (dec) X = Extended Addressing used (SAPs) YYY YYYY = station address (7 bits)
  • 2.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 2 of 13 Master/Slave startup sequence DP Slave state machine Set slave address (from a class II master) can only be performed before parameterisation (while slave is in wait PARAM state). Master sends diagnostic request to check if slave is available. Slave responds to diagnostic request. Master sends a set parameters telegram Slave responds with short acknowledgement (E5h) Slave checks parameterisation and indicates ok or not ok to ASIC Master sends check configuration telegram Slave responds with short acknowledgement (E5h) Slave checks configuration and indicates ok or not ok to ASIC Master sends diagnostic request(s) to check for slave acceptance of parameters and configuration and determine when slave is ready to enter data exchange Slave responds with diagnostic information Master and slave enter data exchange mode Bus Timing Token Timing: TTR = Target Rotation Time, TTH = TTR – TRR; TTH = Token Hold Time, TRR = Time between that master last releasing the token and receiving it again. Tbit = 1/bit rate. Estimated Bus Cycle Time, TMC ≈ (380 + 300*S + 11*D)*Tbit + 75µs Where S = Number of Slaves and D = Total number of bytes of I/O data Parameterisation error Parameterisation ok Configuration error Configuration ok Watchdog timeout Unlock, Config error, Param error, Output data length mismatch Power on/ reset Wait PARAM Wait CONFIG Data Exchange min TSDR Previous slave response Slave response Master request TID1 TSDR max TSDR Next master request TTelegram + TTD TID1
  • 3.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 3 of 13 Set Parameterisation The Set_PRM.Req telegram from the master to the slave contains communication parameters, expected functions, device related parameters and Identification Number. The Slave has to check whether the requested parameters and functions are allowed/supported or not. Set_PRM.req: Entire transferred Request Telegram (Master Æ Slave): SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED 68hex xx xx xx xx xx xx 3Dhex 3Ehex xx xx … xx 16hex Entire transferred Response Telegram (Slave Æ Master): E5hex Only one byte response, short character (SC) Parameterisation Data Unit (DU) minimum 7bytes, but can contain up to 244 bytes Description for the 7 mandatory parameter bytes (according to the PROFIBUS DP Standard): Byte(Octet) 1: Byte (Octet) 2: Byte (Octet) 3: Byte (Octet) 4: Byte (Octet) 5: Byte (Octet) 6: Byte (Octet) 7: Byte (Octet) 8: 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Extended Parameters 0 0 0 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) x x x x x x x x Device and module related x (DPV1 Status bytes, see p8) x x x Watchdog Factor 1 Watchdog Factor 2 Min. station response PROFIBUS ID No. PROFIBUS ID No. Group assignment x (WD1) (WD2) time ( TSDR) (MSB) (LSB) LOCK flag (1= Master locks slave for other masters) UNLOCK flag (1= Master unlocks slave for other masters) Slave is to support SYNC mode (1= Yes) Slave is to support FREEZE mode (1= Yes) Watchdog ON/OFF (1= ON) Can be selected by the user Reserved (must be 0) Reserved (must be 0) Reserved (must be 0) Watchdog time = WD1* WD2 * 10ms In a regular PROFIBUS DP system, the minimum station delay response time is 11 Tbit = 0Bhex (1Tbit = Bit time for 1Bit) Each bit represents a group, therefore the slave can be assigned for one or multiple groups. The group assignment is only relevant for the global control functions (SYNC, FREEZE…etc.) First 7 bytes are mandatory for every Slave Device and module related Parameter Data (optional) 1……………………………………………………….. 7 8 ……………………………………………………………………………244
  • 4.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 4 of 13 Check Configuration The purpose of the check configuration telegram is to compare the configured I/O (master system) with the real I/O of the slave. The slave will execute the compaison and check the configuration whether it is valid or not. Check_CFG.Req: Entire transferred Request Telegram (Master Æ Slave): SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED 68hex xx xx xx xx xx xx 3Ehex 3Ehex xx xx … xx 16hex Entire transferred Response Telegram (Slave Æ Master): E5hex Only one byte response, short character (SC) Configuration Data Unit (DU) can contain up to 244 bytes Config Identifier ID 0 (mandatory) ID1 , ID2 , ID3 …………………………………. (optional) The Data Unit of the check configuration telegram contains the desired I/O configuration. The configuration Identifier (ID) defines the number of inputs, outputs , the data type (byte/word) and the data consistency of a data block (module). The Data Unit has to contain at least one ID. With PROFIBUS we distinguish between normal and special configuration ID format. Normal (compact) ID format (one byte) Byte (octet) 1: 7 6 5 4 3 2 1 0 Bit 0 1 ID defines only Input configuration 1 0 ID defines only Output configuration 1 1 ID defines Input and Output configuration 0 0 Special ID format (use decoding table for special format) 00 - 15DEC (0 - FHEX) Number of configured data (inputs/outputs): 00dec (0hex) = 1 Unit (Byte/Word) 15dec (Fhex) = 16 Units (Byte/Word) 1 Unit = Word 0 Unit = Byte 1 Consistency over the whole configured data block (Module) 0 Consistency over one Unit (Byte/ Word) Special (extended) ID format Structure for one special configuration ID Special Previous ID ID Header Length OUTP. Length INPUT Vendor spec. Data next ID Configuration ID x x 0 0 x x x x only if outputs only if inputs (optional) Decoding table for special format Byte (octet) 1: 7 6 5 4 3 2 1 0 Bit Configuration ID 0 0 Special ID format (use decoding table for special format) header 00 - 15DEC (0 - FHEX) Number of vendor specific config ID data at the end 00dec (0hex) = no vendor specific data 14dec (Ehex) = 14 vendor specific data 15dec (Fhex) = no vendor specific data 0 0 Empty module, module has no input or output configuration 0 1 One length byte for Inputs follows 1 0 One length byte for Outputs follows 1 1 One length byte for each Outputs and Inputs follows following Byte(s) 7 6 5 4 3 2 1 0 Bit one length byte for 00 - 63DEC Number of configured data (inputs/outputs): outputs followed by (00 - 3FHEX) 00dec (0hex) = 1 Unit (Byte/Word) the length byte for 63dec (3Fhex) = 64 Unit (Byte/Word) inputs, if both are 1 Unit = Word defined. 0 Unit = Byte 1 Consistency over the whole configured data block (Module) 0 Consistency over one Unit (Byte/ Word) following Byte(s) 7 6 5 4 3 2 1 0 Bit Vendor spec. data 00 - 255DEC (00 –FFHEX) Vendor specific config ID, defined by the device vendor (or DPV1 data types, see page 9) 1………………………………………………………………. ……………………………………………………………………………244
  • 5.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 5 of 13 Diagnostic Response The purpose of the DIAG_res is to inform the master about the slave status and whether the slave accepted the parameter and configuration data from the master or a parameterisation and configuration is still required. Diag.req: Entire transferred Request Telegram (Master Æ Slave): Has no Data Unit (DU) SD LE LEr SDr DA SA FC DSAP SSAP FCS ED 68hex xx xx xx xx xx xx 3Chex 3Ehex xx 16hex Diag.res: Entire transferred Response Telegram (Slave Æ Master): SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED 68hex xx xx xx xx xx xx 3Ehex 3Chex xx xx … xx 16hex Diagnostic Data Unit (DU) min. 6bytes, but can contain up to 244 bytes First 6 bytes are mandatory for every Slave (mandatory) device related Diag block (optional) Identifier-module related Diag block (optional) Channel related Diag block(s) (optional) Description for the fist 6 bytes Standard Diagnostic (mandatory) Byte(Octet) 1: Byte (Octet) 2: Byte (Octet) 3: Byte (Octet) 4: Byte (Octet) 5: Byte (Octet) 6: Byte (Octet) 7-244: 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Extended Diag_Data (optional) M X 0 0 0 0 0 0 0 0-125DEC (0-7DHEX) 0-255DEC (0-FFHEX) 0-255DEC (0-FFHEX) x X x ⎢ Device related Diag Block x 1 ⎢ Identifier related Diag Block x X ⎢ Channel related Diag Block(s) x X Master station address PROFIBUS ID No. PROFIBUS ID No. M X (MSB) (LSB) (decoding see next page) X 0 0-125DEC (0-7DHEX) : M M Address of controlling Slave is locked/controlled from another Master (set by Master) Prm_Fault: Slave did not accept last parameter data Invalid Slave Response (set by master) Slave does not support requested parameter function Slave has extended Diag data to report an error Config_Fault: slave did not accept last config data Station not ready for Data_exchange Station not existent (Set by master if slave does not respond) Slave is deactivated in master parameter set (set by master) Reserved Slave is in SYNC mode (1= ON ; 0=OFF) Slave is in FREEZE mode (1= ON ; 0=OFF) Response monitoring/ Watchdog ON (1=ON ; 0=OFF) Always set to 1 Static diagnostic: Master requesting diag until bit is reset Slave must be parameterised Diag overflow: Has more diag data as it can report Reserved Reserved Reserved Reserved Reserved Reserved Reserved Master 255DEC (FFHEX) Slave is not controlled or parameterised by any Master Real slave Identification number issued by PROFIBUS International 1………………………………………………………………6 7……………………………………………………………………………………………………………………………………………....…244
  • 6.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 6 of 13 Extended Diagnostic Data The extended Diag data are additional diagnostic information beside the 6 mandatory bytes. 3 different kind of ext. diag are possible ‘device related’ ‘identifier related’ and ‘channel related’. The device vendor defines the order or existence of the extended Diag blocks. Extended Diagnostic Data First 6 bytes are mandatory for every Slave (mandatory) device related Diag block (optional) Identifier-module related Diag block (optional) Channel related Diag block(s) (optional) Header byte Device related diag. data bytes Header byte Identifier (module) related diag. data bytes Header byte Channel related diag. data 0 0 x x x x x x 1 - 62 bytes 0 1 x x x x x x 1 – 62 bytes 1 0 x x x x x x always 2 bytes (3 bytes incl. header) Header Byte (device related Diag) 7 6 5 4 3 2 1 0 Bit 0 0 Header Byte device related Diag 2 – 63DEC Length of Diag. block incl. Header: 02HEX = 2 bytes 3FHEX = 63 bytes Following device related diag. data bytes 7 6 5 4 3 2 1 0 Bit Vendor determines the meaning of the bits, bit area or bytes Device related diag. data bytes (or DPV1 alarm/status see page 10) Header Byte (identifier related Diag) 7 6 5 4 3 2 1 0 Bit 0 1 Header Byte identifier related Diag 2 – 63DEC Length of Diag. block incl. Header: 02HEX = 2 bytes 3FHEX = 63 bytes Following identifier related diag. data bytes 7 6 5 4 3 2 1 0 Bit X Identifier Byte 0 (Mod. 1) has Diag X Identifier Byte 1 (Mod. 2) has Diag X Identifier Byte 2 (Mod. 3) has Diag X Identifier Byte 3 (Mod. 4) has Diag X Identifier Byte 4 (Mod. 5) has Diag X Identifier Byte 5 (Mod. 6) has Diag X Identifier Byte 6 (Mod. 7) has Diag X Identifier Byte 7 (Mod. 8) has Diag …Next Bytes (only necessary if device has more than 8 Modules)…. 7 6 5 4 3 2 1 0 Bit X Identifier Byte 8 (Mod. 9) has Diag ……. X Identifier Byte 15 (Mod.16) has Diag 7 6 5 4 3 2 1 0 Bit X Identifier Byte 16 (Mod.17) has Diag ……. X Identifier Byte 23 (Mod.24) has Diag 7 6 5 4 3 2 1 0 Bit X Identifier Byte 24 (Mod.25) has Diag ……. X Identifier Byte 31 (Mod.32) has Diag ……….. ……….. Header Byte (channel related Diag) 7 6 5 4 3 2 1 0 Bit 1 0 Header Byte channel related Diag 0 – 63DEC Reporting Identifier (Module) number e.g. 00HEX = Identifier Byte 0 (Mod. 1) has Diag 3FHEX = Identifier Byte 63 (Mod. 64) has Diag Byte 2 : (channel related Diag) 7 6 5 4 3 2 1 0 Bit 0 – 63DEC Reporting Channel number 0 1 Channel type: Input 1 0 Channel type: Output 1 1 Channel type: Input & Output Byte 3 : (channel related Diag) 7 6 5 4 3 2 1 0 Bit 0 0 1 Channel type: Bit 0 1 0 Channel type: 2 Bits 0 1 1 Channel type: 4 Bits 1 0 0 Channel type: Byte 1 0 1 Channel type: Word 1 1 0 Channel type: 2 Words 1DEC 2DEC 3 DEC 4 DEC 5 DEC 6 DEC 7 DEC 8 DEC 9 DEC 10-15 DEC 16-31 DEC Error type: Short Circuit Error type: Under Voltage Error type: Over Voltage Error type: Overload Error type: Over Temperature Error type: Wire Break Error type: Upper Limit Exceeded Error type: Lower Limit Exceeded Error type: Error (General) Error type: Reserved Error type: Device Related 1………………………………………………………………6 7……………………………………………………………………………………………………………………………………………....…244
  • 7.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 7 of 13 Global Control The global control telegram is broadcast (all slaves) or multicast telegram (group of slaves) in order to activate or deactivate certain functions for those slaves simultaneous e.g. CLEAR, SYNC, FREEZE …etc. The telegram is the only PROFIBUS telegram with no response to prevent conflicts. Global_Ctrl request: Entire transferred Request Telegram (Master Æ Slave): SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED 68hex xx xx xx xx xx xx 3Ahex 3Ehex Always 2 bytes xx 16hex No response Telegram Description of the Data unit (DU) Global Control Byte 1: Byte 2: 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 0 0 0 X X X X X X X X X X Group Number X Each bit represents a X Group, multiple groups X are possible. Reserved Reserved Activates SYNC (freezes output data of the slaves) Activates UNSYNC (deactivates SYNC) Activates FREEZE (freezes input data of the slaves) Activates UNFREEZE (deactivates FREEZE) Activates CLEAR (clears the output data of the slaves Reserved The command influences only slave that belong to the group. (group assignment see Parameter telegram) 00Hex : That command influences all slaves no matter whether they are assigned to a group or not
  • 8.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 8 of 13 DPV1 Extended Parameterisation Telegram Set_PRM.req: Entire transferred Request Telegram (Master Æ Slave): SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED 68hex xx xx xx xx xx xx 3Dhex 3Ehex xx xx … xx 16hex Entire transferred Response Telegram (Slave Æ Master): E5hex Only one byte response, short character (SC) Parameterisation Data Unit (DU) minimum 7bytes, but can contain up to 244 bytes Byte(Octet) 8: Byte (Octet) 9: Byte (Octet) 10: Byte (Octet) 11-244: 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 0 x x 0 0 x x x x 0 x x 0 x x x x 0 x x 0 x x 0 DPV1_Enable (0 = Disable, 1 = Enable) Fail_Safe mode (0 = No, 1 = Yes), DPV2 only Publisher, DPV2 only Reserved Reserved WD_Base_1ms (0 = 10ms, 1 = 1ms) Reserved Reserved Enable_Pull_Plug_Alarm Enable_Process_Alarm Enable_Diagnostic_Alarm Enable_Manufacturer_Specific _Alarm Enable_Status_Alarm Enable_Update_Alarm Reserved Configuration_Check_Mode (0=Standard, 1= Vendor Specific ) Reserved Reserved Reserved IsoM, DPV2 only Prm_Struc, DPV2 only Alarm mode (Maximum Number of Active alarms of each type 0 = 1 Alarm, 1 = 2 Alarms, 2 = 4 Alarm, 3 = 8 Alarms, 4 = 12 Alarms 5 = 16 Alarms, 6 = 24 Alarm, 7 = 32 Alarms First 7 bytes are mandatory for every Slave Device and module related Parameter Data (optional) 1……………………………………………………….. 7 8 …………………………10 11……………….…………………………………………………………244 DPV1_Status (3 bytes)
  • 9.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 9 of 13 DPV1 Extended Configuration Telegram DPV1 uses the vendor specific configuration data in the special format specifier to give additional information on the data types that are being transferred Special (extended) ID format Structure for one special configuration ID Special Previous ID ID Header Length OUTP. Length INPUT Vendor spec. Data next ID Configuration ID x x 0 0 x x x x only if outputs only if inputs (optional) Decoding table for special format Byte (octet) 1: 7 6 5 4 3 2 1 0 Bit Configuration ID 0 0 Special ID format (use decoding table for special format) header 00 - 15DEC (0 - FHEX) Number of vendor specific config ID data at the end 00dec (0hex) = no vendor specific data 14dec (Ehex) = 14 vendor specific data 15dec (Fhex) = no vendor specific data 0 0 Empty module, module has no input or output configuration 0 1 One length byte for Inputs follows 1 0 One length byte for Outputs follows 1 1 One length byte for each Outputs and Inputs follows following Byte(s) 7 6 5 4 3 2 1 0 Bit one length byte for 00 - 63DEC Number of configured data (inputs/outputs): outputs followed by (00 - 3FHEX) 00dec (0hex) = 1 Unit (Byte/Word) the length byte for 63dec (3Fhex) = 64 Unit (Byte/Word) inputs, if both are 1 Unit = Word defined. 0 Unit = Byte 1 Consistency over the whole configured data block (Module) 0 Consistency over one Unit (Byte/ Word) following Byte(s) 7 6 5 4 3 2 1 0 Bit Vendor spec. data 00 - 255DEC (00 –FFHEX) Vendor specific identifier defining data type(s) Code for data type 1 − Boolean (bit) 10 − Octet String 2 − signed Integer8 (byte) 11 − Date 3 − signed integer16 (word) 12 − Time of Day 4 − signed integer32 (2 words) 13 − Time Difference 5 − unsigned8 (byte) 14 − Time of Day 6 − unsigned16 (word) 15 − Time Difference 7 − unsigned32 (2 words) 16…31 − Reserved 8 − Floating point (2 words) 32…63 − User specific 9 − Visible String 64…255 − Reserved
  • 10.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 10 of 13 DPV1 Extended Diagnostics Telegram Extended Diagnostic Data First 6 bytes are mandatory for every Slave (mandatory) device related Diag block (optional) Identifier-module related Diag block (optional) Channel related Diag block(s) (optional) Header byte Device related diag. data bytes 0 0 x x x x x x 3 to 62DEC bytes Byte (Octet) 1 Header Byte 7 6 5 4 3 2 1 0 Bit 0 0 Header Byte device related Diag 4 – 63DEC Length of Diag. block incl. Header: 04HEX = 4 bytes 3FHEX = 63 bytes Byte (Octet) 2 Alarm OR 7 6 5 4 3 2 1 0 Bit 0 Alarm Type 1 to 6, 32 to 126 Alarm Type: 0 – Reserved 1 – Diagnostic Alarm 2 – Process Alarm 3 – Pull Alarm 4 – Plug Alarm 5 – Status Alarm 6 – Update Alarm 7 to 31 Reserved 32 to 126 Manufacturer Specific 127 Reserved Byte (Octet) 3 Slot Number 7 6 5 4 3 2 1 0 Bit 0 to 254 Number of identifier (module) reporting Alarm Byte (Octet) 4 Alarm Specifier 7 6 5 4 3 2 1 0 Bit 0 0 No further differentiation 0 1 Alarm appears 1 0 Alarm disappears 1 1 Alarm disappears but others still present 0 No Acknowledge Required 1 Acknowledge Required 0 to 63 Alarm sequence Number Byte (Octet) 5… User data 7 6 5 4 3 2 1 0 Bit Byte (Octet) 2 Status 7 6 5 4 3 2 1 0 Bit 1 Status Type 1 to 6, 32 to 126 Status Type: 0 – Reserved 1 – Status Message follows after status specifier 2 – Module Status follows after status specifier 3 to 31 Reserved 32 to 126 Manufacturer Specific data follows after status specifier 127 Reserved Byte (Octet) 3 Slot Number 7 6 5 4 3 2 1 0 Bit 0 to 254 Number of Slot reporting Status Byte (Octet) 4 Status Specifier 7 6 5 4 3 2 1 0 Bit 0 0 No further differentiation 0 1 Status Appears 1 0 Status disappears 1 1 Reserved 0 0 0 0 0 0 Reserved Byte (Octet) 5… User data OR if Status type = 2 7 6 5 4 3 2 1 0 Bit Byte (Octet) 5… Module Status: 7 6 5 4 3 2 1 0 Bit 4 3 2 1 Module number x x Module 1 status x x Module 2 status x x Module 3 status x x Module 4 status 8 7 6 5 Module number x x Module 5 status x x Module 6 status x x Module 7 status x x Module 8 status … Etc. 10 9 Module number Etc. x x Module status bits: 0 0 Data valid 0 1 Module fault 1 0 Wrong module plugged 1 1 Missing module 1………………………………………………………………6 7……………………………………………………………………………………………………………………………………………....…244
  • 11.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 11 of 13 DPV0 Master-Master Functions and DPV1 Master-Slave Acyclic Functions DPV1 Acyclic Functions: Entire transferred Request/Response Telegram (Master Æ Slave): SD LE LEr SDr DA SA FC DSAP SSAP DU FCS ED 68hex xx Xx xx xx xx xx xx xx xx xx … xx 16hex Function No. Parameters xx xx xx … DPVO Master-Master Function Function No. Request Parameters Response Parameters Poll None None None Get master diagnostics 41 (65) Start sequence 42 (66) Download 43 (67) Upload 44 (68) End sequence 45 (69) Activate parameter broadcast 46 (70) Activate/deactivate parameter or master mode change 47 (71) Idle 48hex None None Data_Transport 51hex Slot_Number, Index, Length, Data Slot_Number, Index, Length, Data Resource Manager 56hex ---- Server_SAP, Send_Timeout Initiate 57hex 3 Bytes Reserved, Send_Timeout, Features_Requested, Profile_Features_Requested, Profile_Ident_No, Additional_Address_Parameters Max_Data_Length_Supported, Features_Supported, Profile_Features_Supported, Profile_Ident_No, Additional_Address_Parameters Abort 58hex Subnet, Instance/Reason_Code ---- Alarm_Acknowledge 5Chex Slot_Number, Alarm_Type, Specifier Slot_Number, Alarm_Type, Specifier Read 5Ehex Slot_Number, Index, Length Slot_Number, Index, Length, Data Write 5Fhex Slot_Number, Index, Length, Data Slot_Number, Index, Length
  • 12.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 12 of 13 PA Profile – Cyclic data and Status byte Cyclic data exchange transmitted as 5 bytes, containing the process value as a 32-bit float plus status as an unsigned 8-bit byte: Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Process value (IEEE floating point) Status Status byte: 7 6 5 4 3 2 1 0 Bit 1 0 GOOD - non cascade 0 0 0 0 Ok 0 0 0 1 Update event 0 0 1 0 Active advisory alarm 0 0 1 1 Active critical alarm 0 1 0 0 Unacknowledged update event 0 1 0 1 Unacknowledged advisory alarm 0 1 1 0 Unacknowledged critical alarm 1 0 0 0 Initiate fail safe 1 0 0 1 Maintenance required 1 1 GOOD - cascade 0 0 0 0 Ok 0 0 0 1 Initialisation acknowledged 0 0 1 0 Initialisation request 0 0 1 1 Not invited 0 1 0 1 Do not select 0 1 1 0 Local override 1 0 0 1 Initiate fail safe 0 0 No limit 0 1 Low limit 1 0 High limit 1 1 Constant 7 6 5 4 3 2 1 0 Bit 0 0 BAD 0 0 0 0 Non-specific 0 0 0 1 Configuration error 0 0 1 0 Not connected 0 0 1 1 Device failure 0 1 0 0 Sensor failure 0 1 0 1 No communication (last usable value) 0 1 1 0 No communication (no usable value) 0 1 1 1 Out of service 0 1 UNCERTAIN 0 0 0 0 Non specifiv 0 0 0 1 Last usable value 0 0 1 0 Substitute value 0 0 1 1 Initial value 0 1 0 0 Sensor conversion not accurate 0 1 0 1 Engineering unit violation (unit not in the valid set) 0 1 1 0 Sub normal 0 1 1 1 Configuration error 1 0 0 0 Simulated value 1 0 0 1 Sensor calibration 0 0 No limit 0 1 Low limit 1 0 High limit
  • 13.
    PROFIBUS_Telegrams.doc PROFIBUS CertifiedEngineer Course, Version 7.0, December 2008 © A. Verwer Page 13 of 13 Other Helpful Information HEX - BIN - DEC conversion Hex Binary Decimal 0 0000 0 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5 6 0110 6 7 0111 7 8 1000 8 9 1001 9 A 1010 10 B 1011 11 C 1100 12 D 1101 13 E 1110 14 F 1111 15 Common Diagnostic Responses (first two bytes in PDU): First two Diag Bytes Action 02 05 …. slave is not ready (no parameterisation received yet) Wait until Master has sent a PRM and CFG telegram 02 04 …. no configuration received yet or slave not ready with configuration check (Watchdog = OFF) Check whether the master has sent a CFG, otherwise check next cycles 02 0C …. no configuration received yet or slave not ready with configuration check (Watchdog = ON) Check whether the master has sent a CFG, otherwise check next cycles 42 05 …. PRM_Fault: wrong ID, invalid WD factor (=00) or wrong device related parameters Check the set parameter telegram (ID number, user PRM data and length) 12 05 …. Function_not_supp: Either SYNC or FREEZE bits are set in PRM telegram but not supported from slave or reserved bits are set in PRM telegram Check the set parameter telegram and whether the slave supports the requested function or not 52 05 …. wrong parameterisation + not supported functions within PRM telegram Check the set parameter telegram (ID number, user PRM data and length, supported functions) 08 04 …. slave has extended diagnostic data + is in Data exchange mode (Watchdog = OFF) Check the extended Diagnostic data 08 0C …. slave has extended diagnostic data + is in Data exchange mode (Watchdog = ON) Check the extended Diagnostic data 0A 05 …. slave has extended diagnostic data + no PRM and config received yet Wait until Master has sent a PRM and CFG telegram, if the ext. Diag is still ON check the ext. Diag. data 06 05 …. Config_Fault: slave received wrong configuration or an output data telegram with wrong length Check the configuration telegram and compare the config data and length with the expected (real) data 0E 05 …. slave received wrong configuration + has extended diagnostics Check the configuration telegram 00 04 …. slave is happy and in Data exchange (Watchdog = OFF) Slave just reports everything is OK. Check the master addr. in the diag. 00 0C …. slave is happy and in Data exchange (Watchdog = ON) Slave just reports everything is OK. Check the master addr. in the diag. 00 06 …. slave has static diagnostic, but is in data exchange (master requests only diag, until bit is reset) Try to reset the device or check the manual for possible reasons 02 07 slave has static diagnostic and must be parameterised and configured Wait until Master has sent a PRM and CFG telegram