Back
Loading views...PROFIBUS
PROFIBUS
Category: Industrial
Overview
PROFIBUS (Process Field Bus) is a widely deployed industrial fieldbus standard for automation, developed by Siemens and partners in 1987. PROFIBUS DP (Decentralized Periphery) is the most common variant, used to connect PLCs to distributed I/O modules, drives, and sensors in manufacturing.
1. Theory & Fundamentals
- RS-485 physical layer (9-pin D-Sub connector)
- Speed: 9.6 kbps to 12 Mbps (distance-dependent)
- Protocol: Master-slave with token ring for multi-master
- PROFIBUS DP: Fast cyclic data exchange (PLCs to I/O)
- PROFIBUS PA: For process automation; uses IEC 61158-2 physical layer
- GSD file: Device description file; defines device parameters and data formats
- Max distance: 100m at 12Mbps; 1200m at 93.75kbps
2. Frame / Packet Structure
PROFIBUS DP Frame:
SD (Start Delimiter) | LE | LEr | SD | DA | SA | FC | DSAP | SSAP | DU | FCS | ED
SD options: 0x68=Variable, 0x10=Short, 0xA2=Token, 0xDC=SD4
LE: Length (including DA, SA, FC, DSAP, SSAP, DU)
DA: Destination Address (0=master, 1โ126=slave, 127=broadcast)
SA: Source Address
FC: Frame Control (request type, retry flag, frame type)
FCS: XOR checksum of DA through DU
ED: 0x16 (End Delimiter)
DP-V0 Cyclic Data:
Master sends Output data to slave; slave returns Input data
Max 244 bytes each direction per slave
3. Protocol Mechanics
- Token passing: Multiple masters share bus; only token holder can initiate
- Cyclic exchange: DP master polls each slave every bus cycle
- Acyclic: DP-V1 adds acyclic read/write for parameterization
- Slave states: STOP, CLEAR, OPERATE
- Watchdog: Slave enters FAIL-SAFE if master absent beyond watchdog time
4. Hardware Implementation
- Transceiver: SN75ALS176, RS-485 compatible
- Termination: Active termination (VP+resistor network) at both ends
- Cable: PROFIBUS DP cable (violet, shielded); 150ฮฉ impedance
- Connector: 9-pin D-Sub; PROFIBUS standard pinout
- ASIC: SIEMENS SPC3, Hilscher netX for PROFIBUS slave implementation
5. Register-Level / Configuration
// PROFIBUS DP slave using SPC3 ASIC
// Configure via SPC3 registers
SPC3_Write(CFG_DATA_ADDR, 0x02); // Cfg data length = 2
SPC3_Write(INPUT_DATA_ADDR, 0x06); // 6 bytes input
SPC3_Write(OUTPUT_DATA_ADDR, 0x04); // 4 bytes output
// Main loop: check for new output data from master
if(SPC3_NewOutput()) {
SPC3_ReadOutput(output_data, 4);
ProcessOutput(output_data);
// Prepare input data for next cycle
PrepareInput(input_data);
SPC3_WriteInput(input_data, 6);
}
6. Driver / Software Development
- Most implementations use dedicated ASIC (SPC3, netX, HMS Anybus)
- GSDML/GSD file: Define device identity, module types, default parameters
- Acyclic DP-V1: MS0 (master initiated) and MS1 (slave initiated) services
7. Debugging & Testing
- ProfiTrace: PROFIBUS protocol analyzer
- Siemens STEP 7 / TIA Portal: PLC-side PROFIBUS configuration
- Common issues: Missing termination; wrong baud rate; address conflict; GSD file version mismatch
- Scope: Check RS-485 differential signal quality and voltage swing
8. Real-World Applications
- PLC to distributed I/O in automotive assembly lines
- Drive inverter control (Siemens MICROMASTER, ABB ACS)
- Process instrumentation (transmitters, valves)
- Safety-integrated drives (PROFISAFE over PROFIBUS)
- Robot controller integration
9. Advanced Topics & Edge Cases
- PROFISAFE: Functional safety (SIL 2/3) layer over PROFIBUS
- DP-V2: Added isochronous mode for time-critical applications
- PROFIBUS to PROFINET migration: Gateway devices available
- Redundancy: PROFIBUS can be configured with redundant master
10. Standards & Variants
| Variant | Layer | Use |
|---|---|---|
| DP (V0/V1/V2) | RS-485 | Factory automation |
| PA | IEC 61158-2 | Process/hazardous area |
| FMS | RS-485 | Obsolete general purpose |
| PROFISAFE | Over DP | Safety functions |
๐ก Practical Examples
Example 1: Configure slave address
Set rotary switch or GSD parameter to unique address (1โ125).
Example 2: Cyclic I/O
Master sends 4-byte output (valve commands); slave returns 6-byte input (sensor values) every 5ms.
Example 3: Acyclic parameterization (DP-V1)
Master reads/writes device parameters (scaling, filter settings) without disrupting cyclic data.
๐งช Practice Questions
Beginner
- What physical layer does PROFIBUS DP use?
- What is the maximum number of PROFIBUS nodes?
- What is a GSD file?
- What is the maximum speed of PROFIBUS?
- What does DP stand for?
Intermediate
- Explain PROFIBUS token passing for multiple masters.
- How does PROFIBUS DP cyclic exchange work?
- What is PROFISAFE and how does it extend PROFIBUS?
- Configure a PROFIBUS DP slave with 4 input and 4 output bytes.
- How does termination affect PROFIBUS signal quality?
Advanced
- Implement a PROFIBUS DP slave using SPC3 ASIC.
- Design a PROFIBUS PA transmitter for hazardous area.
- Build a PROFIBUS to OPC UA gateway.
- Implement DP-V1 acyclic read/write for parameterization.
- Migrate existing PROFIBUS network to PROFINET.
Hands-on Projects
- DP Slave: SPC3 + STM32 PROFIBUS DP slave for 8-channel ADC.
- Drive Control: Control Siemens G120 drive speed over PROFIBUS.
- Analyzer: ProfiTrace capture + frame decode analysis.
Checklist
- [ ] Explain PROFIBUS DP architecture
- [ ] Understand GSD file structure
- [ ] Configure slave address and I/O sizes
- [ ] Implement cyclic I/O exchange
- [ ] Wire PROFIBUS with correct termination
- [ ] Debug with ProfiTrace
- [ ] Configure master in TIA Portal
- [ ] Implement DP-V1 acyclic access
- [ ] Integrate PROFISAFE concepts
- [ ] Build PROFIBUS slave with ASIC