Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Dec 19, 2008

Profibus Overview

3 ratings | 5.00 out of 5
Read in | Print

Overview

PROFIBUS is an open, vendor-independent protocol that became part of the international standard IEC 61158 in 2000. Over time, it has been extended into new application areas by working groups of employees from companies that have similar products and target application areas.

PROFIBUS

 Profibus extensions have always been developed under the requirement that they ensure “backward compatibility”. Figure 1 lists the extensions that have been standardized in the past few years.

 


[+] Enlarge Image

Figure 1: PROFIBUS DP Extensions

 

PROFIBUS DPV0 is the foundation for PROFIBUS and was the first version after FMS (Field Message Specification). DPV0 came from optimizations to FMS, the original PROFIBUS protocol, to support fast I/O data exchange.

PROFIBUS DPV1 added extensions that allowed run-time reading/writing of parameters for more sophisticated devices such as intelligent drives, for example, and PROFIBUS PA field instruments, such as valve positioners, pressure transmitters, and so on.

PROFIBUS DPV2 added extensions primarily, so that motion-control applications can be performed directly across PROFIBUS rather than requiring a secondary motion-control bus.

 

Master/Slave Concept

PROFIBUS DP (Decentralized Peripherals) is a network that is made up of two types of devices connected to the bus: master devices and slave devices. It is a bi-directional network, meaning that one device, a master, sends a request to a slave, and the slave responds to that request. Thus, bus contention is not a problem because only one master can control the bus at any time, and a slave device must respond immediately to a request from a master.

Since a request from a master to a slave device is heard by all devices attached to the bus, some mechanism must exist for a slave device to recognize that a message is designated for it and then respond to the sender. Hence, each device on a PROFIBUS network must have an assigned address. For specifying the address, most devices have either rotary switches (decimal or hexadecimal) or DIP switches. Some few devices require that their address be set across the bus using a configuration tool.

The PROFIBUS protocol supports addresses from 0 to 127. However, addresses 126 and 127 have special uses and may not be assigned to operational devices. Address 0 has become something of a default address that vendors assign to network configuration and/or programming tools attached to the bus.

Thus, the addresses that may be used in practice for operational are 1 to 125.

 

Device and System Startup

The user specifies which slave devices the master should find on the bus as well as what information is to be transferred from the master to each slave during this startup phase. All of the information that the master must know to start up the bus comes from a configuration database file that is generated by a PROFIBUS configuration tool. Each vendor of PROFIBUS master devices offers a configuration tool for generating the database file for their masters. However, once one has learned how to use any of these tools, it is generally quite easy to transfer this knowledge to another tool because all PROFIBUS configuration tools must share certain common functionality. A configuration tool for cyclic I/O operation must be able to do the following:

  • process GSD (device description) files and maintain a hardware catalog of devices to be configured on the bus
  • allow the PROFIBUS device address to be specified
  • allow the specification of the input and out-put data to be transferred between master and slave
  • allow certain startup parameters to be selected in order to activate specific operating modes or features of the device
  • allow selection of the system baud rate
  • generate the database file so it can be used by the master

 

At the same time a vendor develops a slave device, it must develop a device description (GSD) file. This file completely describes the PROFIBUS functionality of the device for example; baud rates supported, possible input/ output data configurations, startup parameter choices, and so on.

These GSD files can typically be downloaded via the Internet either from www.profibus.com or from an individual vendor’s web site. Once you “install” the GSD file for a device into the PROFIBUS configuration tool, it will appear in the tool’s hardware catalog, which enables it to be configured for bus operation.

The installation process varies for different configuration tools, although it is extremely simple in any case.  Once all the appropriate GSD files are installed into the configuration tool, you can define a bus configuration.  

You first pick the appropriate master from the master device list in the hardware catalog and assign a PROFIBUS address.  You repeat the following steps until the entire bus configuration has been described:  Select a slave device, assign the PROFIBUS address, specifies the I/O to be exchanged, and select the appropriate parameters for the desired operation of the device. You then save this bus configuration and generate the configuration database. You can now load this configuration database into the master device.

After download, the master has the information necessary to start up all the devices in its configuration. This information is stored in retentive memory. The master must now determine if the devices at the assigned addresses contained within the configuration database are physically on the bus and initialize them for “operational” or “data-exchange” mode.  To get the devices into this mode a PROFIBUS master goes through a well-defined sequence of interactions with each of the slave devices in its bus configuration.  For instance, if the master device experiences a power loss, when it powers back up it uses the configuration data- base in retentive memory to go through the startup sequence with each device in its configuration to get all devices back into operational mode. If a slave device fails and must be replaced, the master recognizes that a replacement device of the same type and with the same PROFIBUS address has been attached to the bus. When it does, it goes through this same startup sequence and automatically brings the device into operational mode.

 

Cyclic I/O Data Exchange

After the bus system has been powered and initialized the normal interaction between a master and each of its assigned slaves is to exchange I/O data. The master, a PXI PROFIBUS interface, for example, sends output data to a slave device in its configuration. The addressed slave immediately responds with its input data. This cyclic (repeated) I/O data exchange takes place asynchronously to the control logic scan and is repeated as quickly as possible. Data exchange takes place every cycle for every slave in a master’s configuration. At the most commonly used baud rate of 1,500kbit/s, data-exchange cycles are normally repeated many times during a single control-logic scan.

Although 85 percent or more of PROFIBUS installations are single-master systems, multi-master systems exist and work quite well. In such a system, each master is given control of the bus for a short time and during this time it exchanges I/O data with each of its assigned slaves. It then passes control to the next master on the bus, via a short message called a “token”, and that master exchanges I/O data with each of its slaves. Only the master holding the token is allowed to initiate communication to its slaves. Once the last master in the “logical token ring” has gone through its data-exchange cycle, it passes control back to the first master, and the overall operation starts again.

 

Device Diagnostic Reporting

The PROFIBUS protocol offers quite extensive diagnostic capabilities that device vendors can design into their products. PROFIBUS offers the capability to diagnose an operations problem all the way down to, for example, an overvoltage on an analog input or a broken wire on an output.

During a data-exchange cycle, a PROFIBUS slave device can indicate to the master that it has detected a diagnostic condition. In the next data-exchange cycle, the master fetches the diagnostic information from the slave. A device can report diagnostic information in four different formats: standard diagnostics, device-related diagnostics, module-related diagnostics, and channel-related diagnostics.

Any PROFIBUS master must save any diagnostic data from a slave in order for your control program to access it. The standard diagnostics (six bytes) that every slave device is required to report contain information that is generally related to startup problems.  For example, if the I/O configuration that was set up in the configuration tool does not match what the slave expects, it will report a “configuration fault.” If you have configured a slave device in your configuration file, but the slave actually found on the bus at that address is different, the device will report a “parameterization fault.” The six standard diagnostic bytes are used to report faults that are common across all slave devices.

A vendor can use the device-related diagnostics format to report information that may be specific to the particular device or application area, and that cannot be reported using the standard module-related or channel-related diagnostic formats.  The format of this type of diagnostic information is defined by the vendor and its detailed structure is not covered in the PROFIBUS standard. Therefore, you must check the device’s documentation to determine the exact format. Module-related diagnostics are used to report diagnostics for a modular slave that is, one that consists of an “intelligent” head module plus plug-in modules. This format gives the head module the capability to report that a particular plug-in module has a diagnostic. It does not tell us what the diagnostic is, just that a particular module has a problem. The format for module-related diagnostic information is defined in the PROFIBUS standard. This means that once a logic block is constructed to decode this type of diagnostic information, the decode logic will work for any device from any vendor that reports module-related diagnostics.

The last type of diagnostic block is used to report channel-related diagnostics. A device can use this format to report that an individual channel of a specific module has a problem, for example, short circuit, wire break, overvoltage, and so on.  This makes it very easy to diagnose the problem right down to the wire level! The format for this type of diagnostic information is also defined in the PROFIBUS standard. The exact formats of these different diagnostic information blocks will be presented in Appendix A.

 

Programming Model

The “Comsoft” PROFIBUS package includes standard VIs to initialize the PROFIBUS and to access the DP-Slave I/O and diagnostic data. The LabVIEW Examples and Context Help should be referred to for further details.

 

PROFIBUS-DP Master API

Basic API

  • The Init, Abort VI initializes and closes the DP- Master interface handle and delivers the Slave Poll List.
  • The Master Proscess Data VI makes the data exchange with a single or multiple Slaves as shown in Figure 2.


[+] Enlarge Image

Figure 2: DP- Master API

 

Express VI

  • For  an  easy  access  to  a  single  DP-Slave  a  PROFIBUS-DP-Master  Express VI is available. When the Express-VI is placed onto the block diagram a configuration dialog opens to enter the DF PROFI II board and the PROFIBUS address of the DP-Slave
  • The Monitor/Modify-Tab shows the input and output data as well as the communication status of the DP-Slave. The output data can be modified by clicking directly in the value field and entering new data. The data must be entered in the same format as displayed, otherwise it will be ignored.
  • The Diagnostic-Tab shows the diagnostic data transmitted by the DP-Slave. The data is displayed in clear text for the standard PROFIBUS diagnostic data and in hexadecimal format for the extended diagnostic data.

 

PROFIBUS-DP Slave API

Basic API

  • The Init, Abort VI initializes and closes the DP- Slave interface handle and configures the Slave Memory.
  • The Slave I/O Data VI makes the data exchange with a single Master as shown in Figure 3.

Figure 3: DP- Slave API

 

 

Express VI

  • For  an  easy  access a Profibus DP-Slave Express VI is  available. If dropping  the Express-VI  to  the block diagram a dialog opens to configure the DP-Slave. Select  the DF PROFI II board, the Profibus address of the DP-Slave and the Baud rate.
  • The Configuration-Tab shows the supported slave modules. The selected module must correspond with the Profibus master configuration.
  • The The Monitor/Modify-Tab shows the input and output data as well as the communication status of the DP-Slave. The output data can be modified by clicking directly in the value field and entering new data. The data must be entered in the same format as displayed, otherwise they will be ignored.

 

Frequently Asked Questions

1.    Which PROFIBUS DP functionality is supported by the “Comsoft” DF PROFI II board?

DPV0 Master Class 1/ 2

DPV0 Slave

DPV1 Master Class 2

Hardware Watchdog

Process data image with time stamp

 

2.    What is the PIN assignment of the DF PROFI II Sub D9 plug?

PIN1 >>          Shield

PIN3 >>          RxD/ TxD-P >>          Data Input / Output

PIN5 >>          0V >>                        Bus Termination supply

PIN6 >>          5V >>                        Bus Termination supply

PIN8 >>          RxD/ TxD-N >>           Data Input/ Output

 

3.    What is the DF PROFI II LED configuration?

Green LED >> ON   >>         Firmware successfully loaded

                        OFF  >>         Firmware not loaded

 

Yellow LED >> ON   >>         PROFIBUS started

                        OFF  >>         PROFIBUS stopped

 

Red LED    >>  ON   >>         Failure on PROFIBUS

                        OFF  >>         NO Failure on PROFIBUS

 

4.    Why is termination important?

Termination prevents reflections that can disturb the data communication. The higher the baud rate and the longer the cable, the more important termination becomes. Termination should be activated/ placed at both ends of every bus segment. With PROFIBUS DP the termination is powered to provide an idle level when nobody is sending data.

A lot of people are aware that termination has to be powered and placed at both ends cable. What they do not know, is that it has to be placed again when you are using repeaters, OLMs (Optical Link Modules) or Profihubs. Every segment has to be terminated. This often slips in when people are using a lot of fiber optic and there is only a short length of copper cable in the cabinets. But even this short cable has to be terminated at both ends.

 

5.    Can you give some basic tips for installing a PROFIBUS DP?

  • Always use PROFIBUS cable and connectors.
  • Do not exceed 32 devices per segment (including repeaters, OLMs and couplers).
  • Make sure the segment length is in contrast with the baud rate.
  • Make sure every segment has powered termination on both ends.
  • Avoid spur lines.
  • Avoid swapping the wires (A=green, B=red).
  • Mark how long the cables really are and update the drawings.
  • After installation you should test your work:
  • Are the addresses correctly set?
  • No short circuit or break in the cable?
  • Can you communicate with the devices?

6.    What is the minimum distance between 2 devices on PROFIBUS DP?

When the transmission speed is 1.5 Mbps or higher, it is highly recommended to have at least 1 m of cable between 2 devices. The cable will compensate for the input capacitance of both devices in order to preserve the common impedance. When the devices are very close together, there is a large chance that reflections in the data communication (small short circuits) could be caused by the input capacitance. The effect is much less common at transmission speeds lower than 1.5 Mbps.

 

7.    How many DP slaves can be configured in a network?

Most people say 126, but this is NOT true! The total number of DP slaves that can be put in data-exchange is 124, because of the master uses an address and there are reserved addresses, 0 and 126, (these are blocked by the configuration tool).

Be careful:

  • Address 2 could also be blocked for slaves.
  • The master itself can have a limit.

8.    How Can I control the outputs of 1 slave with 2 masters (PLCs)?

This is not possible. Only 1 Master has the right to control the outputs of each specific slave (safety feature). The 2nd Master can only READ the inputs/outputs.

 

Related Links:
“Comsoft” DF PROFI II Installation and MAX Configuration

3 ratings | 5.00 out of 5
Read in | Print

Reader Comments | Submit a comment »

well written you took a completed topic and made it simple
- Feb 10, 2009

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).