Comments (12)
Hi. Thanks for your question.
I think you can just set your master-output-data to None in your first iteration.
Hope that helps.
from pyprofibus.
pyprofibus/pyprofibus/dp_master.py
Line 691 in dd93704
Doesn't the above "if" prevent any data exchange when master data out is None?
from pyprofibus.
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
from pyprofibus.
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 ?
from pyprofibus.
I'm not sure what your question is anymore.
There are only two possibilities. Either you send data, or you don't. Both can be done with pyprofibus, as I described.
So, if your slave needs some data, then send some data.
from pyprofibus.
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.
from pyprofibus.
Well, of course the slave may require some input data to send a reply.
I don't know your slave.
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.
from pyprofibus.
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.
The thing i dont understand here is how profibus allow for slave devices to send data whenever they want without collisions ?
from pyprofibus.
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.
from pyprofibus.
To be clear: I don't think it is normal behavior for a slave to send data without receiving a request from the master.
Just saying, that in theory, this would be supported by pyprofibus, unless it transmits at the same time as the cyclic master.
And under the premise, that your slave does such things, pyprofibus would support it.
I still think that your slave probably doesn't actually do this behavior.
However, there are many strangely behaving slaves. Therefore, I wouldn't be surprised either.
from pyprofibus.
It does only support single-slave operation.
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.
When reading the profibus documentation I believe that there are two options to solve my issue:
- DDLM_Data_Exchange request with 0 length input data (but there is explicit check in the code for that case slave.slaveDesc.inputSize == 0 in __runSlave_dataExchange method - what is missing to handle that case in pyprofibus ?)
- DDLM_RD_Outp request but that is not implemented in pyprofibus
from pyprofibus.
Hm, yes. The pyprofibus software architecture does include all elements needed for multi-slave support.
However, pyprofibus doesn't implement the required bus timing and arbitration mechanisms.
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.
DDLM_Data_Exchange request with 0 length input data [..] what is missing to handle that case in pyprofibus ?)
Well, mostly that I was not aware such a thing exists.
Please feel free to implement support for this.
I would suggest to signal this situation to dp_master.py with a zero length bytes/bytearray as master-out-data. (While 'None' meaning "don't send a telegram at all")
from pyprofibus.
Related Issues (20)
- Terminating: GSD 'HIL_0B69.gsd': DPv1 User_Prm_Data is shorter than 3 bytes HOT 13
- CP5711: Is this CP supported? HOT 3
- Modules are sorted lexicographically, not numerically HOT 1
- Acyclic communcation support HOT 1
- Function code response error handling needs improvement HOT 3
- Siemens DP/AS-i LINK 20 support HOT 4
- Warning in GSD: User_Prm_Data truncated by User_Prm_Data_Len HOT 9
- Festo CPV Valve terminal HOT 40
- PC - FPGA interface HOT 2
- "input byte, "output byte" confusion HOT 6
- pyprofibus hardware documentation HOT 3
- TxDen pin Question HOT 4
- Help with WAGO 750-343 HOT 7
- connecting Pyprofibus with DP/PA coupler to communcate with PA devices (Invalid telegram format) HOT 4
- Сonnection SIEMENS et200s HOT 4
- How to get to debugMsg to prompt them in Tkinker window HOT 1
- After slave was reset/reloaded timeout occurs and slave-object changes its state to STATE_INIT, but its fcb remained in previous state ( fcv=1 fcb=0/1 ) HOT 1
- Is there any communication function between the master station and the master station in this project? HOT 1
- GSD file reading error. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyprofibus.