-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] how to read data without write ? #32
Comments
Hi. Thanks for your question. |
pyprofibus/pyprofibus/dp_master.py Line 691 in dd93704
Doesn't the above "if" prevent any data exchange when master data out is None? |
No, I don't think so. It should only suppress the sending of the data. The receiving is done here: pyprofibus/pyprofibus/dp_master.py Line 642 in dd93704
|
To my understanding the slave will not send anything without any request from master, but as i said i'm profibus noob :) so if master will not send any data how it receive data from slave. Could you clarify ? |
I'm not sure what your question is anymore. So, if your slave needs some data, then send some data. |
Ok, so how do master read data from slave? To my understanding, master has to SEND data exchange request to do that. But that involves writing to slave as well. |
Well, of course the slave may require some input data to send a reply. But there is no fundamental requirement on the bus level for the master to send data to a slave to be able to receive data from a slave. I would suggest to simply try it out. It's trivial to not send the first frame. |
unfortunately i'm not in possession of real device now and im only using dumny phy to simulate that. I'll try your suggestion when i'll have the device. |
They can't send whenever they want. There is bus arbitration. But pyprofibus does not implement any of that. It does only support single-slave operation. Therefore, there can never be a slave collision. |
To be clear: I don't think it is normal behavior for a slave to send data without receiving a request from the master. I still think that your slave probably doesn't actually do this behavior. |
That is interesting. I did not see such info anywhere in the docs and when looking at code it seemed to me that multiple slaves are supported. There is even an example script example_dummy_twoslaves.py which has two slaves :) What is missing in pyprofibus to be able to handle multiple slaves ? Regarding the topic issue, I do not believe that the slave I'm working with will send anything without any request - it is designed to work with multiple slaves on one bus.
|
Hm, yes. The pyprofibus software architecture does include all elements needed for multi-slave support. In the branch https://github.com/mbuesch/pyprofibus/tree/bustiming there is an initial attempt to define the relevant timings. But they are not used, yet. I agree that this should be documented more clearly.
Well, mostly that I was not aware such a thing exists. |
Hi,
I'm a profibus noob but I'm using this library to communicate with profibus slave based on Anybus-S Profibus card. So this is more of a profibus general question.
The slave expects to receive 1 byte and outputs 16 bytes. What I need is to first read the output data before I do the first write (write data depends on what slave outputs). Is this even possible in profibus ? if Yes, how to do that with pyprofibus ?
The text was updated successfully, but these errors were encountered: