summaryrefslogtreecommitdiff
path: root/configs/sim/axis/remap/cycle/README
blob: 11085be3881ebffcc43df505ddb2a9ff83acd7c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
This shows how cycles can be made out of O-word subroutines or directly coded in Python.

# Assume G84.2 is remapped to Python g842 like so in the [RS274NGC] ini section:
# REMAP=G84.2 argspec=xyzqp python=g842 modalgroup=1
#
# then executing
#
#    G84.2 x1 y1 (line1)
#    x3 y3       (line2)
#    y5          (line3)
#    ...
#
#  will execute like:
#   *G84.2 x1 y1
#    G84.2 x3 y3
#    G84.2 x3 y5
#
# until motion is cleared with G80 or some other motion is executed.
#
# This enables writing cycles in Python, or as Oword procedures; in the
# latter case the self.motion_mode should be set in the Python epilog.
#

And the same thing as an Oword procedure:

# a cycle with an Oword sub
#REMAP=G84.3  modalgroup=1 argspec=xyzqp prolog=g843_prolog ngc=g843 epilog=g843_epilog


The examples only show they parameters they are fed, and dont do anything useful - "you get the idea".
Sticky parameters are handled properly.

Usage:

linuxcnc cycle.ini

hit run and see what happens.

To understand how things fit together:

- see the REMAP statements in cycle.ini
- python/remap.py contains the Python glue
- nc_subroutines/g843.ngc is an example 'cycle body'