- Configuring LinuxCNC
- Advanced Configuration
- Setting motion.analog-out-xx to 0 when starting the machine
Setting motion.analog-out-xx to 0 when starting the machine
01 Feb 2023 14:09 #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 or Create an account to join the conversation.
01 Feb 2023 19:00 #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 or Create an account to join the conversation.
01 Feb 2023 20:10 #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 or Create an account to join the conversation.
02 Feb 2023 09:22 #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 or Create an account to join the conversation.
02 Feb 2023 09:30 #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 or Create an account to join the conversation.
04 Feb 2023 10:57 #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 or Create an account to join the conversation.
04 Feb 2023 10:59 #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 or Create an account to join the conversation.
04 Feb 2023 11:36 #263662
by MaHa
Replied by MaHa on topic Setting motion.analog-out-xx to 0 when starting the machine
Attachments:
Please Log in or Create an account to join the conversation.
06 Feb 2023 08:25 #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 or Create an account to join the conversation.
07 Feb 2023 00:20 #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 or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- Setting motion.analog-out-xx to 0 when starting the machine
Time to create page: 0.422 seconds