Code Monkey home page Code Monkey logo

Comments (7)

GabrielGomesBarbosa avatar GabrielGomesBarbosa commented on August 16, 2024
  1. To write SDO i found this example slave.sdo_write(0x8001, 2, struct.pack('B', 1)) on basic_example.py file, but I don't know how you got there, and the reason of params.

from pysoem.

bnjmnp avatar bnjmnp commented on August 16, 2024

For now, apart from the examples, there is no more documentation. The interactive help is also not to much of a help.

But thanks four your list, I think this lists the things a user may want to know.
I`ll take this into account when creating documentation.

from pysoem.

bnjmnp avatar bnjmnp commented on August 16, 2024

In the example of sdo_wirte: slave.sdo_write(0x8001, 2, struct.pack('B', 1)). The first parameter is the index(0x8001), the second parameter is the subindex(2) and then third parameter is the data to be written to the object. The data parameter is always a bytes object.

from pysoem.

GabrielGomesBarbosa avatar GabrielGomesBarbosa commented on August 16, 2024

Hi @bnjmnp thanks for your answer... can i help build that doc ? i sent messages on Gitter chat, i understood now how to write in SDO.

This library is a Cython wrapper from EtherCAT Master Library, and that library we have a function to list PDO Mapping.

image

In folder examples i guess that read_sdo_info.py will show SDO Mapping right ?

There is some function to list all PDO Mapping ? If yes... can you send me here an example ?

from pysoem.

bnjmnp avatar bnjmnp commented on August 16, 2024

Your screenshoot is the terminal output of the slaveinfo example from the SOEM tests. When you take a closer look to the source code (slaveinfo.c) you will see (within function si_map_sdo) that there is not directly a SOEM library function that prints the PDO mappings. They use a bunch of ec_SDOreads.
You could do something similar with PySOEMs sdo_read. Unfortunately the read_sdo_info.py is not printing the PDO mappings.

from pysoem.

GabrielGomesBarbosa avatar GabrielGomesBarbosa commented on August 16, 2024

@bnjmnp thanks for your answer, i really appreciate.

I'm studying the sdo_read function here, but i still got some difficult about it. Can you provide some example about to get PDO map using this function ?

from pysoem.

bnjmnp avatar bnjmnp commented on August 16, 2024

First you need to known the EtherCAT PDO mapping concept. Unfortunately that is not very easy to explain, and I cannot do it in every detail.

You already know thees CoE objects, you are trying to read with sdo_read, I guess. Each object can be addressed by it's index (0 to 0xFFFF) and subindex (0 to 255). These objects are used for settings of a device. For example if you have a temperatur sensor device you could have a unit object witch is used to switch the unit of the output from degree Celsius to Fahrenheit scale.
Within these objects there are a bunch of standard objects, which have special meanings. For example the object with the index 0x1018, that gives a master the identity info of a device. Here is a nice example of the available standard objects of a Beckoff EP4174.
The PDO mapping can also be read out of the standard objects. Most important are the objects 0x1C12 for output PDO and 0x1C13 for input PDO. And then all objects in the range of 0x1600 to 0x 17FF and 0x1A00 to 0x1B00 are from interest.
Try to read out the content of both objects 0x1C12 and 0x1c13 with sdo_read. Or in an earlier step try to read out some of the standard objects in the range of 0x1000 to 0x1018 to get familiar with sdo_read.

Take also a look at my comment in issue #18 where I explain what sdo_read returns.

from pysoem.

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.