- Posts: 59
- Thank you received: 0
remap setspeed epilog problem
3 years 2 months ago #276872
by MichalHK
remap setspeed epilog problem was created by MichalHK
Hello,
I remap S - by this in ini config
RAMAP=S prolog=setspeed_prolog epilog=setspeed_epilog ngc=setspeed
at the end of ngc I have
o<setspeed> endsub [0]
M2
Im using standart stdglue
linuxcnc tell me this warning- Setspeed epilog: Python argument types in: None none (interp, int) did not match C++ signature: None(interp {Ivalue}, int, double)
Im not familiar with python only c/c++. Can you help me fix it please?
I remap S - by this in ini config
RAMAP=S prolog=setspeed_prolog epilog=setspeed_epilog ngc=setspeed
at the end of ngc I have
o<setspeed> endsub [0]
M2
Im using standart stdglue
linuxcnc tell me this warning- Setspeed epilog: Python argument types in: None none (interp, int) did not match C++ signature: None(interp {Ivalue}, int, double)
Im not familiar with python only c/c++. Can you help me fix it please?
Please Log in to join the conversation.
3 years 2 months ago #276880
by Aciera
Replied by Aciera on topic remap setspeed epilog problem
To have a better chance of getting help maybe also post your remap, prolog and epilog code.
Please Log in to join the conversation.
3 years 2 months ago #276882
by MichalHK
Replied by MichalHK on topic remap setspeed epilog problem
Ok its standart remap glue
# REMAP=S prolog=setspeed_prolog ngc=setspeed epilog=setspeed_epilog
# exposed parameter: #<speed>
def setspeed_prolog(self,**words):
try:
c = self.blocks[self.remap_level]
if not c.s_flag:
self.set_errormsg("S requires a value")
return INTERP_ERROR
self.params["speed"] = c.s_number
except Exception,e:
self.set_errormsg("S/setspeed_prolog: %s)" % (e))
return INTERP_ERROR
return INTERP_OK
def setspeed_epilog(self,**words):
try:
if not self.value_returned:
r = self.blocks[self.remap_level].executing_remap
self.set_errormsg("the %s remap procedure %s did not return a value"
% (r.name,r.remap_ngc if r.remap_ngc else r.remap_py))
return INTERP_ERROR
if self.return_value < -TOLERANCE_EQUAL: # 'less than 0 within interp's precision'
self.set_errormsg("S: remap procedure returned %f" % (self.return_value))
return INTERP_ERROR
if self.blocks[self.remap_level].builtin_used:
pass
#print "
S builtin recursion, nothing to do"
else:
self.speed = self.params["speed"]
emccanon.enqueue_SET_SPINDLE_SPEED(self.speed)
return INTERP_OK
except Exception,e:
self.set_errormsg("S/setspeed_epilog: %s)" % (e))
return INTERP_ERROR
return INTERP_OK
# REMAP=S prolog=setspeed_prolog ngc=setspeed epilog=setspeed_epilog
# exposed parameter: #<speed>
def setspeed_prolog(self,**words):
try:
c = self.blocks[self.remap_level]
if not c.s_flag:
self.set_errormsg("S requires a value")
return INTERP_ERROR
self.params["speed"] = c.s_number
except Exception,e:
self.set_errormsg("S/setspeed_prolog: %s)" % (e))
return INTERP_ERROR
return INTERP_OK
def setspeed_epilog(self,**words):
try:
if not self.value_returned:
r = self.blocks[self.remap_level].executing_remap
self.set_errormsg("the %s remap procedure %s did not return a value"
% (r.name,r.remap_ngc if r.remap_ngc else r.remap_py))
return INTERP_ERROR
if self.return_value < -TOLERANCE_EQUAL: # 'less than 0 within interp's precision'
self.set_errormsg("S: remap procedure returned %f" % (self.return_value))
return INTERP_ERROR
if self.blocks[self.remap_level].builtin_used:
pass
#print "
S builtin recursion, nothing to do"
else:
self.speed = self.params["speed"]
emccanon.enqueue_SET_SPINDLE_SPEED(self.speed)
return INTERP_OK
except Exception,e:
self.set_errormsg("S/setspeed_epilog: %s)" % (e))
return INTERP_ERROR
return INTERP_OK
Please Log in to join the conversation.
3 years 2 months ago #276883
by MichalHK
Replied by MichalHK on topic remap setspeed epilog problem
Problem is this function
emccanon.enqueue_SET_SPINDLE_SPEED(self.speed)
It has 2 arguments. I think first argument is number of spindle, second is rpm.
emccanon.enqueue_SET_SPINDLE_SPEED(self.speed)
It has 2 arguments. I think first argument is number of spindle, second is rpm.
Please Log in to join the conversation.
3 years 2 months ago #276893
by MichalHK
Replied by MichalHK on topic remap setspeed epilog problem
I tested it at simulation
Problem is with this
self.speed = self.params["speed"]
emccanon.enqueue_SET_SPINDLE_SPEED(self.speed)
but it does not metter I succesfully fix it.
But it's worse that if you use remap S and set speed by emccanon.enqueue_SET_SPINDLE_SPEED function.
Finally breaks all set spindle speed functions by MDI as descripted in this topic
forum.linuxcnc.org/gmoccapy/42762-proble...ap-s-python-setspeed
I think function emccanon.enqueue_SET_SPINDLE_SPEED set speed only into queue buffer and its not good.
Problem is with this
self.speed = self.params["speed"]
emccanon.enqueue_SET_SPINDLE_SPEED(self.speed)
but it does not metter I succesfully fix it.
But it's worse that if you use remap S and set speed by emccanon.enqueue_SET_SPINDLE_SPEED function.
Finally breaks all set spindle speed functions by MDI as descripted in this topic
forum.linuxcnc.org/gmoccapy/42762-proble...ap-s-python-setspeed
I think function emccanon.enqueue_SET_SPINDLE_SPEED set speed only into queue buffer and its not good.
Please Log in to join the conversation.
3 years 2 months ago #276895
by Aciera
Replied by Aciera on topic remap setspeed epilog problem
What version of LinuxCNC are you running this on?
Please Log in to join the conversation.
3 years 2 months ago #276900
by MichalHK
Replied by MichalHK on topic remap setspeed epilog problem
Current release LINUXCNC - 2.8.4-1-gb7824717b
Please Log in to join the conversation.
3 years 2 months ago #276909
by Aciera
Replied by Aciera on topic remap setspeed epilog problem
I really don't know much about the python interface but there has been a similar discussion here a couple years back and it seems that cmorley might have done some work on what was then master (which would be 2.9 now I belive). So updating may (or may not) help you.
www.forum.linuxcnc.org/gmoccapy/42762-pr...thon-setspeed#219808
www.forum.linuxcnc.org/gmoccapy/42762-pr...thon-setspeed#219808
Please Log in to join the conversation.
3 years 2 months ago #277013
by MichalHK
Replied by MichalHK on topic remap setspeed epilog problem
Yes, its true LINUXCNC - 2.9.0~pre1 solve this problem. I tested it now.
But problem with bad emccanon.enqueue_SET_SPINDLE_SPEED(self.speed) is still there.
For me it doesnt matter I fix it myself.
But problem with bad emccanon.enqueue_SET_SPINDLE_SPEED(self.speed) is still there.
For me it doesnt matter I fix it myself.
Please Log in to join the conversation.
Time to create page: 0.277 seconds
