Forum: µC & Digital Electronics Profibus Master

von Zen (Guest)

Rate this post
0 useful
not useful
There is a Profibus device DP-Slave (encoder), there is documentation on 
it, but it describes in detail how to connect it to the PLC and how to 
configure it using STEP7. I just need to connect it to the 

Maybe someone has already written Master code or maybe there are 
examples of data packets from master to slave with a description of the 
whole procedure?

von Bastler (Guest)

Rate this post
0 useful
not useful
If you need a DP-Master with just one Slave, this is possible.
You need one timer and one UART.
I did this for testing DP-Slaves on a STM8.
I`ll send some documentation and examples when I´m at home.

Or maybe you can use a Master-Simulator?
There is a cheap one on eBay. It works like a RS232 to DP-Master 
(B&N Elektronik Profibus DP Master Simulator)

von Zen (Guest)

Rate this post
0 useful
not useful
Thank you very much. I need just examples what I have to send to the 
I googled about Profibus frame structure but it's not clear for I need 
examples like
0x68 0x04 0x02 ...
where 0x68 is a start byte ...etc

von Ulrich K. (elektromechanikus)

Attached files:

Rate this post
0 useful
not useful
Hi Zen,

Profibus is not as easy as e.g. Modbus.
Your Master first reads the GSD file (kind of electronic data sheet) and 
with the information contained there and additional parameters you may 
enter ,then sends configuration data to your slave.
After that the master polls all connected devices (only one in your 
With different services the master now can read/write information 
from/to the slave device.

You have to know the structure of the data within your Profibus slave 
and the service to access them.

Without much deeper knowlege of Profibus, I don't think you will be able 
to write your own communication interface.
I have attached screen shots from an old Profibus specification (it is 
protected) which shall only indicate the complexity. The Profibus spec 
is part of an international standard and thus no longer available for 

You should look at technology companies which offer solutions in 
industrial communication (e.g. Hilscher, HMS, Molex). They have scalable 
solutions from  code to chip to modules.

I have done internal Profibus certification for a couple of years but 
all devices I have seen made use of a standard front-end from one of the 
above mentioned companies.

wish you best luck with your Profibus

von Bastler (Guest)

Attached files:

Rate this post
0 useful
not useful
Sorry for the delay...

Her are some functions that may helpful.

von Zen (Guest)

Rate this post
0 useful
not useful
Thank you very much for this it's very helpful!

von Irshad (Guest)

Rate this post
0 useful
not useful
  If anyone  have example code of Profibus-DP Master code with single 
slave, please share.I have slave example code. To test that I want a 
Master Code.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.