Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

canon_pre.cc File Reference

#include "canon.hh"
#include <math.h>
#include <stdio.h>
#include <string.h>

Include dependency graph for canon_pre.cc:

Include dependency graph

Go to the source code of this file.

Defines

#define SET_TO   =
#define IS   ==
#define AND   &&
#define OR   ||
#define PRINT0(control)
#define PRINT1(control, arg1)
#define PRINT2(control, arg1, arg2)
#define PRINT3(control, arg1, arg2, arg3)
#define PRINT4(control, arg1, arg2, arg3, arg4)
#define PRINT5(control, arg1, arg2, arg3, arg4, arg5)
#define PRINT6(control, arg1, arg2, arg3, arg4, arg5, arg6)
#define PRINT7(control, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define PRINT10(control, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)

Functions

void rs274ngc_line_text (char *line_text, int max_size)
 copy the text of the most recently read line into the line_text array, but stop at max_size if the text is longer. More...

void print_nc_line_number ()
void SET_ORIGIN_OFFSETS (double x, double y, double z)
void USE_LENGTH_UNITS (CANON_UNITS in_unit)
void SET_TRAVERSE_RATE (double rate)
void STRAIGHT_TRAVERSE (double x, double y, double z)
void SET_FEED_RATE (double rate)
void SET_FEED_REFERENCE (CANON_FEED_REFERENCE reference)
void SET_MOTION_CONTROL_MODE (CANON_MOTION_MODE mode)
void SELECT_PLANE (CANON_PLANE in_plane)
void SET_CUTTER_RADIUS_COMPENSATION (double radius)
void START_CUTTER_RADIUS_COMPENSATION (int side)
void STOP_CUTTER_RADIUS_COMPENSATION ()
void START_SPEED_FEED_SYNCH ()
void STOP_SPEED_FEED_SYNCH ()
void ARC_FEED (double first_end, double second_end, double first_axis, double second_axis, int rotation, double axis_end_point)
void STRAIGHT_FEED (double x, double y, double z)
void STRAIGHT_PROBE (double x, double y, double z)
void DWELL (double seconds)
void SPINDLE_RETRACT_TRAVERSE ()
void START_SPINDLE_CLOCKWISE ()
void START_SPINDLE_COUNTERCLOCKWISE ()
void SET_SPINDLE_SPEED (double rpm)
void STOP_SPINDLE_TURNING ()
void SPINDLE_RETRACT ()
void ORIENT_SPINDLE (double orientation, CANON_DIRECTION direction)
void USE_NO_SPINDLE_FORCE ()
void USE_TOOL_LENGTH_OFFSET (double length)
void CHANGE_TOOL (int slot)
void SELECT_TOOL (int slot)
void CLAMP_AXIS (CANON_AXIS axis)
void COMMENT (char *s)
void DISABLE_FEED_OVERRIDE ()
void DISABLE_SPEED_OVERRIDE ()
void ENABLE_FEED_OVERRIDE ()
void ENABLE_SPEED_OVERRIDE ()
void FLOOD_OFF ()
void FLOOD_ON ()
void INIT_CANON ()
void MESSAGE (char *s)
void MIST_OFF ()
void MIST_ON ()
void PALLET_SHUTTLE ()
void TURN_PROBE_OFF ()
void TURN_PROBE_ON ()
void UNCLAMP_AXIS (CANON_AXIS axis)
void PROGRAM_STOP ()
void OPTIONAL_PROGRAM_STOP ()
void PROGRAM_END ()
double GET_EXTERNAL_FEED_RATE ()
 Returns the system feed rate. More...

int GET_EXTERNAL_FLOOD ()
 Returns the system value for flood coolant, zero = off, non-zero = on. More...

double GET_EXTERNAL_LENGTH_UNIT_FACTOR ()
CANON_UNITS GET_EXTERNAL_LENGTH_UNIT_TYPE ()
 Returns the system length unit type. More...

int GET_EXTERNAL_MIST ()
 Returns the system value for mist coolant, zero = off, non-zero = on. More...

CANON_MOTION_MODE GET_EXTERNAL_MOTION_CONTROL_MODE ()
 Returns the current motion control mode. More...

void GET_EXTERNAL_PARAMETER_FILE_NAME (char *file_name, int max_size)
 returns nothing but copies the name of the parameter file into the filename array, stopping at max_size if the name is longer An empty string may be placed in filename. More...

CANON_PLANE GET_EXTERNAL_PLANE ()
 returns the currently active plane. More...

double GET_EXTERNAL_POSITION_X ()
 returns the current x-axis position. More...

double GET_EXTERNAL_POSITION_Y ()
 returns the current y-axis position. More...

double GET_EXTERNAL_POSITION_Z ()
 returns the current z-axis position. More...

double GET_EXTERNAL_PROBE_POSITION_X ()
 Returns the machine X-axis position at the last probe trip. More...

double GET_EXTERNAL_PROBE_POSITION_Y ()
 Returns the machine Y-axis position at the last probe trip. More...

double GET_EXTERNAL_PROBE_POSITION_Z ()
 Returns the machine Z-axis position at the last probe trip. More...

double GET_EXTERNAL_PROBE_VALUE ()
 Returns the value for any analog non-contact probing. More...

int GET_EXTERNAL_QUEUE_EMPTY ()
 Returns zero if queue is not empty, non-zero if the queue is empty This always returns a valid value. More...

double GET_EXTERNAL_SPEED ()
 Returns the system value for spindle speed in rpm. More...

CANON_DIRECTION GET_EXTERNAL_SPINDLE ()
 Returns the system value for direction of spindle turning. More...

int GET_EXTERNAL_TOOL_SLOT ()
 Returns the system value for the carousel slot in which the tool currently in the spindle belongs. Return value zero means there is no tool in the spindle. More...

int GET_EXTERNAL_TOOL_MAX ()
 Returns number of slots in carousel. More...

CANON_TOOL_TABLE GET_EXTERNAL_TOOL_TABLE (int pocket)
 Returns the CANON_TOOL_TABLE structure associated with the tool in the given pocket. More...

double GET_EXTERNAL_TRAVERSE_RATE ()
 Returns the system traverse rate. More...


Variables

FILE * _outfile = NULL
CANON_PLANE _active_plane = 1
int _active_slot = 1
double _feed_rate = 0.0
int _flood = 0
double _length_unit_factor = 1
CANON_UNITS _length_unit_type = 2
int _line_number = 1
int _mist = 0
CANON_MOTION_MODE _motion_mode = 3
char _parameter_file_name [100]
double _probe_position_x = 0
double _probe_position_y = 0
double _probe_position_z = 0
double _program_origin_x = 0
double _program_origin_y = 0
double _program_origin_z = 0
double _program_position_x = 0
double _program_position_y = 0
double _program_position_z = 0
double _spindle_speed
CANON_DIRECTION _spindle_turning
int _tool_max = 68
CANON_TOOL_TABLE _tools [128]
double _traverse_rate


Define Documentation

#define SET_TO   =
 

**********************************************************************

Definition at line 23 of file canon_pre.cc.

Referenced by adjust_error_handling(), arc_data_comp_ijk(), arc_data_comp_r(), arc_data_ijk(), arc_data_r(), ARC_FEED(), CHANGE_TOOL(), check_g_codes(), close_and_downcase(), convert_arc(), convert_arc2(), convert_arc_comp1(), convert_arc_comp2(), convert_axis_offsets(), convert_coordinate_system(), convert_cutter_compensation_on(), convert_cycle_g83(), convert_cycle_xy(), convert_cycle_yz(), convert_cycle_zx(), convert_length_units(), convert_setup(), convert_stop(), convert_straight_comp1(), convert_straight_comp2(), convert_tool_length_offset(), enhance_block(), execute_binary1(), execute_binary2(), execute_unary(), find_ends(), find_relative(), find_turn(), FLOOD_OFF(), FLOOD_ON(), GET_EXTERNAL_PARAMETER_FILE_NAME(), inverse_time_rate_arc2(), inverse_time_rate_as(), main(), MIST_OFF(), MIST_ON(), print_nc_line_number(), read_a(), read_atan(), read_b(), read_c(), read_d(), read_f(), read_g(), read_h(), read_i(), read_integer_value(), read_j(), read_k(), read_l(), read_line_number(), read_m(), read_operation(), read_operation_unary(), read_p(), read_parameter(), read_parameter_setting(), read_q(), read_r(), read_real_expression(), read_real_number(), read_s(), read_t(), read_text(), read_x(), read_y(), read_z(), rs274ngc_init(), rs274ngc_open(), rs274ngc_synch(), SELECT_PLANE(), SET_FEED_RATE(), SET_MOTION_CONTROL_MODE(), SET_ORIGIN_OFFSETS(), SET_SPINDLE_SPEED(), SET_TRAVERSE_RATE(), START_SPINDLE_CLOCKWISE(), START_SPINDLE_COUNTERCLOCKWISE(), STOP_SPINDLE_TURNING(), STRAIGHT_FEED(), STRAIGHT_PROBE(), STRAIGHT_TRAVERSE(), USE_LENGTH_UNITS(), and write_g_codes().

#define IS   ==
 

Definition at line 24 of file canon_pre.cc.

Referenced by ARC_FEED(), CLAMP_AXIS(), convert_stop(), ORIENT_SPINDLE(), print_nc_line_number(), read_text(), rs274ngc_open(), SELECT_PLANE(), SET_FEED_REFERENCE(), SET_MOTION_CONTROL_MODE(), START_CUTTER_RADIUS_COMPENSATION(), START_SPINDLE_CLOCKWISE(), START_SPINDLE_COUNTERCLOCKWISE(), STRAIGHT_PROBE(), UNCLAMP_AXIS(), and USE_LENGTH_UNITS().

#define AND   &&
 

Definition at line 25 of file canon_pre.cc.

Referenced by adjust_error_handling(), arc_data_comp_ijk(), arc_data_r(), close_and_downcase(), convert_arc_comp1(), convert_arc_comp2(), convert_comment(), convert_motion(), convert_stop(), convert_straight_comp2(), find_straight_length(), interpret_from_file(), interpret_from_keyboard(), print_nc_line_number(), read_operation(), read_operation_unary(), read_real_number(), read_real_value(), read_text(), rs274ngc_open(), and rs274ngc_stack_name().

#define OR   ||
 

Definition at line 26 of file canon_pre.cc.

Referenced by check_g_codes(), close_and_downcase(), convert_axis_offsets(), convert_comment(), convert_modal_0(), convert_motion(), convert_probe(), convert_stop(), find_straight_length(), print_nc_line_number(), and read_text().

#define PRINT0 control   
 

Value:

if (1)                        \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++); \
           print_nc_line_number();                    \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control);                \
          } else

Definition at line 136 of file canon_pre.cc.

Referenced by DISABLE_FEED_OVERRIDE(), DISABLE_SPEED_OVERRIDE(), ENABLE_FEED_OVERRIDE(), ENABLE_SPEED_OVERRIDE(), FLOOD_OFF(), FLOOD_ON(), MIST_OFF(), MIST_ON(), OPTIONAL_PROGRAM_STOP(), PALLET_SHUTTLE(), PROGRAM_END(), PROGRAM_STOP(), SET_MOTION_CONTROL_MODE(), SPINDLE_RETRACT(), SPINDLE_RETRACT_TRAVERSE(), START_SPEED_FEED_SYNCH(), START_SPINDLE_CLOCKWISE(), START_SPINDLE_COUNTERCLOCKWISE(), STOP_CUTTER_RADIUS_COMPENSATION(), STOP_SPEED_FEED_SYNCH(), STOP_SPINDLE_TURNING(), TURN_PROBE_OFF(), TURN_PROBE_ON(), USE_LENGTH_UNITS(), and USE_NO_SPINDLE_FORCE().

#define PRINT1 control,
arg1   
 

Value:

if (1)                  \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++); \
           print_nc_line_number();                    \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1);          \
          } else

Definition at line 141 of file canon_pre.cc.

Referenced by CHANGE_TOOL(), CLAMP_AXIS(), COMMENT(), DWELL(), MESSAGE(), SELECT_PLANE(), SELECT_TOOL(), SET_CUTTER_RADIUS_COMPENSATION(), SET_FEED_RATE(), SET_FEED_REFERENCE(), SET_SPINDLE_SPEED(), SET_TRAVERSE_RATE(), START_CUTTER_RADIUS_COMPENSATION(), UNCLAMP_AXIS(), and USE_TOOL_LENGTH_OFFSET().

#define PRINT2 control,
arg1,
arg2   
 

Value:

if (1)            \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++); \
           print_nc_line_number();                    \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2);    \
          } else

Definition at line 146 of file canon_pre.cc.

Referenced by ORIENT_SPINDLE().

#define PRINT3 control,
arg1,
arg2,
arg3   
 

Value:

if (1)         \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);    \
           print_nc_line_number();                       \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2, arg3); \
          } else

Definition at line 151 of file canon_pre.cc.

#define PRINT4 control,
arg1,
arg2,
arg3,
arg4   
 

Value:

if (1)         \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);          \
           print_nc_line_number();                             \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2, arg3, arg4); \
          } else

Definition at line 156 of file canon_pre.cc.

#define PRINT5 control,
arg1,
arg2,
arg3,
arg4,
arg5   
 

Value:

if (1)         \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);                \
           print_nc_line_number();                                   \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2, arg3, arg4, arg5); \
          } else

Definition at line 161 of file canon_pre.cc.

#define PRINT6 control,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6   
 

Value:

if (1)         \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);                      \
           print_nc_line_number();                                         \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control, arg1, arg2, arg3, arg4, arg5, arg6); \
          } else

Definition at line 166 of file canon_pre.cc.

#define PRINT7 control,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7   
 

Value:

if (1) \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);                    \
           print_nc_line_number();                                       \
           {if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  control,                                    \
                           arg1, arg2, arg3, arg4, arg5, arg6, arg7);    \
          } else

Definition at line 171 of file canon_pre.cc.

#define PRINT10 control,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7,
arg8,
arg9,
arg10   
 

Value:

if (1)                                                            \
          {{if(_outfile==NULL){_outfile=stdout;}} fprintf(_outfile,  "%5d ", _line_number++);                       \
           print_nc_line_number();                                          \
           fprintf(_outfile, control,                                       \
                   arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);     \
          } else

Definition at line 177 of file canon_pre.cc.


Function Documentation

void rs274ngc_line_text char *    line_text,
int    max_size
 

copy the text of the most recently read line into the line_text array, but stop at max_size if the text is longer.

Canonical "Do it" functions

This is a set of dummy definitions for the canonical machining functions given in canon.hh. These functions just print themselves and, if necessary, update the dummy world model. On each output line is printed: 1. an output line number (sequential, starting with 1). 2. an input line number read from the input (or ... if not provided). 3. a printed representation of the function call which was made.

If an interpreter which makes these calls is compiled with this set of definitions, it can be used as a translator by redirecting output from stdout to a file.

Parameters:
line_text  ARGUMENTS
max_size  string: to copy line into

Definition at line 12095 of file rs274ngc_pre.cc.

void print_nc_line_number  
 

Definition at line 105 of file canon_pre.cc.

References _outfile, AND, IS, OR, rs274ngc_line_text(), and SET_TO.

Referenced by ARC_FEED(), SET_ORIGIN_OFFSETS(), STRAIGHT_FEED(), STRAIGHT_PROBE(), and STRAIGHT_TRAVERSE().

void SET_ORIGIN_OFFSETS double    x,
double    y,
double    z
 

Representation

Definition at line 187 of file canon_pre.cc.

References _line_number, _outfile, _program_origin_x, _program_origin_y, _program_origin_z, _program_position_x, _program_position_y, _program_position_z, print_nc_line_number(), and SET_TO.

Referenced by convert_axis_offsets(), convert_coordinate_system(), convert_setup(), convert_stop(), and rs274ngc_init().

void USE_LENGTH_UNITS CANON_UNITS    in_unit
 

Offset the origin to the point with absolute coordinates x, y, z, a, b, and c. Values of x, y, z, a, b, and c are real numbers. The units are whatever length units are being used at the time this command is given.

Definition at line 250 of file canon_pre.cc.

References _length_unit_factor, _length_unit_type, _program_origin_x, _program_origin_y, _program_origin_z, _program_position_x, _program_position_y, _program_position_z, CANON_UNITS, CANON_UNITS_INCHES, CANON_UNITS_MM, IS, PRINT0, and SET_TO.

Referenced by convert_length_units(), and rs274ngc_init().

void SET_TRAVERSE_RATE double    rate
 

Free Space Motion

Definition at line 287 of file canon_pre.cc.

References _traverse_rate, PRINT1, and SET_TO.

void STRAIGHT_TRAVERSE double    x,
double    y,
double    z
 

Set the traverse rate that will be used when the spindle traverses. It is expected that no cutting will occur while a traverse move is being made.

Definition at line 293 of file canon_pre.cc.

References _line_number, _outfile, _program_position_x, _program_position_y, _program_position_z, print_nc_line_number(), and SET_TO.

Referenced by convert_cycle_xy(), convert_cycle_yz(), convert_cycle_zx(), convert_home(), convert_straight(), convert_straight_comp1(), convert_straight_comp2(), and cycle_traverse().

void SET_FEED_RATE double    rate
 

Machining Attributes

Definition at line 344 of file canon_pre.cc.

References _feed_rate, PRINT1, and SET_TO.

Referenced by convert_feed_rate(), inverse_time_rate_arc(), inverse_time_rate_arc2(), inverse_time_rate_as(), and inverse_time_rate_straight().

void SET_FEED_REFERENCE CANON_FEED_REFERENCE    reference
 

SET_FEED_RATE sets the feed rate that will be used when the spindle is told to move at the currently set feed rate. The rate is either: 1. the rate of motion of the tool tip in the workpiece coordinate system, which is used when the feed_reference mode is "CANON_WORKPIECE", or 2. the rate of motion of the tool tip in the XYZ axis system, ignoring motion of other axes, which is used when the feed_reference mode is "CANON_XYZ".

The units of the rate are:

1. If the feed_reference mode is CANON_WORKPIECE: length units (inches or millimeters according to the setting of CANON_UNITS) per minute along the programmed path as seen by the workpiece.

2. If the feed_reference mode is CANON_XYZ: A. For motion including one rotational axis only: degrees per minute. B. For motion including two rotational axes only: degrees per minute In this case, the rate applies to the axis with the larger angle to cover, and the second rotational axis rotates so that it has always completed the same proportion of its required motion as has the rotational axis to which the feed rate applies. C. For motion involving one or more of the XYZ axes (with or without simultaneous rotational axis motion): length units (inches or millimeters according to the setting of CANON_UNITS) per minute along the programmed XYZ path.

Definition at line 350 of file canon_pre.cc.

References CANON_FEED_REFERENCE, CANON_WORKPIECE, IS, and PRINT1.

Referenced by rs274ngc_init().

void SET_MOTION_CONTROL_MODE CANON_MOTION_MODE    mode
 

This sets the feed_reference mode to either CANON_WORKPIECE or CANON_XYZ.

The CANON_WORKPIECE mode is more natural and general, since the rate at which the tool passes through the material must be controlled for safe and effective machining. For machines with more than the three standard XYZ axes, however, computing the feed rate may be time-consuming because the trajectories that result from motion in four or more axes may be complex. Computation of path lengths when only XYZ motion is considered is quite simple for the two standard motion types (straight lines and helical arcs).

Some programming languages (rs274kt, in particular) use CANON_XYZ mode. In these languages, the task of dealing with the rate at which the tool tip passes through material is pushed back on the NC-program generator, where the computation of path lengths is (almost always in 1995) an off-line activity where speed of calculation is not critical.

In CANON_WORKPIECE mode, some motions cannot be carried out as fast as the programmed feed rate would require because axis motions tend to cancel each other. For example, an arc in the YZ-plane can exactly cancel a rotation around the A-axis, so that the location of the tool tip with respect to the workpiece does not change at all during the motion; in this case, the motion should take no time, which is impossible at any finite rate of axis motion. In such cases, the axes should be moved as fast as possible consistent with accurate machining.

It would be possible to omit the SET_FEED_REFERENCE command from the canonical commands and operate always in one mode or the other, letting the interpreter issue SET_FEED_RATE commands, if necessary to compensate if the NC language being interpreted used the other mode.

This would create two disadvantages when the feed_reference mode assumed by the canonical commands differed from that assumed by the NC language being interpreted:

1. The output code could have a lot of SET_FEED_RATE commands not found in the input code; this is a relatively minor consideration.

2. If the interpreter reads a program in language which uses the CANON_XYZ mode and writes canonical commands in the CANON_WORKPIECE mode, both the interpreter and the executor of the output canonical commands would have to perform a lot of complex calculations. With the SET_FEED_REFERENCE command available, both do only simple calculations for the same motions.

Definition at line 356 of file canon_pre.cc.

References _motion_mode, CANON_CONTINUOUS, CANON_EXACT_PATH, CANON_EXACT_STOP, CANON_MOTION_MODE, IS, PRINT0, and SET_TO.

Referenced by convert_control_mode(), convert_cycle_xy(), convert_cycle_yz(), and convert_cycle_zx().

void SELECT_PLANE CANON_PLANE    in_plane
 

Use the specified units for length. Conceptually, the units must be either inches or millimeters.

Definition at line 377 of file canon_pre.cc.

References _active_plane, CANON_PLANE, CANON_PLANE_XY, CANON_PLANE_XZ, CANON_PLANE_YZ, IS, PRINT1, and SET_TO.

Referenced by convert_set_plane(), and convert_stop().

void SET_CUTTER_RADIUS_COMPENSATION double    radius
 

This sets the motion control mode to one of: CANON_EXACT_STOP, CANON_EXACT_PATH, or CANON_CONTINUOUS.

Definition at line 386 of file canon_pre.cc.

References PRINT1.

void START_CUTTER_RADIUS_COMPENSATION int    side
 

Set the radius to use when performing cutter radius compensation.

Definition at line 389 of file canon_pre.cc.

References CANON_SIDE_LEFT, CANON_SIDE_RIGHT, IS, and PRINT1.

void STOP_CUTTER_RADIUS_COMPENSATION  
 

Conceptually, the direction must be left (meaning the cutter stays to the left of the programmed path) or right.

Definition at line 395 of file canon_pre.cc.

References PRINT0.

void START_SPEED_FEED_SYNCH  
 

Do not apply cutter radius compensation when executing spindle translation commands.

Definition at line 398 of file canon_pre.cc.

References PRINT0.

void STOP_SPEED_FEED_SYNCH  
 

Definition at line 401 of file canon_pre.cc.

References PRINT0.

void ARC_FEED double    first_end,
double    second_end,
double    first_axis,
double    second_axis,
int    rotation,
double    axis_end_point
 

Machining Functions

Definition at line 406 of file canon_pre.cc.

References _active_plane, _line_number, _outfile, _program_position_x, _program_position_y, _program_position_z, CANON_PLANE_XY, CANON_PLANE_YZ, IS, print_nc_line_number(), and SET_TO.

Referenced by convert_arc2(), convert_arc_comp1(), convert_arc_comp2(), and convert_straight_comp2().

void STRAIGHT_FEED double    x,
double    y,
double    z
 

if (_active_plane IS CANON_PLANE_XZ)

Definition at line 473 of file canon_pre.cc.

References _line_number, _outfile, _program_position_x, _program_position_y, _program_position_z, print_nc_line_number(), and SET_TO.

Referenced by convert_straight(), convert_straight_comp1(), convert_straight_comp2(), and cycle_feed().

void STRAIGHT_PROBE double    x,
double    y,
double    z
 

This models backing the probe off 0.01 inch or 0.254 mm from the probe point towards the previous location after the probing, if the probe point is not the same as the previous point -- which it should not be.

Definition at line 528 of file canon_pre.cc.

References _length_unit_type, _line_number, _outfile, _probe_position_x, _probe_position_y, _probe_position_z, _program_position_x, _program_position_y, _program_position_z, CANON_UNITS_MM, IS, print_nc_line_number(), and SET_TO.

Referenced by convert_probe().

void DWELL double    seconds
 

void PARAMETRIC_2D_CURVE_FEED(FunctionPtr f1, FunctionPtr f2, double start_parameter_value, double end_parameter_value) {}

void PARAMETRIC_3D_CURVE_FEED(FunctionPtr xfcn, FunctionPtr yfcn, FunctionPtr zfcn, double start_parameter_value, double end_parameter_value) {}

Definition at line 619 of file canon_pre.cc.

References PRINT1.

Referenced by convert_cycle_g82(), convert_cycle_g86(), convert_cycle_g88(), convert_cycle_g89(), and convert_dwell().

void SPINDLE_RETRACT_TRAVERSE  
 

Spindle Functions

Definition at line 623 of file canon_pre.cc.

References PRINT0.

void START_SPINDLE_CLOCKWISE  
 

Retract the spindle at traverse rate to the fully retracted position.

Definition at line 626 of file canon_pre.cc.

References _spindle_speed, _spindle_turning, CANON_CLOCKWISE, CANON_STOPPED, IS, PRINT0, and SET_TO.

void START_SPINDLE_COUNTERCLOCKWISE  
 

Turn the spindle clockwise at the currently set speed rate. If the spindle is already turning that way, this command has no effect.

Definition at line 633 of file canon_pre.cc.

References _spindle_speed, _spindle_turning, CANON_COUNTERCLOCKWISE, CANON_STOPPED, IS, PRINT0, and SET_TO.

void SET_SPINDLE_SPEED double    rpm
 

Turn the spindle counterclockwise at the currently set speed rate. If the spindle is already turning that way, this command has no effect.

Definition at line 640 of file canon_pre.cc.

References _spindle_speed, PRINT1, and SET_TO.

Referenced by convert_speed().

void STOP_SPINDLE_TURNING  
 

Set the spindle speed that will be used when the spindle is turning. This is usually given in rpm and refers to the rate of spindle rotation. If the spindle is already turning and is at a different speed, change to the speed given with this command.

Definition at line 646 of file canon_pre.cc.

References _spindle_turning, CANON_STOPPED, PRINT0, and SET_TO.

void SPINDLE_RETRACT  
 

Stop the spindle from turning. If the spindle is already stopped, this command may be given, but it will have no effect.

Definition at line 652 of file canon_pre.cc.

References PRINT0.

void ORIENT_SPINDLE double    orientation,
CANON_DIRECTION    direction
 

Definition at line 655 of file canon_pre.cc.

References CANON_CLOCKWISE, CANON_DIRECTION, IS, and PRINT2.

Referenced by convert_cycle_g87().

void USE_NO_SPINDLE_FORCE  
 

Definition at line 661 of file canon_pre.cc.

References PRINT0.

void USE_TOOL_LENGTH_OFFSET double    length
 

Tool Functions

Definition at line 666 of file canon_pre.cc.

References PRINT1.

Referenced by convert_tool_length_offset().

void CHANGE_TOOL int    slot
 

Definition at line 669 of file canon_pre.cc.

References _active_slot, PRINT1, and SET_TO.

Referenced by convert_tool_change().

void SELECT_TOOL int    slot
 

It is assumed that each cutting tool in the machine is assigned to a slot (intended to correspond to a slot number in a tool carousel). This command results in the tool currently in the spindle (if any) being returned to its slot, and the tool from the slot designated by slot_number (if any) being inserted in the spindle.

If there is no tool in the slot designated by the slot argument, there will be no tool in the spindle after this command is executed and no error condition will result in the controller. Similarly, if there is no tool in the spindle when this command is given, no tool will be returned to the carousel and no error condition will result in the controller, whether or not a tool was previously selected in the program.

It is expected that when the machine tool controller is initialized, the designated slot for a tool already in the spindle will be established. This may be done in any manner deemed fit, including (for, example) recording that information in a persistent, crash-proof location so it is always available from the last time the machine was run, or having the operator enter it. It is expected that the machine tool controller will remember that information as long as it is not re-initialized; in particular, it will be remembered between programs.

For the purposes of this command, the tool includes the tool holder.

For machines which can carry out a select_tool command separately from a change_tool command, the select_tool command must have been given before the change_tool command, and the value of slot must be the slot number of the selected tool.

Definition at line 675 of file canon_pre.cc.

References PRINT1.

Referenced by convert_tool_select().

void CLAMP_AXIS CANON_AXIS    axis
 

Misc Functions

Definition at line 681 of file canon_pre.cc.

References CANON_AXIS, CANON_AXIS_A, CANON_AXIS_C, CANON_AXIS_X, CANON_AXIS_Y, CANON_AXIS_Z, IS, and PRINT1.

void COMMENT char *    s
 

Clamp the given axis. If the machining center does not have a clamp for that axis, this command should result in an error condition in the controller.

An attempt to move an axis while it is clamped should result in an error condition in the controller.

Definition at line 689 of file canon_pre.cc.

References PRINT1.

Referenced by convert_comment(), convert_coordinate_system(), convert_cutter_compensation_off(), convert_cutter_compensation_on(), convert_distance_mode(), convert_feed_mode(), convert_motion(), convert_retract_mode(), convert_setup(), and find_ends().

void DISABLE_FEED_OVERRIDE  
 

This function has no physical effect. If commands are being printed or logged, the comment command is printed or logged, including the string which is the value of comment_text. This serves to allow formal comments at specific locations in programs or command files.

Definition at line 692 of file canon_pre.cc.

References PRINT0.

void DISABLE_SPEED_OVERRIDE  
 

Definition at line 695 of file canon_pre.cc.

References PRINT0.

void ENABLE_FEED_OVERRIDE  
 

Definition at line 698 of file canon_pre.cc.

References PRINT0.

void ENABLE_SPEED_OVERRIDE  
 

Definition at line 701 of file canon_pre.cc.

References PRINT0.

void FLOOD_OFF  
 

Definition at line 704 of file canon_pre.cc.

References _flood, PRINT0, and SET_TO.

void FLOOD_ON  
 

Turn flood coolant off.

Definition at line 710 of file canon_pre.cc.

References _flood, PRINT0, and SET_TO.

void INIT_CANON  
 

reads world model data into the canonical interface

Definition at line 716 of file canon_pre.cc.

void MESSAGE char *    s
 

Turn flood coolant on.

Definition at line 720 of file canon_pre.cc.

References PRINT1.

Referenced by convert_comment().

void MIST_OFF  
 

Definition at line 723 of file canon_pre.cc.

References _mist, PRINT0, and SET_TO.

void MIST_ON  
 

Turn mist coolant off.

Definition at line 729 of file canon_pre.cc.

References _mist, PRINT0, and SET_TO.

void PALLET_SHUTTLE  
 

Turn mist coolant on.

Definition at line 735 of file canon_pre.cc.

References PRINT0.

void TURN_PROBE_OFF  
 

If the machining center has a pallet shuttle mechanism (a mechanism which switches the position of two pallets), this command should cause that switch to be made. If either or both of the pallets are missing, this will not result in an error condition in the controller.

If the machining center does not have a pallet shuttle, this command should result in an error condition in the controller.

Definition at line 738 of file canon_pre.cc.

References PRINT0.

void TURN_PROBE_ON  
 

Definition at line 741 of file canon_pre.cc.

References PRINT0.

void UNCLAMP_AXIS CANON_AXIS    axis
 

Definition at line 744 of file canon_pre.cc.

References CANON_AXIS, CANON_AXIS_A, CANON_AXIS_B, CANON_AXIS_C, CANON_AXIS_X, CANON_AXIS_Y, CANON_AXIS_Z, IS, and PRINT1.

void PROGRAM_STOP  
 

Program Functions

Definition at line 755 of file canon_pre.cc.

References PRINT0.

void OPTIONAL_PROGRAM_STOP  
 

Program Functions

Definition at line 758 of file canon_pre.cc.

References PRINT0.

void PROGRAM_END  
 

If the machining center has an optional stop switch, and it is on when this command is read from a program, stop executing the program at this point, but be prepared to resume with the next line of the program. If the machining center does not have an optional stop switch, or commands are being executed with a stop after each one already (such as when the interpreter is being used with keyboard input), this command has no effect.

Definition at line 761 of file canon_pre.cc.

References PRINT0.

double GET_EXTERNAL_FEED_RATE  
 

Returns the system feed rate.

Returns the system feed rate

Definition at line 785 of file canon_pre.cc.

References _feed_rate.

int GET_EXTERNAL_FLOOD  
 

Returns the system value for flood coolant, zero = off, non-zero = on.

Returns the system flood coolant setting zero = off, non-zero = on

Definition at line 791 of file canon_pre.cc.

References _flood.

double GET_EXTERNAL_LENGTH_UNIT_FACTOR  
 

Returns the system length unit factor, in units per mm

Definition at line 797 of file canon_pre.cc.

References _length_unit_factor.

CANON_UNITS GET_EXTERNAL_LENGTH_UNIT_TYPE  
 

Returns the system length unit type.

Returns the system length unit type

Definition at line 803 of file canon_pre.cc.

References _length_unit_type, and CANON_UNITS.

int GET_EXTERNAL_MIST  
 

Returns the system value for mist coolant, zero = off, non-zero = on.

Returns the system mist coolant setting zero = off, non-zero = on

Definition at line 809 of file canon_pre.cc.

References _mist.

CANON_MOTION_MODE GET_EXTERNAL_MOTION_CONTROL_MODE  
 

Returns the current motion control mode.

Definition at line 815 of file canon_pre.cc.

References _motion_mode, and CANON_MOTION_MODE.

void GET_EXTERNAL_PARAMETER_FILE_NAME char *    file_name,
int    max_size
 

returns nothing but copies the name of the parameter file into the filename array, stopping at max_size if the name is longer An empty string may be placed in filename.

maximum number of characters to copy

Parameters:
max_size  string: to copy file name into

Definition at line 867 of file canon_pre.cc.

References _parameter_file_name, and SET_TO.

Referenced by rs274ngc_exit(), and rs274ngc_init().

CANON_PLANE GET_EXTERNAL_PLANE  
 

returns the currently active plane.

Definition at line 877 of file canon_pre.cc.

References _active_plane, and CANON_PLANE.

double GET_EXTERNAL_POSITION_X  
 

returns the current x-axis position.

returns the current x-axis position

Definition at line 907 of file canon_pre.cc.

References _program_position_x.

double GET_EXTERNAL_POSITION_Y  
 

returns the current y-axis position.

returns the current y-axis position

Definition at line 913 of file canon_pre.cc.

References _program_position_y.

double GET_EXTERNAL_POSITION_Z  
 

returns the current z-axis position.

returns the current z-axis position

Definition at line 919 of file canon_pre.cc.

References _program_position_z.

double GET_EXTERNAL_PROBE_POSITION_X  
 

Returns the machine X-axis position at the last probe trip.

returns the x-axis position at the last probe trip. This is only valid once the probe command has executed to completion.

Definition at line 953 of file canon_pre.cc.

References _probe_position_x.

double GET_EXTERNAL_PROBE_POSITION_Y  
 

Returns the machine Y-axis position at the last probe trip.

returns the y-axis position at the last probe trip. This is only valid once the probe command has executed to completion.

Definition at line 960 of file canon_pre.cc.

References _probe_position_y.

double GET_EXTERNAL_PROBE_POSITION_Z  
 

Returns the machine Z-axis position at the last probe trip.

returns the z-axis position at the last probe trip. This is only valid once the probe command has executed to completion.

Definition at line 967 of file canon_pre.cc.

References _probe_position_z.

double GET_EXTERNAL_PROBE_VALUE  
 

Returns the value for any analog non-contact probing.

It is not expected this will ever be called.

Definition at line 975 of file canon_pre.cc.

int GET_EXTERNAL_QUEUE_EMPTY  
 

Returns zero if queue is not empty, non-zero if the queue is empty This always returns a valid value.

In the stand-alone interpreter, there is no queue, so it is always empty

Definition at line 982 of file canon_pre.cc.

double GET_EXTERNAL_SPEED  
 

Returns the system value for spindle speed in rpm.

Returns the system value for spindle speed in rpm

Definition at line 988 of file canon_pre.cc.

References _spindle_speed.

CANON_DIRECTION GET_EXTERNAL_SPINDLE  
 

Returns the system value for direction of spindle turning.

Returns the system value for direction of spindle turning

Definition at line 994 of file canon_pre.cc.

References _spindle_turning, and CANON_DIRECTION.

int GET_EXTERNAL_TOOL_SLOT  
 

Returns the system value for the carousel slot in which the tool currently in the spindle belongs. Return value zero means there is no tool in the spindle.

Returns the system value for the carousel slot in which the tool currently in the spindle belongs. Return value zero means there is no tool in the spindle.

Definition at line 1002 of file canon_pre.cc.

References _active_slot.

int GET_EXTERNAL_TOOL_MAX  
 

Returns number of slots in carousel.

Returns maximum number of tools

Definition at line 1008 of file canon_pre.cc.

References _tool_max.

CANON_TOOL_TABLE GET_EXTERNAL_TOOL_TABLE int    pocket
 

Returns the CANON_TOOL_TABLE structure associated with the tool in the given pocket.

Returns the CANON_TOOL_TABLE structure associated with the tool in the given pocket

Definition at line 1015 of file canon_pre.cc.

Referenced by rs274ngc_load_tool_table().

double GET_EXTERNAL_TRAVERSE_RATE  
 

Returns the system traverse rate.

Returns the system traverse rate

Definition at line 1021 of file canon_pre.cc.

References _traverse_rate.


Variable Documentation

FILE* _outfile = NULL
 

where to print

Definition at line 84 of file canon_pre.cc.

CANON_PLANE _active_plane = 1 [static]
 

Dummy world model

Definition at line 33 of file canon_pre.cc.

Referenced by ARC_FEED(), GET_EXTERNAL_PLANE(), and SELECT_PLANE().

int _active_slot = 1 [static]
 

Definition at line 34 of file canon_pre.cc.

Referenced by CHANGE_TOOL(), and GET_EXTERNAL_TOOL_SLOT().

double _feed_rate = 0.0 [static]
 

Definition at line 35 of file canon_pre.cc.

Referenced by GET_EXTERNAL_FEED_RATE(), and SET_FEED_RATE().

int _flood = 0 [static]
 

Definition at line 36 of file canon_pre.cc.

Referenced by FLOOD_OFF(), FLOOD_ON(), and GET_EXTERNAL_FLOOD().

double _length_unit_factor = 1 [static]
 

Definition at line 37 of file canon_pre.cc.

Referenced by GET_EXTERNAL_LENGTH_UNIT_FACTOR(), and USE_LENGTH_UNITS().

CANON_UNITS _length_unit_type = 2 [static]
 

1 for MM 25.4 for inch

Definition at line 38 of file canon_pre.cc.

Referenced by GET_EXTERNAL_LENGTH_UNIT_TYPE(), STRAIGHT_PROBE(), and USE_LENGTH_UNITS().

int _line_number = 1 [static]
 

Definition at line 39 of file canon_pre.cc.

Referenced by ARC_FEED(), SET_ORIGIN_OFFSETS(), STRAIGHT_FEED(), STRAIGHT_PROBE(), and STRAIGHT_TRAVERSE().

int _mist = 0 [static]
 

Definition at line 40 of file canon_pre.cc.

Referenced by GET_EXTERNAL_MIST(), MIST_OFF(), and MIST_ON().

CANON_MOTION_MODE _motion_mode = 3 [static]
 

Definition at line 41 of file canon_pre.cc.

Referenced by GET_EXTERNAL_MOTION_CONTROL_MODE(), and SET_MOTION_CONTROL_MODE().

char _parameter_file_name[ 100 ]
 

in canon.cc

Definition at line 42 of file canon_pre.cc.

Referenced by GET_EXTERNAL_PARAMETER_FILE_NAME().

double _probe_position_x = 0 [static]
 

Not static.Driver writes

Definition at line 52 of file canon_pre.cc.

Referenced by GET_EXTERNAL_PROBE_POSITION_X(), and STRAIGHT_PROBE().

double _probe_position_y = 0 [static]
 

Definition at line 53 of file canon_pre.cc.

Referenced by GET_EXTERNAL_PROBE_POSITION_Y(), and STRAIGHT_PROBE().

double _probe_position_z = 0 [static]
 

Definition at line 54 of file canon_pre.cc.

Referenced by GET_EXTERNAL_PROBE_POSITION_Z(), and STRAIGHT_PROBE().

double _program_origin_x = 0 [static]
 

Definition at line 64 of file canon_pre.cc.

Referenced by SET_ORIGIN_OFFSETS(), and USE_LENGTH_UNITS().

double _program_origin_y = 0 [static]
 

Definition at line 65 of file canon_pre.cc.

Referenced by SET_ORIGIN_OFFSETS(), and USE_LENGTH_UNITS().

double _program_origin_z = 0 [static]
 

Definition at line 66 of file canon_pre.cc.

Referenced by SET_ORIGIN_OFFSETS(), and USE_LENGTH_UNITS().

double _program_position_x = 0 [static]
 

Definition at line 76 of file canon_pre.cc.

Referenced by ARC_FEED(), GET_EXTERNAL_POSITION_X(), SET_ORIGIN_OFFSETS(), STRAIGHT_FEED(), STRAIGHT_PROBE(), STRAIGHT_TRAVERSE(), and USE_LENGTH_UNITS().

double _program_position_y = 0 [static]
 

Definition at line 77 of file canon_pre.cc.

Referenced by ARC_FEED(), GET_EXTERNAL_POSITION_Y(), SET_ORIGIN_OFFSETS(), STRAIGHT_FEED(), STRAIGHT_PROBE(), STRAIGHT_TRAVERSE(), and USE_LENGTH_UNITS().

double _program_position_z = 0 [static]
 

Definition at line 78 of file canon_pre.cc.

Referenced by ARC_FEED(), GET_EXTERNAL_POSITION_Z(), SET_ORIGIN_OFFSETS(), STRAIGHT_FEED(), STRAIGHT_PROBE(), STRAIGHT_TRAVERSE(), and USE_LENGTH_UNITS().

double _spindle_speed [static]
 

Definition at line 79 of file canon_pre.cc.

Referenced by GET_EXTERNAL_SPEED(), SET_SPINDLE_SPEED(), START_SPINDLE_CLOCKWISE(), and START_SPINDLE_COUNTERCLOCKWISE().

CANON_DIRECTION _spindle_turning [static]
 

Definition at line 80 of file canon_pre.cc.

Referenced by GET_EXTERNAL_SPINDLE(), START_SPINDLE_CLOCKWISE(), START_SPINDLE_COUNTERCLOCKWISE(), and STOP_SPINDLE_TURNING().

int _tool_max = 68
 

in canon.cc

Definition at line 81 of file canon_pre.cc.

Referenced by GET_EXTERNAL_TOOL_MAX().

CANON_TOOL_TABLE _tools[ 128 ]
 

Not static. Driver reads

Definition at line 82 of file canon_pre.cc.

double _traverse_rate [static]
 

Not static. Driver writes

Definition at line 83 of file canon_pre.cc.

Referenced by GET_EXTERNAL_TRAVERSE_RATE(), and SET_TRAVERSE_RATE().


Generated on Mon Feb 11 21:31:16 2002 for rs274ngc by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001