Hi 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 microcontroller(Master-Slave) 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?
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 Gateway. (B&N Elektronik Profibus DP Master Simulator)
Thank you very much. I need just examples what I have to send to the sensor 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
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 case). 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 free. 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 Ulrich
Sir 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.
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.