PROFIBUS DP

In PROFIBUS DP systems, a master (PLC, PC etc.) usually communicates with a large number of slaves (I/Os, drives etc.). Only the master may here actively access the bus (send telegrams on its own initiative), while a DP slave only sends telegrams when it is requested to do so by a master.

DP StartUp

Before the master and slave can cyclically exchange data, the parameter and configuration data is transmitted from the master to the slaves during the DP StartUp phase. After the parameter and configuration data has been sent, the master interrogates the slave's diagnostic data until the slave indicates that it is ready for data exchange. Depending on the extent of the calculations that the slave must carry out after receiving the parameter and configuration data, it can take up to a few seconds before it is ready for data exchange. For this reason the slave possesses the following states:

Parameter data

The parameter data is sent from the master to the slave in the SetPrmLock request telegram. The SetPrmLock response telegram does not contain any data, and therefore consists of a single byte, the short acknowledgement. The parameter data consists of DP parameters (e.g. the setting of the DP watchdog or checking the IdentNumber (unique to each DP device)), of DPV1-/DPV2 parameters and of application-specific parameters that only have to be transmitted once during the StartUp. If an error is found in the parameter data, this is indicated in the diagnostic data, and the slave either remains in or enters the WAIT-PRM state.

Configuration data

The configuration data is sent from the master to the slave in the ChkCfg request telegram. The ChkCfg response telegram does not contain any data, and therefore consists of a single byte, the short acknowledgement. The configuration data describes the assignment of the DP modules to the cyclic I/O data that is to be exchanged between the master and slave via the Data_Exchange telegram in the cyclic data exchange phase. The sequence of the DP modules added to a slave in the DP configuration tool determines the sequence of the associated I/O data in the Data_Exchange telegram.

Diagnostic data

The diagnostic data is requested by the master using a SlaveDiag request telegram without any data. The slave replies with the diagnostic data in a SlaveDiag response telegram. The diagnostic data consists of the standard DP diagnostics (e.g. the state of the slave, the IdentNumber) and of application-specific diagnostic data.

Cyclic data exchange

The heart of the PROFIBUS DP protocol is cyclic data exchange, during which the master carries out an exchange of I/O data with every slave during a PROFIBUS DP cycle. This involves the master sending the outputs to each slave with a DataExchange request telegram, while the slave replies with the inputs in a DataExchange response telegram. This means that all the output and/or input data is transmitted in one telegram, in which the DP configuration (the sequence of DP modules) specifies the assignment of the output and/or input data to the slave's actual process data.

Diagnosis during cyclic data exchange

A slave can send a diagnostics signal to the master during cyclic data exchange. In this case, the slave sets a flag in the DataExchange response telegram, whereby the master recognises that there is new diagnostic data in the slave. It then fetches that data in the SlaveDiag telegram. This means that diagnostic data is not transmitted to the controller with the cyclic I/O data in real-time, but is always at least one DP cycle later.

Synchronisation with Sync and Freeze

The Sync and Freeze commands in the GlobalControl request telegram (broadcast telegram) allow the master to synchronise the activation of the outputs (Sync) or the reading of the inputs (Freeze) in a number of slaves. When the Sync command is used, the slaves are first switched into Sync mode (a process that is acknowledged in the diagnostic data). The I/O data is then exchanged sequentially with the slaves in the DataExchange telegram. Transmitting the Sync command in the GlobalControl telegram then has the effect of causing the slaves to generate the most recently received outputs. In Freeze operation a Freeze command is first sent in the GlobalControl telegram, in response to which all the slaves latch their inputs. These are then fetched sequentially by the master in the DataExchange telegram.

States in the master

The master distinguishes between the CLEAR state (all outputs are set to the Fail_Safe value) and the OPERATE state (all outputs have the process value). The Master is usually switched into the CLEAR mode when, for instance, the PLC enters STOP.

Class 1 and Class 2 DP Masters

The Class 1 master refers to the controller that carries out cyclic I/O data exchange with the slaves, while a Class 2 master is a B&B device that generally only has read access to the slaves' I/O data.