- Posts: 66
- Thank you received: 0
save and restore path control mode
I call subroutine where I need save some variables (g20/g21, metric/imperial etc) and restore it at the end.
It is not problem with predefined named parameters like
#<_metric> , #<_imperial> , #<_absolute> ,#<_incremental>
but I cannot find variables for path control mode (G61, G64, G64 Px)
exist way how to do ?
Thanks Martin
Please Log in to join the conversation.
linuxcnc.org/docs/html/gcode/overview.html#_parameters
#<_global named parameter> is a global named parameter. They are accessible from within called subroutines and may set values within subroutines that are accessible to the caller. As far as scope is concerned, they act just like regular numeric parameters. They are not stored in files.
linuxcnc.org/docs/html/gcode/overview.ht...:numbered-parameters
Numbered Parameters Persistence
The values of parameters in the persistent range are retained over time, even if the machining center is powered down. LinuxCNC uses a parameter file to ensure persistence. It is managed by the Interpreter. The Interpreter reads the file when it starts up, and writes the file when it exits.
The format of a parameter file is shown in Table Parameter File Format.
The Interpreter expects the file to have two columns. It skips any lines which do not contain exactly two numeric values. The first column is expected to contain an integer value (the parameter’s number). The second column contains a floating point number (this parameter’s last value). The value is represented as a double-precision floating point number inside the Interpreter, but a decimal point is not required in the file.
Parameters in the user-defined range (31-5000) may be added to this file. Such parameters will be read by the Interpreter and written to the file as it exits.
Rick G
Please Log in to join the conversation.
G64/G61 Path Control Mode is set in the beginning of g-code or in INI file. I use remap for M6 and I need change path control mode. After tool is changed I need restore previous value.
Martin
Please Log in to join the conversation.
Perhaps change #<tol> , a named parameter to a numbered parameter. (a regular named parameter is not global, however a global named parameter or a numbered parameter is).
So to save the parameter value to numbered parameter when you start add something like this to your start up code...
#<3001> =0.001
Later when you want to restore that value use
Rick G
Please Log in to join the conversation.
I need find different solution. Same as for <metric>. or <rpm> in python program. This named parameter for path control propably doesnt exist.....
M
Please Log in to join the conversation.
linuxcnc.org/docs/html/gcode/m-code.html#mcode:m70
and M72, M73
Rick G
Please Log in to join the conversation.
thanks for your help.
I studied everythink about M70 . But it looks lile this command save only MOTION_CONTROL_MODE G61 vs G64 not MOTION_CONTROL_TOLERANCE. P parametr on G64
I tried this ngc
first rectangle has sharp corners p 0.001, but second has arc in corners because M72 dont restore cam tolerance parametr and P20 is used instead of
Attachment not found
I looked at source code and find this.
interp_namedparams.cc
// 1 if G98 set
init_readonly_param("_retract_r_plane", NP_RETRACT_R_PLANE, PA_USE_LOOKUP);
// 1 if G99 set
init_readonly_param("_retract_old_z", NP_RETRACT_OLD_Z, PA_USE_LOOKUP);
// really esoteric
// init_readonly_param("_control_mode", 110, PA_USE_LOOKUP);
// 1 if G97 is on
init_readonly_param("_spindle_rpm_mode", NP_SPINDLE_RPM_MODE, PA_USE_LOOKUP);
init_readonly_param("_spindle_css_mode", NP_SPINDLE_CSS_MODE, PA_USE_LOOKUP);
Martin
Please Log in to join the conversation.
Rick G
Please Log in to join the conversation.
