- Posts: 29
- Thank you received: 0
Setting motion.analog-out-xx to 0 when starting the machine
3 years 8 months ago #263444
by HiSH
Setting motion.analog-out-xx to 0 when starting the machine was created by HiSH
Is it possible to set an motion.analog-out-xx pin to 0, wenn starting the machine?
I remap an gcode and set in an owert-function an motion.analog-out pin to an value x.
If an error occurs an estop will be triggert. But anyway the motion.analog-out pin remains on
the value x.
I remap an gcode and set in an owert-function an motion.analog-out pin to an value x.
If an error occurs an estop will be triggert. But anyway the motion.analog-out pin remains on
the value x.
Please Log in to join the conversation.
3 years 8 months ago #263457
by andypugh
Replied by andypugh on topic Setting motion.analog-out-xx to 0 when starting the machine
If you are using remap then you can possibly use the ON_ABORT functionality:
linuxcnc.org/docs/devel/html/remap/remap...g_dealing_with_abort
linuxcnc.org/docs/devel/html/remap/remap...g_dealing_with_abort
Please Log in to join the conversation.
3 years 8 months ago #263462
by rodw
Replied by rodw on topic Setting motion.analog-out-xx to 0 when starting the machine
The other approach if not remapping is to and2 it with another pin that comes on with the machine before using the value.
motion.motion-enabled may do it.
motion.motion-enabled may do it.
Please Log in to join the conversation.
3 years 8 months ago #263505
by HiSH
Replied by HiSH on topic Setting motion.analog-out-xx to 0 when starting the machine
Thank you! That is what i searched for and it works as expected, but when switching on the machine, i got the error:
0: nicht in der Definition einer Unterfunktion: 'o<on_abort> endsub'
(or
0: not declared in a subroutine: 'o<on_abort> endsub' )
In my INI-File:
...
[RS274NGC]
REMAP=S argspec=s ngc=s
ON_ABORT_COMMAND=O <on_abort> call
...
in on_abort.ngc:
o<on_abort> sub
(DEBUG, parameter is [#1])
o100 if [#1 eq 5]
(machine on)
o100 elseif [#1 eq 6]
(machine off)
o100 elseif [#1 eq 7]
M68 E0 Q0
(estopped)
o100 elseif [#1 eq 8]
(msg, abort pressed)
o100 else
(DEBUG, error parameter is [#1])
o100 endif
o<on_abort> endsub
m2
What do i wrong?
0: nicht in der Definition einer Unterfunktion: 'o<on_abort> endsub'
(or
0: not declared in a subroutine: 'o<on_abort> endsub' )
In my INI-File:
...
[RS274NGC]
REMAP=S argspec=s ngc=s
ON_ABORT_COMMAND=O <on_abort> call
...
in on_abort.ngc:
o<on_abort> sub
(DEBUG, parameter is [#1])
o100 if [#1 eq 5]
(machine on)
o100 elseif [#1 eq 6]
(machine off)
o100 elseif [#1 eq 7]
M68 E0 Q0
(estopped)
o100 elseif [#1 eq 8]
(msg, abort pressed)
o100 else
(DEBUG, error parameter is [#1])
o100 endif
o<on_abort> endsub
m2
What do i wrong?
Please Log in to join the conversation.
3 years 8 months ago #263506
by HiSH
Replied by HiSH on topic Setting motion.analog-out-xx to 0 when starting the machine
@rodw:
Thank you. I remember your solution, if i couldn't solve the problem, with
the described error. The advantage of the ON_ABORT solution is, that
i could do other initialsations too.
Thank you. I remember your solution, if i couldn't solve the problem, with
the described error. The advantage of the ON_ABORT solution is, that
i could do other initialsations too.
Please Log in to join the conversation.
3 years 8 months ago #263655
by andypugh
Replied by andypugh on topic Setting motion.analog-out-xx to 0 when starting the machine
There is something funny about % and M2 methods of marking file ends. I can't remember the details right now, but you could try putting % at the start and end of the subroutine file and removing the M2.
But this is just a wild guess, and probably won't work.
But this is just a wild guess, and probably won't work.
Please Log in to join the conversation.
3 years 8 months ago #263656
by andypugh
Replied by andypugh on topic Setting motion.analog-out-xx to 0 when starting the machine
You can't use and2 with a numerical value, but a muxN or mux-generic could be used.The other approach if not remapping is to and2 it with another pin that comes on with the machine before using the value.
motion.motion-enabled may do it.
Please Log in to join the conversation.
3 years 8 months ago #263662
by MaHa
Replied by MaHa on topic Setting motion.analog-out-xx to 0 when starting the machine
I tested your on_abort.ngc without error.
Attachment not found
Please Log in to join the conversation.
3 years 8 months ago #263805
by HiSH
Replied by HiSH on topic Setting motion.analog-out-xx to 0 when starting the machine
Ups, thats mysterious. I got the error only when using the on_abort.ngc.
Please Log in to join the conversation.
3 years 8 months ago #263881
by andypugh
Replied by andypugh on topic Setting motion.analog-out-xx to 0 when starting the machine
As an ON_ABORT subroutine, or manually?I tested your on_abort.ngc without error.
Please Log in to join the conversation.
Time to create page: 0.113 seconds
