Giter VIP home page Giter VIP logo

Comments (13)

mbuesch avatar mbuesch commented on August 19, 2024

Thanks for your report.
Can you please send the GSD file via mail to me, so that I can reproduce the behaviour?
Thanks.

from pyprofibus.

derekyu56 avatar derekyu56 commented on August 19, 2024

File attached.

HIL_0B69.zip

from pyprofibus.

mbuesch avatar mbuesch commented on August 19, 2024

Thanks.

I checked this problem and what I found out is:

  • The GSD parser currently does not parse Bit() or BitArea() definitions.
  • The GSD interpreter currently does not interpret the ExtUserPrmData fields.
  • Unknown/unimplemented sections are simply ignored.

That is why the UserPrmData ends up with size 0 instead of size 5 as specified in your GSD.

That's why I currently consider this a missing feature rather than a bug. The GSD parser isn't fully prepared to parse all details of your GSD file, yet. There are a couple of other ignored fields as well. These will be shown, if GSD parser debugging is enabled (set debug=True in the parser.py file)

from pyprofibus.

mbuesch avatar mbuesch commented on August 19, 2024

Please also note that you probably won't get your device working, if the UserPrmData from the GSD file is ignored by pyprofibus. That is unless you somehow hack the code and hardcode the required UserPrmData somewhere.

from pyprofibus.

derekyu56 avatar derekyu56 commented on August 19, 2024

I appreciate very much for spending the time to investigate the issue. Despite these missing features, I believe the pyprofibus will still be a very good application to help my Profibus application development.
Thanks for a job well done.

from pyprofibus.

mbuesch avatar mbuesch commented on August 19, 2024

Re-opening the issue, to keep track of this feature, because it should be implemented at some point.

I think it is fairly easy to work around this missing feature, by just hard coding the required UserPrmData in the user code that uses pyprofibus for a particular device. However the plan is to also have this GSD feature to be part of pyprofibus. If you have any enhancements to pyprofibus, that are of general use, please feel free to create pull requests. Your help is greatly appreciated.

from pyprofibus.

derekyu56 avatar derekyu56 commented on August 19, 2024

Currently I can get around the problem by setting "DPV1_Slave = 0" to remove DPV1 support. If I do need DPV1 support, I will consider come back and see if I can contribute to this issue.

from pyprofibus.

mbuesch avatar mbuesch commented on August 19, 2024

That will silence the error message, but the root of the problem will still persist.
No valid UserPrmData will be generated and no UserPrmData will be sent to the slave. The slave probably won't successfully pass configuration state and probably won't enter Data_Exchange without valid UserPrmData.

from pyprofibus.

derekyu56 avatar derekyu56 commented on August 19, 2024

In my module configuration, I only have the following defined:
module_1=16 Bytes In
module_5=16 Bytes Out
This is working fine:
DPM1: Trying to initialize slave 2...
PHY-serial: TX 10 02 7D 49 C8 16
PHY-serial: RX 10 7D 02 00 7F 16
DPM1: slave[02].state --> 'wait for diag'
DPM1: Requesting Slave_Diag from slave 2...
PHY-serial: TX 68 05 05 68 82 FD 6D 3C 3E 66 16
PHY-serial: RX 68 0B 0B 68 FD 82 08 3E 3C 02 05 00 FF 0B 69 7B 16
DPM1: slave[02].state --> 'wait for Prm'
DPM1: Sending Set_Prm to slave 2...
PHY-serial: TX 68 0C 0C 68 82 FD 5D 3D 3E B8 C8 01 00 0B 69 01 4D 16
PHY-serial: RX E5
DPM1: slave[02].state --> 'wait for Cfg'
DPM1: Sending Chk_Cfg to slave 2...
PHY-serial: TX 68 07 07 68 82 FD 7D 3E 3E 9F AF C6 16
PHY-serial: RX E5
DPM1: slave[02].state --> 'wait for Data_Exchange-ready'
DPM1: Requesting Slave_Diag (WDXRDY) from slave 2...
PHY-serial: TX 68 05 05 68 82 FD 5D 3C 3E 56 16
PHY-serial: RX 68 0B 0B 68 FD 82 08 3E 3C 00 0C 00 7D 0B 69 FE 16
DPM1: slave[02].state --> 'Data_Exchange'
DPM1: Initialization finished. Running Data_Exchange with slave 2...
PHY-serial: TX 68 13 13 68 02 7D 7D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FC 16
PHY-serial: RX 68 13 13 68 7D 02 08 01 23 45 67 89 AB CD EF 01 23 45 67 89 AA BB CC D1 16
PHY-serial: TX 68 13 13 68 02 7D 5D 10 0F 0E 0D 0C 0B 0A 09 08 07 06 05 04 03 02 01 64 16
PHY-serial: RX 68 13 13 68 7D 02 08 01 23 45 67 89 AB CD EF 01 23 45 67 89 AA BB CC D1 16
............

from pyprofibus.

mbuesch avatar mbuesch commented on August 19, 2024

Ok. Fair enough. So your device is not as picky about missing data as mine. :)

from pyprofibus.

looninho avatar looninho commented on August 19, 2024

Hi,
maybe question for @derekyu56: did you use rs485 physical link? If yes, did you use bus termination even if there is only 1 slave device on the bus?
I get :
DPM1: Trying to initialize slave 8...
DPM1: RX error: PHY-serial: Failed to get received telegram size:
Invalid telegram format.
......

from pyprofibus.

derekyu56 avatar derekyu56 commented on August 19, 2024

I used a RS232 to RS485 dongle from HMS. It is a direct connection to one slave using a serial cable with no terminator.

from pyprofibus.

looninho avatar looninho commented on August 19, 2024

from pyprofibus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.