Controlling spindle using python scripts and Modbus TCP
- davidgill
- Away
- New Member
-
Less
More
- Posts: 1
- Thank you received: 0
10 Oct 2025 03:36 #336181
by davidgill
Controlling spindle using python scripts and Modbus TCP was created by davidgill
Hi All,
I have been playing with this for days and have not cracked it. I was using AI for answers but every solution failed. I want to do the following. I have the python code sorted but getting LinuxCNC to call the python scripts seems to be the problem. The python script sets the Modbus TCP registers on the VFD.Spindle forward, pass the value 1 to my python script as an argSpindle reverse, pass the value 2 to my python script as an argStop spindle, pass the value 5 to my python script as an argSpindle speed, pass a value between 0 and 200 to a python script.can anyone offer a solution. Cheers
I have been playing with this for days and have not cracked it. I was using AI for answers but every solution failed. I want to do the following. I have the python code sorted but getting LinuxCNC to call the python scripts seems to be the problem. The python script sets the Modbus TCP registers on the VFD.Spindle forward, pass the value 1 to my python script as an argSpindle reverse, pass the value 2 to my python script as an argStop spindle, pass the value 5 to my python script as an argSpindle speed, pass a value between 0 and 200 to a python script.can anyone offer a solution. Cheers
Please Log in or Create an account to join the conversation.
- Hakan
- Away
- Platinum Member
-
Less
More
- Posts: 904
- Thank you received: 317
10 Oct 2025 06:43 #336183
by Hakan
Replied by Hakan on topic Controlling spindle using python scripts and Modbus TCP
Sounds like a user component.
There are some examples, for example the mitsub_vfd.py here github.com/LinuxCNC/linuxcnc/tree/master/src/hal/user_comps
There are some examples, for example the mitsub_vfd.py here github.com/LinuxCNC/linuxcnc/tree/master/src/hal/user_comps
Please Log in or Create an account to join the conversation.
Time to create page: 0.082 seconds