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

TMCL Control Command 255 - software reset #98

Open
JeffPS13 opened this issue Nov 10, 2023 · 2 comments
Open

TMCL Control Command 255 - software reset #98

JeffPS13 opened this issue Nov 10, 2023 · 2 comments

Comments

@JeffPS13
Copy link

Can TMCL Control Command 255 (software reset) be sent using PyTrinamic? If so a short code snippet would be appreciated.

Thanks - Jeff

@trinamic-bp
Copy link
Contributor

Coming from our regular examples, something like the following can be used to send any command:

from pytrinamic.connections import ConnectionManager
from pytrinamic.modules import TMCM9999
from pytrinamic.tmcl import TMCLCommand

connection_manager = ConnectionManager("--interface kvaser_tmcl")

with connection_manager.connect() as my_interface:
    module = TMCM9999(my_interface)
    module.interface.send(TMCLCommand.X, 0, 0, 0)  # def send(self, opcode, op_type, motor, value, module_id=None):

Unfortunately there is no constant defined for the software reset command, but you can just replace TMCLCommand.X by 255.

@JeffPS13
Copy link
Author

Thanks again. This is exactly what I'm looking for.

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