getting spindle speed in python

More
2 years 1 month ago #310191 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

Please Log in to join the conversation.

More
2 years 1 month ago #310194 by Aciera

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.

More
2 years 1 month ago #310198 by rockcnc
 

Attachment not found

Code:
import linuxcnc s = linuxcnc.stat() s.poll() sp_speed = s.spindle_speed
Am i writing the wrong command?

Please Log in to join the conversation.

More
2 years 1 month ago #310199 by Aciera

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.

More
2 years 1 month ago #310200 by Aciera
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.

Please Log in to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum