Giter VIP home page Giter VIP logo

Comments (6)

mbuesch avatar mbuesch commented on August 19, 2024

These two options reside in the [SLAVE_x] section(s) of the configuration.
All options in these sections configure the slave.
Therefore the terms output and input are to be interpreted from the slave's perspective. Just like the comment suggests.
That means your values are swapped.

from pyprofibus.

Sigma1912 avatar Sigma1912 commented on August 19, 2024

Swapping the values does not work because then the component doesn't create the correct number/direction for the halpins.

In my opinion the information the slave transmits to the master needs to be put into hal-pins of direction OUT (ie. "profibus.slave.8.input.bit.x.x")
information the slave recieves from the master needs to come from hal-pins of direction IN (ie. profibus.slave.8.output.bit.x.x)

To illustrate my point I have configured my input-bytes and output-bytes as posted below. With this I would expect to see 4x8 halpins of direction OUT to make the slaves response data (4 bytes) available in the HAL environment and 2x8 halpins of direction IN for the data that is to be sent from the master (2 bytes):

; The number of output bytes this slave transmits to the
; master in Data_Exchange.
; This usually depends on the modules plugged into the slave.
output_size=4

; The number of input bytes this slave expects to receive
; in Data_Exchange.
; This usually depends on the modules plugged into the slave.
input_size=2

However, this creates the exact opposite:
4 x 8 halpins "profibus.slave.8.output.bit.x.x" with hal-direction IN
2 x 8 halpins "profibus.slave.8.input.bit.x.x" with hal-direction OUT

Which is wrong since now we have too many pins with direction IN and not enough with direction OUT
Since your component embeds the slave in HAL we need IN pins for "input_size" (data sent to the slave) and OUT pins for "output_size" (data received from the slave).

I hope this makes at least somewhat sense.

Screenshot from 2021-10-14 08-07-24

from pyprofibus.

mbuesch avatar mbuesch commented on August 19, 2024

Yes, the LinuxCNC HAL component might be buggy here.
That is one of the least tested and least used parts of pyprofibus.

One could also argue that the input/output HAL pin naming is swapped. It doesn't match the configuration's understanding of inputs and outputs.

from pyprofibus.

Sigma1912 avatar Sigma1912 commented on August 19, 2024

Absolutely, I think it would make more sense to create the halpins "profibus.slave.n.output.x.y.z" with hal-direction OUT
halpins "profibus.slave.n.input.x.y.z" with hal-direction IN.

I've tried to change profibus-linuxcnc-hal accordingly but I get errors.

from pyprofibus.

mbuesch avatar mbuesch commented on August 19, 2024

The change 26d6696 swaps the HAL's interpretation of input and output.
It's necessary to swap the input/output naming in the HAL configuration.

from pyprofibus.

mbuesch avatar mbuesch commented on August 19, 2024

The change has been integrated in the pyprofibus release 1.11.
Thanks for your report!

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.