Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection_manager --module-id is unused for CAN Modules #88

Open
trinamic-ab opened this issue Feb 7, 2023 · 0 comments
Open

connection_manager --module-id is unused for CAN Modules #88

trinamic-ab opened this issue Feb 7, 2023 · 0 comments
Assignees

Comments

@trinamic-ab
Copy link
Contributor

trinamic-ab commented Feb 7, 2023

import pytrinamic
from pytrinamic.connections import ConnectionManager
from pytrinamic.modules import TMCM1637
import time

pytrinamic.show_info()
connection_manager = ConnectionManager("--interface kvaser_tmcl --module-id 10 --host-id 32")


with connection_manager.connect() as my_interface:
    module = TMCM1637(my_interface)
    motor = module.motors[0]
    motor.drive_settings.motor_type = motor.ENUM.MOTOR_TYPE_TWO_PHASE_STEPPER

This code produces the following TMCL command as output:
01
05
0E
00
00000002
16

module ID of 0A is expected, but 01 is gotten, this is because the module id is not forwarded from the connection manager to the module class.

It seems the new and recommended way to forward the module id is through the class construction:

module_id = 0x0A
module = TMCM1637(my_interface, module_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants