- Posts: 17
- Thank you received: 0
getting spindle speed in python
2 years 1 month ago #310191
by rockcnc
getting spindle speed in python was created by rockcnc
Hello everyone
I want to read spindle speed in Python, but it's giving me some errors and not lunching linuxcnc
I tried it as the documentary said but don't know why it isn't working
I'm reading some other states at the same time, but whenever I add spindle_speed(returns float) - spindle speed value, rpm, > 0: clockwise, < 0: counterclockwise. its giving me errors
I want to read spindle speed in Python, but it's giving me some errors and not lunching linuxcnc
I tried it as the documentary said but don't know why it isn't working
I'm reading some other states at the same time, but whenever I add spindle_speed(returns float) - spindle speed value, rpm, > 0: clockwise, < 0: counterclockwise. its giving me errors
Please Log in to join the conversation.
2 years 1 month ago #310194
by Aciera
so what errors do you get?
[edit]
Sharing your python code might also be helpful.
Replied by Aciera on topic getting spindle speed in python
it's giving me some errors
so what errors do you get?
[edit]
Sharing your python code might also be helpful.
Please Log in to join the conversation.
2 years 1 month ago #310198
by rockcnc
Am i writing the wrong command?
Replied by rockcnc on topic getting spindle speed in python
Attachment not found
Code:
import linuxcnc s = linuxcnc.stat() s.poll() sp_speed = s.spindle_speed
Please Log in to join the conversation.
2 years 1 month ago #310199
by Aciera
Not sure what version of linuxcnc you are running but you may be referring to old docs as the current attribute is 'speed' inside the 'spindle' dictionary
linuxcnc.org/docs/stable/html/config/pyt...e-spindle-dictionary
So to access the speed of spindle 0:
Replied by Aciera on topic getting spindle speed in python
but whenever I add spindle_speed(returns float)
Not sure what version of linuxcnc you are running but you may be referring to old docs as the current attribute is 'speed' inside the 'spindle' dictionary
linuxcnc.org/docs/stable/html/config/pyt...e-spindle-dictionary
So to access the speed of spindle 0:
Code:
s = linuxcnc.stat()
s.poll()
spindle_speed = s.spindle[0]['speed']
Please Log in to join the conversation.
2 years 1 month ago #310200
by Aciera
Replied by Aciera on topic getting spindle speed in python
So you are running 2.8.x:
linuxcnc.org/docs/2.8/html/config/python...e-spindle-dictionary
The code I posted above should work.
linuxcnc.org/docs/2.8/html/config/python...e-spindle-dictionary
The code I posted above should work.
Please Log in to join the conversation.
Time to create page: 0.079 seconds
