Code Monkey home page Code Monkey logo

Comments (4)

bnjmnp avatar bnjmnp commented on August 16, 2024

Hi lemmi25,

I think your example slave implementation uses fixed PDO mapping so you don't need to do anything in the setup function of your device. Thus you don't even need one.

If you only have the XMC board at you master system something like the following should work:

import pysoem

master = pysoem.Master()

master.open('<put in you network id here!>')

master.config_init()

assert len(master.slaves) == 1

assert master.slaves[0].name == 'XMC_ESC'

master.config_map()

assert master.state_check(pysoem.SAFEOP_STATE, 50000) == pysoem.SAFEOP_STATE

for _ in range(1000):
    print(master.slaves[0].input)

master.state = pysoem.INIT_STATE
master.write_state()

master.close()

(Please don't use thees asserts in production code, it's just for the purpose of this demonstration)

You should see some bit changes in the printed input values if you push the button on the XMC board, like described in the Infineon PDF on page 56.

If you got there you may easily figure out how to wire outputs to turn on end off the LED on the board. Therefore take a look at the minimal_example.py or basic_example.py, as my example above dose not show how to bring the slave into operational (OP) state.

from pysoem.

lemmi25 avatar lemmi25 commented on August 16, 2024

Hi,

many thanks for the detailed answer. I still have one problem if I use your example I see nothing as blank lines. Even if I push a button.

If I use the minimal_example.py I can not get the Slave into operation mode (can send code later, maybe your first answer will resolve my problem).

Many thanks again.

from pysoem.

bnjmnp avatar bnjmnp commented on August 16, 2024

Did you find out anything new?
Maybe (I was wrong and) the XMC example uses selectable PDO mapping instead of fixed PDO mapping. If so you need to write to object 0x1C12 and 0x1C13 before calling config_map().
How are objects 0x1C12 and 0x1C13 define?

from pysoem.

bnjmnp avatar bnjmnp commented on August 16, 2024

Closed due to inactivity of the original author on this topic.

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.