Profibus Introduction 698A
Profibus Introduction 698A
Profibus Introduction 698A
Technical Reference
INTRODUCTION TO PROFIBUS DP
_____________________________________________________________________________
c. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 3
TABLE OF
CONTENTS
INTRODUCTION TO PROFIBUS DP
ABOUT PROFIBUS. 3
……………………………………………
PROFIBUS DP SLAVE STATE MACHINE.. 7
…………………
Power ON/Reset 7
State…………………………………..
Parameterization 7
State………………………………….
I/O Configuration 7
State………………………………….
Data Exchange 8
State…………………………………….
Fail Safe Operation………………….. 8
…………………..
Watchdog……………………………..………………….. 9
GSD 10
FILES………………………………………………………
REQUIRED SOFTWARE…..……………….. 13
…………………
TYPES OF TRANSMISSION……………….. 14
…………………
SRD Send and Request Data w/Acknowledge…….. 14
SDN Send Data w/No 14
Acknowledge…………………..
PROFIBUS DP DATA CHARACTER 14
FORMAT…………….
ProfiBus Data Error Checking………….…………….. 15
PROFIBUS TELEGRAM STRUCTURE…………………….. 15
Start 16
Delimiter…………………………………………….
Length Of 18
Telegram……………………………………..
Destination Address & Source 18
Address……………..
Function Code Or Frame 18
Control……………………..
Service Access 19
Points…………………………………..
Data Unit………………………………………………….. 19
Frame Check 19
Sequence…………………………………
End 20
Delimiter……………………………………………..
DP COMMAND 20
FUNCTIONS………………………………….
Function 20
Status…………………………………………..
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
4 Introduction To ProfiBus DP
__________________________________________________________________
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 5
ABOUT PROFIBUS
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 7
A ProfiBus master forms an “active station” on the network. ProfiBus
DP defines two classes of masters. A class 1 master handles the normal
communication or exchange of data with the slaves assigned to it. A class
2 master is a special device primarily used for commissioning slaves and for
diagnostic purposes. Some masters may support both class 1 and class 2
functionality. Master-to-master communication is normally not permitted in
Profibus, except in order to grant bus access rights to another master via
the exchange of a token. However, master-to-master communication
between two mono-master systems can be facilitated using a DP-DP
gateway. Note that the exchange of bus access rights via this “token ring”
only applies between masters on the bus.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
8 Introduction To ProfiBus DP
__________________________________________________________________
The length (and timing) of the I/O data to be transferred from a single
slave to a master is predefined in the slave’s device data base or GSD file.
The GSD files of each device connected via the network (slaves and class 1
masters only) are compiled into a master parameter record which contains
parameterization and configuration data, an address allocation list, and the
bus parameters for all connected stations. A master uses this information to
set up communication with each slave during startup.
Since there usually is not enough time during the gap to complete a full data
exchange, this process of data retrieval by the class 2 master may continue
over several cycles. At the end of record transfer, the class 2 master will
clear the connection. Note however, that the class 2 master may only
establish communication with the slaves during the gap time.
ProfiBus DP –
Class 1 Master –
Class 2 Master –
Slave -
A passive station which can only respond per a master request and
acknowledge messages. A slave has no bus control rights.
The GSD file defines the slave for the master.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
10 Introduction To ProfiBus DP
__________________________________________________________________
PROFIBUS DP SLAVE
STATE MACHINE
The power on/reset state is the initial state following power up for the
DP slave. In this state, the slave may receive a telegram from a class 2
master to change its station address. A slave will be held in this state if it
does not have a valid address from 0-125. After completion of its power-on
initialization routine and if the slave has a valid station address, the slave
will proceed to the Wait for Parameterization state.
Parameterization State
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 11
In this state, the slave awaits a configuration telegram that specifies
the number of input and output bytes that are to be exchanged in each data
telegram cycle with the slave. The configuration telegram also causes the
slave to check the configuration which was sent against the stored
configuration. A slave in this state will accept a request telegram for
diagnostics or configuration, or a set parameters telegram.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
12 Introduction To ProfiBus DP
__________________________________________________________________
A slave may also assume a fail-safe state if its master switches from
Operate Mode to Clear Mode. With normal operation in Data_Exchange
mode, a class 1 master is in Operate Mode and cyclically exchanges I/O
data with its assigned slaves. The class 1 master may use a global control
telegram to inform the slaves that it is switching from Operate Mode to Clear
Mode. A master may elect to switch to Clear Mode while it is bringing
slaves online and not all slaves have been parameterized and configured
yet. It may also switch to Clear Mode as a result of a run/stop switch on the
master. In the Clear State, the master may attempt to parameterize and
configure the remaining slaves assigned to it in an effort to reinitiate data
exchange, while it continues data exchange with the other slaves (they will
be receiving output data of 0, or output data of zero length). Operate mode
does not resume until all slaves are online and exchanging data, or until the
master is told to resume operation via a run/stop switch or under program
control. Further, some masters may go to Clear Mode if a slave is disabled,
rather than continue to control a partial system (this response may be
specified as a parameter in the master’s GSD file and parameterization
telegram, via a mechanical switch, or as part of its master program).
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 13
When a master switches to Clear Mode, it sends a global control
telegram to all slaves with the first data byte (octet 1) = 2 and the second
data byte (octet 2) = 0. In the next data cycle, the master sends data
telegrams to all stations with either the output data equal to 0, or the output
data length equal to 0 (i.e. only the telegram header and no data). If the
slave GSD file contains “Fail_Safe = 0”, the master sends output telegrams
with the data set to 0 in Clear Mode. However, if the slave GSD file
contains “Fail_Safe = 1” (supports Fail-Safe Mode), the master will send
output telegrams with a data length of 0 in Clear Mode. . Slaves that do not
support fail-safe mode do not process data telegrams with no data. Some
older masters do not make this distinction of fail-safe mode and will send
data telegrams with the output data set to 0 in Clear Mode. This will force
all slave outputs to go to 0 in Clear Mode and this may not be desirable for
some critical control applications.
Watchdog
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
14 Introduction To ProfiBus DP
__________________________________________________________________
GSD FILES
The GSD file is an electronic device data sheet or device data base file
that identifies the ProfiBus device. All ProfiBus devices (class 1 masters
and slaves) have their own GSD files. The GSD file is the fundamental
building block for the master parameter record. Use of the GSD file by a
ProfiBus configuration tool permits plug & play interoperability among
different devices from different manufacturers. This file does not reside
within the device itself, but usually on a separate disk/drive. It is an ASCII
text file that contains device-specific data, such as, vendor identification
information, supported baud rates, supported message length, number of
input/output data, meaning of diagnostic messages, timing information, plus
options and features supported, data formats, and available I/O signals. For
modular ProfiBus systems, a GSD file may contain several configurations
(one for each I/O module), one of which will be found valid during startup.
The GSD file begins with the specifier “#Profibus_DP”. In the body of
the file, the parameters are specified as parameters of a keyword (as in
“keyword = parameter”, see below). Comment lines begin with a semicolon.
Case is not significant and the sequence of parameters is not important.
Lines are limited to 80 characters, but may be continued by placing a
backslash character “\” at the end of the line to be continued. A GSD file is
divided into sections as follows:
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 15
GSD FILES
The GSD files of all connected devices are compiled together to form
the master parameter record. The master parameter record contains the
parameterization and configuration data taken from the all the GSD files,
and includes an address allocation list, plus the bus parameters for all the
connected slaves. During startup, a master will use this information to set
up communication with each of its assigned slaves prior to exchanging
actual I/O data with them.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
16 Introduction To ProfiBus DP
__________________________________________________________________
To give you an idea of what a GSD file might look like, consider the
following partial GSD file taken from Acromag Model 983PB-2012.
#Profibus_DP
GSD_Revision =1 ; Version of the GSD file
Vendor_Name = “Acromag, Inc.” ; Vendor name
Model_Name = “983PB-2012” ; Product name
Revision = “A”
Ident_Number = 0x06F1 ; Ident Number
Protocol_Ident =0 ; ProfiBus DP Only (1-DP/FMS)
Station_Type =0 ; Type of device (Slave)
Hardware_Release = “A” ; Hardware version of the device
Software_Release = “A” ; Software version of the device
;
9.6_supp =1 ; 9600bps Supported
19.2_supp =1
93.75_supp =1
187.5_supp =1
500_supp =1
1.5M_supp =1
3M_supp =1
6M_supp =1
12M_supp =1
MaxTsdr_9.6 = 60 ; Maximum response time
MaxTsdr_19.2 = 60 ; at different baud rates.
MaxTsdr_93.75 = 60
MaxTsdr_187.5 = 60
MaxTsdr_500 = 100
MaxTsdr_1.5M = 150
MaxTsdr_3M = 250
MaxTsdr_6M = 450
MaxTsdr_12M = 800
;
Redundancy =0 ; Redundancy Not Supported
Repeater_Ctrl_Sig =2 ; Includes RTS Support w/TTL
Implementation_Type = “SPC3” ; Uses Siemens SPC3 ASIC
24V_Pins =0 ; Does Not Include 24V
Fail_Safe =1 ; Supports Fail-Safe Mode
Freeze_Mode_supp =1 ; Supports FREEZE
Sync_Mode_supp =1 ; Supports SYNC
Auto_Baud_supp =1 ; Includes Auto Baud Detection
Set_Slave_Add_supp = 1 ; Addr can be set via ProfiBus
User_Prm_Data_Len = 3
User_Prm_Data = 0x00,0x00,0x00 ; Module Specific Parameters
; 00H = Set outputs to 0
; 01H = Maintain Last Output Values
; 02H = Set output to user-defined values in bytes 1 and 2
; Byte 1 is the lower byte of user-defined output data which is outputs 0 to 7
; Byte 2 is the upper byte of user-defined output data which is outputs 8 to
11
;
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 17
REQUIRED SOFTWARE
Slave_Family = 3
Min_Slave_Interval = 1 ; Min_Slave_Interval is 100us
Modular_Station = 0 ; 0-compact, 1-modular
Max_Diag_Data_Len = 6 ; No User Diagnostics are Sent
; I/O Byte
Module = “12 CH DIG I/O:xxxx1198 76543210” 0x11,0x21
EndModule
;
Recall that the master parameter record contains all the required data
for the bus system, including an address allocation list and the bus
parameters of the connected slaves. The address allocation list assigns
each remote I/O byte a unique address in the I/O space of the master’s I/O
space.
The configuration software utilizes the GSD files (device master data)
of the connected slaves to create the master parameter record. This record
is typically transferred or downloaded to the class 1 master from floppy disk,
dual port RAM, or Flash EPROM. Typically, if you need to add another
slave to an existing system, you simply upload the current master
parameter record, add the new parameterization data for the slave
(imported from the GSD file), then download the new master record to the
master again. Since an active bus station automatically detects a new
active bus station, you can then perform a reset, and the bus system will
reconfigure itself.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 19
PROFIBUS DP TYPES OF
DATA CHARACTER TRANSMISSION
FORMAT
With SRD, data is sent and received in one telegram cycle. That is,
the master sends output data to the slave and receives input data from the
slave in its response (if applicable) within a specified period of time. The
important thing to remember about this service, is that a master may send
output data to a slave and request input data from the slave in its response,
all in a single telegram cycle. This is the transmission service most often
used in ProfiBus DP that makes the data exchange very efficient for mixed
I/O devices.
(more than 1 byte), the high byte is transmitted first, followed by the low
byte (Big-Endian/Motorola format).
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 21
PROFIBUS TELEGRAM ProfiBus Data Error
(MESSAGE) Checking
STRUCTURE
With even parity checking, the number of 1 bits in the data portion of
each character frame is counted. Each character contains 8 bits. The
parity bit will then be set to a 0 or 1, as required in order to result in an even
total number of 1 bits. For example, if a character frame contains the
following eight data bits: 1100 0011, then since the total number of 1 bits is
4 (already an even number), the frame’s parity bit will be set to 0 for even
parity.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
22 Introduction To ProfiBus DP
__________________________________________________________________
Start Delimiter (SD)
DP MASTER
REQUEST FRAME DP SLAVE
TRAILER OUTPUT DATA HEADER
TELEGRAM CYCLE
Immediate
Response
REPONSE FRAME
HEADER INPUT DATA TRAILER
33Tbits
Idle Time
TELEGRAM CYCLE w/FRAME
LE
SD2 LE SD2 DA SA FC DU FCS ED
rep
Data telegram with variable data length. Used in SRD service (Send
and Request Data with acknowledge) which allows output data to be sent
and input data to be received in one telegram cycle.
No Start Delimiter
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
24 Introduction To ProfiBus DP
__________________________________________________________________
Length of Telegram Destination
Function Code
Address
or &
(LE & LEr) SourceControl
Frame Address(FC)
(DA & SA, 00H..7FH)
This byte specifies the length of a telegram with variable data length
(i.e. SD2 Telegrams) from the DA byte to the end DU byte (range is DU+5b
to 249). Note that the length of the DU is generally limited to 32 bytes, but
the standard allows for lengths up to 244 bytes. LE is repeated in the LEr
field for redundant data protection.
The Function Code (FC) or Frame Control field specifies the type of
telegram (request, response, acknowledgement), type of station (passive or
active/slave or master), priority, and telegram acknowledgement (successful
or unsuccessful) as follows:
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
26 Introduction To ProfiBus DP
__________________________________________________________________
Service Access Points Data Unit
Frame Check
(DU)Sequence
(SSAP & DSAP) (FCS)
SAP SERVICE
Default SAP=0 Cyclical Data Exchange (Write_Read_Data)
SAP54 Master-to-Master SAP (M-M Communication)
SAP55 Change Station Address (Set_Slave_Add)
SAP56 Read Inputs (Rd_Inp)
SAP57 Read Outputs (Rd_Outp)
SAP58 Control Commands to a DP Slave (Global_Control)
SAP59 Read Configuration Data (Get_Cfg)
SAP60 Read Diagnostic Data (Slave_Diagnosis)
SAP61 Send Parameterization Data (Set_Prm)
SAP62 Check Configuration Data (Chk_Cfg)
SAP55 is optional and may be disabled if the slave does not provide
non-volatile storage memory for the station address. Note that SAP’s 56,
57, and 58 are not enabled until the DP slave assumes the Data_Exchange
state. SAP’s 59, 60, 61, and 62 are always enabled.
Note that the DSAP & SSAP entries in a request telegram are also
included in the response telegram, where DA + SA + DSAP + SSAP in the
response message corresponds to SA + DA + SSAP + DSAP in the request
telegram (content position flips).
This field contains the data for the station at DA (request data), or the
data for the station at SA (response data). DU is generally limited to 32
bytes, but the standard allows for lengths up to 244 bytes (assuming 11
bytes of header information for 255 bytes total).
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 27
to DU modulus 256. Checksum = (DA + SA + FC + DU) mod 256. This is
simply the bytes added together and divided by FFH (255). This is an
integrated function that is normally performed by the ProfiBus ASIC.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
28 Introduction To ProfiBus DP
__________________________________________________________________
End Delimiter (ED) Function
DP COMMANDStatus
FUNCTIONS
This byte identifies the end of a ProfiBus telegram and has a fixed
value of 16H.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 29
LE Data block length too large (Upload/Download)
NI Function not implemented.
EA Area too large (Upload/Download)
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
30 Introduction To ProfiBus DP
__________________________________________________________________
Function Status The address
OPERATING
Initial Power must be set to a
ON/Reset
STATES
valid address
AND APPLICABLE from 0-125 in
order for the slave to pass to
FUNCTIONS
the parameterization state.
Recall that a ProfiBus DP slave must pass through 3 other states prior
to the Data Exchange state: Power On/Reset, Parameterization, and I/O
Configuration. Each DP slave state and the related function telegrams are
described in the following paragraphs. Refer to EN 50170 Volume 2 for a
more detailed explanation.
In the initial state following power up, the slave initializes itself and
automatically detects the correct baud rate for communication. If a valid
address from 0-125 has been set, the slave will pass to the
parameterization state. However, if the slave’s address is set to 126 (the
default commissioning address), then the slave will await a
“Set_Slave_Address” telegram from a class 2 master to change its station
address before proceeding to the parameterization state. A class 2 master
can use SAP 55 (Set_Slave_Add) in a telegram header to change the
address of a slave following power-up, but only if the slave’s
Set_Slave_Address lock bit is clear and it has the default address of 126.
Recall that stations whose address cannot be set externally will have a
default address of 126 and this address can only be changed with a class 2
master device.
So that the slave address does not have to be reassigned after power-
up, this address is normally stored in non-volatile memory and uploaded
upon initialization, or it may be loaded from switches on the unit. If there
are several similar stations whose address cannot be set externally and
have a default address of 126, be sure to connect them to the network one
at a time in order to set their addresses.
The important point about initialization is that the slave address must
be set to a valid address from 0-125 (either through external switches or via
the Set_Slave_Address command from a class 2 master) in order for the
slave to pass from the initialization state to the parameterization state.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 31
for the purpose of commissioning. Acromag modules have external
switches for setting the slave address, but also support address changes via
the Set_Slave_Address command when the external switches are preset to
126 and the internal EEPROM address is also 126. If the unit is instead
powered-up with the external address switches set from 0-125, the
Set_Slave_Address request is refused with an RS error message. If the
unit is powered-up with the external address switches set to 126, then the
unit will retrieve its address from the internal EEPROM memory.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
32 Introduction To ProfiBus DP
__________________________________________________________________
Set_Slave_Add Telegram
SD LE LEr SD DA SA FC DSAP SSAP DU FCS ED
68H 09H 09H 68H XX XX X 37H 3EH X.. X 16H
(55) (62)
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 33
Parameterization
1
To unlock an Acromag module for address changes, set the external
switches to 255 (FFH) prior to applying power and this will clear the lock bit
and restore the internal EEPROM setting to 126. Next, simply set the
switches as desired from 0-125, or to 126 if you intend to use the Set-
Slave_Address command, and re-power the unit.
After the slave completes its power-on initialization routine and its
address has been set to a valid address from 0-125, the slave will proceed
to await the Parameterization Telegram (Set_Prm) from the master which
serves to identify the master for the slave and specify the slave’s operating
mode. The slave address must already be set to a valid address from 0-
125 for a master to perform parameterization (Set_Prm). If the slave
address is instead set to 126, then it will await the Set Slave Address
command before proceeding. While awaiting the parameterization
telegram, a slave will reject all other telegrams except Slave_Diag or
Get_Cfg.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
34 Introduction To ProfiBus DP
__________________________________________________________________
Note that with SRD transmission, the DSAP specifies the Set_Prm
function (61) request, while the SSAP requests that the Chk_Cfg function
(62) follows (return response).
WD_On (Watchdog On): Set this bit to 1 to activate the watchdog control.
Refer to the Watchdog section for more information.
Freeze_Req (Freeze Mode Request): If this bit is set, the slave will
operate in the Freeze Mode as soon as the Global_Control function is
received. If a slave does not support the Freeze control, it sets the
Diag.Not_Supported bit within the diagnostic information.
Sync_Req (Sync Mode Request): If this bit is set, the slave will operate in
Sync Mode as soon as the Global_Control function is received. If a
slave does not support the Sync control, it sets the
Diag.Not_Supported bit within the diagnostic information.
Unlock_Req (Unlock Request): See Table below.
Lock_Req (Lock Request): See Table below.
Lock Unloc
Bit 7 k Bit 6 Description
0 0 The Min TSDR parameter may be changed. All other
parameters remain unchanged.
0 1 DP Slave is unlocked/released for other masters.
1 0 DP Slave locked for other masters. All parameters are
accepted and can be carried over (except min T SDR = 0).
1 1 DP Slave is unlocked/released for other masters.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 35
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
36 Introduction To ProfiBus DP
__________________________________________________________________
Byte 4 sets the minimum TSDR time (in bit time, 11-255) a slave will wait
before it is allowed to send a response to the master. If 00H is specified,
the previous or default value is used.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 37
I/O Configuration
The first 7 bytes of Set_Prm are evaluated by the slave’s ASIC (without
user-prm_data) and in accordance with the standard, or the first 8 bytes
(with Spec_user_prm_data). For Acromag slaves, the eighth byte is used
for SPC3 related characteristics. The remaining bytes are available to the
application.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
38 Introduction To ProfiBus DP
__________________________________________________________________
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 39
A ProfiBus master can scan the configuration of the input/output data
with the Read_Cfg telegram, and then configure the slave with Chk_Cfg.
The slave response must contain a configuration with which the slave can
actually boot.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
40 Introduction To ProfiBus DP
__________________________________________________________________
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 41
The master evaluates the diagnostic information to determine if the
parameterization and configuration info is correct. If no further diagnostic
service is required, the master proceeds to exchange data with the slave.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 43
Diag_Data Response Telegram DU Byte 3 – Station_status_3
Bit DIAGNOSTIC
0-6 Reserved.
7 Diag.Ext_Diag_Overflow: Set if there is more diagnostic
information than specified in Ext_Diag_Data. For example, slave
sets if slave has more diagnostics than it can enter into its send
buffer. Set by master if slave sends more diagnostic information
than it can enter into its diagnostic buffer.
Diag_Data Response Telegram DU Byte 4 (Para Master Address)
Bit DIAGNOSTIC
0-7 Diag.Master_Add: The master’s address that parameterized this
slave is entered here. If no master has parameterized this slave,
then the DP Slave inserts 255 here (FF without parameterization).
Diag_Data Response Telegram DU Byte 5 - Ident_Number High Byte
Bit DIAGNOSTIC
0-7 Manufacturer Identification Number High byte for ID & verification
Diag_Data Response Telegram DU Byte 6 - Ident_Number Low Byte
Bit DIAGNOSTIC
0-7 Manufacturer Identification Number Low byte for ID & verification.
Device-Related Diagnostic
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
44 Introduction To ProfiBus DP
__________________________________________________________________
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 45
Channel-Related Diagnostic
This diagnostic structure is used for pre-defined failure types with specific
identifiers used to identify the specific faults. Fault definitions can be
defined per module and per channel. Additional device-specific definitions
are also possible. In this block beginning at DU byte 7, the diagnosed
channels and diagnostic reasons are entered in sequence, one at a time,
with 3 bytes per diagnostic entry according to the following format:
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
46 Introduction To ProfiBus DP
__________________________________________________________________
The following bits are taken from the diagnostic information bytes
above and treated as follows:
There are three diagnostic bits that can be driven by the application:
STAT_DIAG, EXT_DIAG, and EXT_DIAG_OVERFLOW.
The slave sets this bit when more diagnostic data is available than will
fit into the area provided for diagnostic data. For example, more channel
diagnostic data may be present than the sending buffer or the receiving
buffer of the master can hold.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 47
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
48 Introduction To ProfiBus DP
__________________________________________________________________
Data Exchange State
Recall that with data exchange, the telegram header has only nine
bytes since the default SAP is used and the DSAP & SSAP bytes are
dropped from the telegram header. This is indicated by the most significant
bit of the DA & SA bytes which are clear (0). If the MSB is set to 1 in the
DA & SA bytes, this indicates a DSAP & SSAP follows in the telegram
header. The DU contains from 1 to 244 bytes of user data to be transferred
(output data and/or input data).
In Data_Exchange mode, any master can read the I/O data of any
slave at any time using the “Read_Inputs” and “Read_Outputs” telegrams.
These telegrams have the same structure as the cyclic Data_Exchange
telegram, but include the DSAP and SSAP bytes. For these telegrams, the
MSB of the DA & SA bytes will be set to “1” to indicate that a DSAP &
SSAP byte follows in the telegram header.
The master can use this telegram to asynchronously read the input
data (Inp_Data) of any slave in Data_Exchange mode.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 49
SD LE LEr SD DA SA FC DSA SSA FCS ED
P P
68H 05H 05H 68H 8x 8x X 38H 3EH X 16H
(56) (62)
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
50 Introduction To ProfiBus DP
__________________________________________________________________
The response telegram format is the same as noted above, but with
the DSAP/SSAP mirrored (swapped) and the DU bytes embedded.
The response telegram format is the same as noted above, but with
the DSAP/SSAP mirrored (swapped) and the DU bytes embedded.
Global_Control Telegram
SD LE LEr SD DA SA FC DSA SSA DU FC ED
P P S
68H X X 68H 8x 8x X 3EH 3AH X.. X 16H
(62) (58)
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 51
Unsync: This control cancels the sync command.
Freeze: This causes the states of the inputs to be read and frozen until the
next Freeze command or Unfreeze. Slaves must ensure that following
a freeze command, the last frozen values of the inputs must be
transferred in the next data exchange cycle.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
52 Introduction To ProfiBus DP
__________________________________________________________________
Sync & Freeze are optional slave services and may not be supported
by some slaves. A master uses a Freeze telegram to make a slave or
group of slaves freeze their inputs in the current state. A Sync telegram
causes the output data currently available to be transferred to the outputs,
to be frozen. An Unsync & Unfreeze command will cancel this state. The
Clear Data service allows the outputs to be switched to a defined state if an
error occurs. The response parameter Status can be tested to indicate
whether transmission of the request frame was successful or not, with
possible values of: OK, DS, NO, and IV.
Use of Freeze
After the master receives this data, the master sends an Unfreeze
command to the group and the bus system returns to the normal data
exchange mode again, and all input changes are transferred during each
data cycle.
Use of Sync/Unsync
After the data is frozen with a Freeze command and has been
processed by the master, the master reacts by sending a sync command to
the slave group to obtain the outputs. During the next data cycle, the
master supplies the slave group with the data to be output, then concludes
this cycle with an unsync command in the following data exchange cycle.
Unsync causes the slaves to transfer their outputs at a precise time.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 53
BUS TIMING
Unlike CAN and Ethernet which are event-driven busses, ProfiBus was
designed to guarantee a deterministic response.. The determinism of a
system refers to the ability to precisely predict the behavior of the system
over time.
Slave Reaction Time (TSDR): The reaction time is the time it takes a slave
to respond to a message. This time is often expressed as a minimum value
(min TSDR), or maximum value (max T SDR). Min TSDR is set within the
parameterization telegram during startup. Max T SDR varies with the
transmission rate and is specified at the supported baud rates within the
device GSD file. For ProfiBus DP, this value may range from a minimum of
11Tbits (min TSDR default) to a maximum of 255Tbits.
Initiator Delay Time (TSDI): TSDI refers to the station delay of the initiator of
a request or token frame (the master).
Initiator Idle Time (TID1): After receiving the last character of a telegram,
the initiator must wait this amount of time until it sends the next telegram.
The idle time (Tid1) is the time between transmission of the last bit of a
frame (no acknowledge) and the transmission of the first bit of the next
frame. It is at least the sync time (T SYN), plus some safety margin (Tsm),
but is also calculated as the maximum of these three values: T SYN + Tsm,
min TSDR, or TSDI (station delay of telegram initiator). The addition of safety
margin (Tsm) is very important at high baud rates.
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
54 Introduction To ProfiBus DP
__________________________________________________________________
Minimum Slave Interval: The minimum slave interval is the minimum time
that must expire between two slave polling cycles in which a slave can
exchange data with the master. To permit the slave station to be able to
respond during every data cycle, it controls the bus cycle with this
parameter. It is defined in the slave’s GSD file via the parameter
Min_Slave_Interval, which is specified as a 16 bit factor of 100us
(Min_Slave_Interval = 1 is 100us). On some older equipment, the ProfiBus
link was implemented in software (as opposed to within the slave ASIC) and
a typical value was about 2ms. On newer equipment with modern ASIC’s,
values down to 100us can be achieved.
Example: One master and 5 slaves are connected via ProfiBus DP. Ten
bytes of output data and 20 bytes of input data are to be transferred per
slave at 12Mbps. Each slave utilizes an SPC3 ASIC. Calculate the relative
bus cycle time for this network.
Given:
TSYN = 33 TBits (Bus idle time or ProfiBus Sync-Time)
TID1 = 75 TBits (SPC3 bus idle time, at 1.5MB T id1 = 36 TBit).
TSDR = 30 TBits typical for baud rates ≥ 1.5MB (SPC3 ASIC).
Min_Slave_Interval = 1 (100us, from slave GSD file).
Calculate:
1 Tbit (Bit Time) at 12MB = 1/12000000bps = 83ns/bit
TMC (in TBits) = 2 * 9(header byte length) * 11bits/byte + T SDR + TSYN + Tid1
TMC = 198 bits + 30 bits + 33 bits + 75 bits = 336 Tbits
TMC (us) = 336Tbits * 83ns/Tbit = 28us
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 55
HIGH SPEED
REQUIREMENTS
Thus, 28us is the basic time required by the telegram header including
the bus times without accounting for the data. For our example, we must
include the data (10 bytes Output + 20 bytes Input). Recall that the SRD
service (Send and Request Data with acknowledge) will send data to the
outputs and receive data from the inputs in one telegram cycle. The time
for a single telegram cycle with this data included is:
To simplify this calculation, you can assume that a basic transfer time
of 28us plus approximately 1us per DU data byte (actually 0.83us/byte) is
required to complete a telegram cycle. The following figure gives an
overview of the dominant bus times in a telegram cycle (assuming no
interference or repetitions).
DP MASTER DP SLAVE
33Tbits (Header Bytes + Output Data Bytes) * 11bits/byte (11-255 Tbit)
Please note the following for communication at baud rates greater than
1.5Mbps:
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
56 Introduction To ProfiBus DP
__________________________________________________________________
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
Introduction To ProfiBus DP
___________________________________________________________________ 57
Notes:
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com
58 Introduction To ProfiBus DP
__________________________________________________________________
_______________________________________________________________________________________
Acromag, Inc. Tel:248-624-1541 Fax:248-624-9234 Email:sales@acromag.com
http://www.acromag.com