Exercise 2: PROFIBUS - Universität Stuttgart
Exercise 2: PROFIBUS - Universität Stuttgart
Exercise 2: PROFIBUS - Universität Stuttgart
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Universität <strong>Stuttgart</strong><br />
Institute of Industrial Automation and Software Engineering<br />
Prof. Dr.-Ing. Dr. h.c. P. Göhner<br />
Introduction:<br />
<strong>Exercise</strong> 2: <strong>PROFIBUS</strong><br />
The <strong>PROFIBUS</strong> (PROcess FIeld BUS) was developed in the years 1987-1991 in a joint<br />
project by several companies and research institutes. <strong>PROFIBUS</strong> was designed primarily for<br />
fast data transmission on the actuator-sensor-level. But it also offers many powerful services,<br />
which make it suitable for the connection of intelligent control devices in a decentralized<br />
automation system.<br />
Bus media access control:<br />
The media access control (MAC) of the <strong>PROFIBUS</strong> shall fulfil two requirements: First, the<br />
real-time data transmission between complex automation devices (active stations) and simple<br />
decentralised process peripherals (passive stations) must be enabled. Second, for the<br />
communication between equal automation devices which have their own intelligence, it must<br />
be guaranteed that each station gets assigned enough time for its communication tasks.<br />
<strong>PROFIBUS</strong> uses a deterministic MAC method. Decentralised active stations access the bus<br />
medium according to the token-passing method, whereas a centralised master-slave method is<br />
used subordinately for the communication between an active station and passive stations (cf.<br />
Figure 1).<br />
Figure 1: The <strong>PROFIBUS</strong> hierarchy<br />
Master-Slave-Method:<br />
In the master-slave method, an active station (the master) controls the media access by<br />
explicitly giving a timely limited transmission right to the other stations (the slaves). This<br />
means that the slaves cannot access the bus by themselves, but only if they receive a request<br />
from the master. Thus, cyclical polling with a predictable response time can be easily<br />
implemented.
Industrial Automation Systems Theory <strong>Exercise</strong> 2: Profibus 12<br />
Token-Passing Method:<br />
In order to achieve the coordination between the active stations (master devices), a tokenmessage<br />
(special data frame) is passed on from one active station to the next (in order of the<br />
ascending addresses). The active station, which possesses the token at the moment, has the<br />
right to access the bus and to communicate with passive stations (slaves) or with other active<br />
stations. When it has finished its communication tasks, it passes on the token to the next<br />
station.<br />
In order to guarantee that each station can send data in any case after a maximum period of<br />
time, it is necessary to set a maximum period of time during which the token must have<br />
completely passed once through the logical ring. For this purpose, the target rotation time T TR<br />
is set during the configuration of the bus system. When a station receives the token, it<br />
compares the target rotation time with the measured real rotation time T RR . The station is<br />
allowed to send messages as long as the target rotation time is not exceeded. In any case the<br />
station has the right to send one message with high priority. Figure 2 depicts the message<br />
processing algorithm.<br />
reception of<br />
token<br />
T RR = real rotation time<br />
T TR<br />
= target rotation time<br />
yes<br />
T RR<br />
>T TR<br />
?<br />
no<br />
yes<br />
exists a message<br />
with high priority ?<br />
no<br />
yes<br />
exists a message<br />
with high priority ?<br />
no<br />
process 1<br />
message with<br />
high priority<br />
process<br />
message with<br />
high priority<br />
yes<br />
exists a message<br />
with low priority ?<br />
no<br />
no<br />
T RR<br />
>T TR<br />
?<br />
yes<br />
process<br />
message with<br />
low priority<br />
no<br />
T RR<br />
>T TR<br />
?<br />
yes<br />
pass on token<br />
Structure of data frames and data services:<br />
Figure 2: Message processing algorithm<br />
In order to increase the security of the transmission, <strong>PROFIBUS</strong> uses the data representation<br />
of the UART standard, i.e. one information byte is transmitted with 11 bit:<br />
ST 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7<br />
ST: start bit (always logical „0“)<br />
P SP
Industrial Automation Systems Theory <strong>Exercise</strong> 2: Profibus 13<br />
2 0 - 2 7 : information- bytes<br />
P: parity bit<br />
SP: stop bit (always logical „1“)<br />
Data transmission of the <strong>PROFIBUS</strong> is based on a standardized data frame formats. They are<br />
presented in the following:<br />
Data frame without data field<br />
SD1<br />
DA<br />
Data frame with fixed data field<br />
. .<br />
length<br />
.<br />
SD3 DA SA FC data field<br />
. . .<br />
FCS<br />
(8 bytes)<br />
Data frame with variable data field length<br />
. . .<br />
SD2 LE LEr SD2 DA SA FC data field FCS<br />
. . .<br />
(max. 246 bytes)<br />
Token frame<br />
SD4<br />
DA<br />
SA<br />
SA<br />
FC<br />
FCS<br />
ED<br />
ED<br />
ED<br />
SD1...SD4: Start Delimiter<br />
LE: Length<br />
LEr: Length (repetition)<br />
DA: Destination Address<br />
SA: Source Address<br />
FC: Frame Control<br />
FCS: Frame Check Sequence<br />
ED: End Delimiter<br />
<strong>PROFIBUS</strong> uses two services to transmit the data between master and slave devices. With the<br />
SDN service (Send Data with No acknowledge) the master can send data to the slave without<br />
waiting for a response (cf. Figure 3a). The SRD service (Send and Request Data with reply) is<br />
used to request data from a slave (cf. Figure 3b). The request frame can either contain data to<br />
be send to the slave or a data frame without data field can be used if data should be polled<br />
only.<br />
master<br />
slave<br />
master<br />
slave<br />
data frame<br />
request frame<br />
response frame<br />
immediate<br />
reply<br />
Figure 3a: SDN-service<br />
Figure 3b: SRD-service<br />
Bus length and baud rate:<br />
The maximum value of the permissible bus length of the <strong>PROFIBUS</strong> depends on the chosen<br />
baud rate:<br />
baud rate [kbit/s] 9.6 – 93.75 500 1500 12000<br />
max. bus length [m] 1200 400 200 100<br />
(Bibliography: Klaus Bender (Hrsg.): „Profibus, Der Feldbus für die Automation“, Hanser<br />
Verlag, 1990)