LinuxCNC Subcommands¶
Subcommands for get and set are:
echo {on|off}
With get, any on/off parameter is ignored and the current
echo state is returned. With set, sets the echo state as specified. Echo
defaults to on when the connection is first established. When echo is on, all
commands will be echoed upon receipt. This state is local to each
connection.
verbose {on|off}
With get, any on/off parameter is ignored and the current
verbose state is returned. With set, sets the verbose state as specified. When
verbose mode is on, all set commands return positive acknowledgement in the
form SET <COMMAND> ACK, and text error messages will be issued (FIXME: I
don't know what this means). The verbose state is local to each connection,
and starts out OFF on new connections.
enable {<passwd>|off}
The session's enable state indicates whether the current
connection is enabled to perform control functions. With get, any parameter is
ignored, and the current enable state is returned. With set and a valid
password matching linuxcncrsh's --enablepw (EMCTOO if not specified), the
current connection is enabled for control functions. "OFF" may not
be used as a password and disables control functions for this
connection.
config [TBD]
Unused, ignore for now.
comm_mode {ascii|binary}
With get, any parameter is ignored and the current
communications mode is returned. With set, will set the communications mode to
the specified mode. The ASCII mode is the text request/reply mode, the binary
protocol is not currently designed or implemented.
comm_prot <version>
With get, any parameter is ignored and the current
protocol version used by the server is returned. With set, sets the server to
use the specified protocol version, provided it is lower than or equal to the
highest version number supported by the server implementation.
inifile
Not currently implemented! With get, returns the string
"emc.ini". Should return the full path and file name of the current
configuration INI file. Setting this does nothing.
plat
With get, returns the string "Linux".
ini <var> <section>
Not currently implemented, do not use! Should return the
string value of <var> in section <section> of the INI file.
debug <value>
With get, any parameter is ignored and the current
integer value of EMC_DEBUG is returned. Note that the value of EMC_DEBUG
returned is the from the UI's INI file, which may be different than emc's INI
file. With set, sends a command to the EMC to set the new debug level, and
sets the EMC_DEBUG global here to the same value. This will make the two
values the same, since they really ought to be the same.
set_wait {received|done}
The set_wait setting controls the wait after receiving a
command. It can be "received" (after the command was sent and
received) or "done" (after the command was done). With get, any
parameter is ignored and the current set_wait setting is returned. With set,
set the set_wait setting to the specified value.
wait {received|done}
With set, force a wait for the previous command to be
received, or done.
set_timeout <timeout>
With set, set the timeout for commands to return to
<timeout> seconds. Timeout is a real number. If it's <= 0.0, it means
wait forever. Default is 0.0, wait forever.
update {none|auto}
The update mode controls whether to return fresh or stale
values for "get" requests. When the update mode is "none"
it returns stale values, when it's "auto" it returns fresh values.
Defaults to "auto" for new connections. Set this to "none"
if you like to be confused.
error
With get, returns the current error string, or
"ok" if no error.
operator_display
With get, returns the current operator display string, or
"ok" if none.
operator_text
With get, returns the current operator text string, or
"ok" if none.
time
With get, returns the time, in seconds, from the start of
the epoch. This starting time depends on the platform.
estop {on|off}
With get, ignores any parameters and returns the current
estop setting as "on" or "off". With set, sets the estop
as specified. E-stop "on" means the machine is in the estop state
and won't run.
machine {on|off}
With get, ignores any parameters and returns the current
machine power setting as "on" or "off". With set, sets the
machine on or off as specified.
mode {manual|auto|mdi}
With get, ignores any parameters and returns the current
machine mode. With set, sets the machine mode as specified.
mist {on|off}
With get, ignores any parameters and returns the current
mist coolant setting. With set, sets the mist setting as specified.
flood {on|off}
With get, ignores any parameters and returns the current
flood coolant setting. With set, sets the flood setting as specified.
lube {on|off}
With get, ignores any parameters and returns the current
lube pump setting. With set, sets the lube pump setting as specified.
lube_level
With get, returns the lubricant level sensor reading as
"ok" or "low". With set, mocks you for wishful
thinking.
spindle
{forward|reverse|increase|decrease|constant|off}
With get, any parameter is ignored and the current
spindle state is returned as "forward", "reverse",
"increase", "decrease", or "off". With set, sets
the spindle as specified. Note that "increase" and
"decrease" will cause a speed change in the corresponding direction
until a "constant" command is sent.
brake {on|off}
With get, any parameter is ignored and the current brake
setting is returned. With set, the brake is set as specified.
tool
With get, returns the id of the currently loaded
tool.
tool_offset
With get, returns the currently applied tool length
offset.
load_tool_table <file>
With set, loads the tool table specified by
<file>.
home {0|1|2|...} | -1
With set, homes the indicated joint or, if -1, homes all
joints.
jog_stop joint_number|axis_letter
With set, stop any in-progress jog on the specified joint
or axis. If TELEOP_ENABLE is NO, use joint_number; If TELEOP_ENABLE is YES,
use axis_letter.
jog joint_number|axis_letter <speed>
With set, jog the specified joint or axis at
<speed>; sign of speed is direction. If TELEOP_ENABLE is NO, use
joint_number; If TELEOP_ENABLE is YES, use axis_letter.
jog_incr jog_number|axis_letter <speed>
<incr>
With set, jog the indicated joint or axis by increment
<incr> at the <speed>; sign of speed is direction. If
TELEOP_ENABLE is NO, use joint_number; If TELEOP_ENABLE is YES, use
axis_letter.
feed_override <percent>
With get, any parameter is ignored and the current feed
override is returned (as a percentage of commanded feed). With set, sets the
feed override as specified.
spindle_override <percent>
With get, any parameter is ignored and the current
spindle override is returned (as a percentage of commanded speed). With set,
sets the spindle override as specified.
abs_cmd_pos [{0|1|...}]
With get, returns the specified axis' commanded position
in absolute coordinates. If no axis is specified, returns all axes' commanded
absolute position.
abs_act_pos [{0|1|...}]
With get, returns the specified axis' actual position in
absolute coordinates. If no axis is specified, returns all axes' actual
absolute position.
rel_cmd_pos [{0|1|...}]
With get, returns the specified axis' commanded position
in relative coordinates, including tool length offset. If no axis is
specified, returns all axes' commanded relative position.
rel_act_pos [{0|1|...}]
With get, returns the specified axis' actual position in
relative coordinates, including tool length offset. If no axis is specified,
returns all axes' actual relative position.
joint_pos [{0|1|...}]
With get, returns the specified joint's actual position
in absolute coordinates, excluding tool length offset. If no joint is
specified, returns all joints' actual absolute position.
pos_offset [{X|Y|Z|R|P|W}]
With get, returns the position offset associated with the
world coordinate provided.
joint_limit [{0|1|...}]
With get, returns limit status of the specified joint as
"ok", "minsoft", "minhard", "maxsoft",
or "maxhard". If no joint number is specified, returns the limit
status of all joints.
joint_fault [{0|1|...}]
With get, returns the fault status of the specified joint
as "ok" or "fault". If no joint number is specified,
returns the fault status of all joints.
joint_homed [{0|1|...}]
With get, returns the homed status of the specified joint
as "homed" or "not". If no joint number is specified,
returns the homed status of all joints.
mdi <string>
With set, sends <string> as an MDI command.
task_plan_init
With set, initializes the program interpreter.
open <filename>
With set, opens the named file. The <filename> is
opened by linuxcnc, so it should either be an absolute path or a relative path
starting in the LinuxCNC working directory (the directory of the active INI
file).
run [<StartLine>]
With set, runs the opened program. If no StartLine is
specified, runs from the beginning. If a StartLine is specified, start line,
runs from that line. A start line of -1 runs in verify mode.
pause
With set, pause program execution.
resume
With set, resume program execution.
abort
With set, abort program or MDI execution.
step
With set, step the program one line.
program
With get, returns the name of the currently opened
program, or "none".
program_line
With get, returns the currently executing line of the
program.
program_status
With get, returns "idle", "running",
or "paused".
program_codes
With get, returns the string for the currently active
program codes.
joint_type [<joint>]
With get, returns "linear",
"angular", or "custom" for the type of the specified joint
(or for all joints if none is specified).
joint_units [<joint>]
With get, returns "inch", "mm",
"cm", or "deg", "rad", "grad", or
"custom", for the corresponding native units of the specified joint
(or for all joints if none is specified). The type of the axis (linear or
angular) is used to resolve which type of units are returned. The units are
obtained heuristically, based on the EMC_AXIS_STAT::units numerical value of
user units per mm or deg. For linear joints, something close to 0.03937 is
deemed "inch", 1.000 is "mm", 0.1 is "cm",
otherwise it's "custom". For angular joints, something close to
1.000 is deemed "deg", PI/180 is "rad", 100/90 is
"grad", otherwise it's "custom".
program_units
Synonym for program_linear_units.
program_linear_units
With get, returns "inch", "mm",
"cm", or "none", for the corresponding linear units that
are active in the program interpreter.
program_angular_units
With get, returns "deg", "rad",
"grad", or "none" for the corresponding angular units that
are active in the program interpreter.
user_linear_units
With get, returns "inch", "mm",
"cm", or "custom", for the corresponding native user
linear units of the LinuxCNC trajectory level. This is obtained heuristically,
based on the EMC_TRAJ_STAT::linearUnits numerical value of user units per mm.
Something close to 0.03937 is deemed "inch", 1.000 is
"mm", 0.1 is "cm", otherwise it's
"custom".
user_angular_units
Returns "deg", "rad",
"grad", or "custom" for the corresponding native user
angular units of the LinuxCNC trajectory level. Like with linear units, this
is obtained heuristically.
display_linear_units
With get, returns "inch", "mm",
"cm", or "custom", for the linear units that are active in
the display. This is effectively the value of linearUnitConversion.
display_angular_units
With get, returns "deg", "rad",
"grad", or "custom", for the angular units that are active
in the display. This is effectively the value of angularUnitConversion.
linear_unit_conversion {inch|mm|cm|auto}
With get, any parameter is ignored and the active unit
conversion is returned. With set, sets the unit to be displayed. If it's
"auto", the units to be displayed match the program units.
angular_unit_conversion {deg|rad|grad|auto}
With get, any parameter is ignored and the active unit
conversion is returned. With set, sets the units to be displayed. If it's
"auto", the units to be displayed match the program units.
probe_clear
With set, clear the probe tripped flag.
probe_tripped
With get, return the probe state - has the probe tripped
since the last clear?
probe_value
With get, return the current value of the probe
signal.
probe
With set, move toward a certain location. If the probe is
tripped on the way stop motion, record the position and raise the probe
tripped flag.
teleop_enable [on|off]
With get, any parameter is ignored and the current teleop
mode is returned. With set, sets the teleop mode as specified.
kinematics_type
With get, returns the type of kinematics functions used
(identity=1, serial=2, parallel=3, custom=4).
override_limits {on|off}
With get, any parameter is ignored and the
override_limits setting is returned. With set, the override_limits parameter
is set as specified. If override_limits is on, disables end of travel hardware
limits to allow jogging off of a limit. If parameters is off, then hardware
limits are enabled.
optional_stop {0|1}
With get, any parameter is ignored and the current
"optional stop on M1" setting is returned. With set, the setting is
set as specified.