📄 canon.hh
字号:
C. first_axis is the z-coordinate of the axis (center) of the arc.D. second_axis is the x-coordinate of the axis.E. axis_end_point is the y-coordinate of the end of the arc.If rotation is positive, the arc is traversed counterclockwise asviewed from the positive end of the coordinate axis perpendicular tothe currently selected plane. If rotation is negative, the arc istraversed clockwise. If rotation is 0, first_end and second_end mustbe the same as the corresponding coordinates of the current point andno arc is made (but there may be translation parallel to the axisperpendicular to the selected plane and motion along the rotational axes).If rotation is 1, more than 0 but not more than 360 degrees of arcshould be made. In general, if rotation is n, the amount of rotationin the arc should be more than ([n-1] x 360) but not more than (n x360).The radius of the helix is determined by the distance from the currentlocation to the axis of helix or by the distance from the end locationto the axis of the helix. It is recommended that the executing systemverify that the two radii are the same (within some tolerance) at thebeginning of executing this function.While the XYZ motion is going on, move the rotational axes so thatthey have always covered the same proportion of their total motion asa point moving along the arc has of its total motion.*/extern void STRAIGHT_FEED( double x, double y, double z#ifdef AA , double a_position#else#ifdef ALL_AXES , double a_position#endif#endif#ifdef BB , double b_position#else#ifdef ALL_AXES , double b_position#endif#endif#ifdef CC , double c_position#else#ifdef ALL_AXES , double c_position#endif#endif);/* Move at existing feed rate so that at any time during the move,all axes have covered the same proportion of their required motion.The meanings of the parameters is the same as for STRAIGHT_TRAVERSE.*/extern void STRAIGHT_PROBE ( double x, double y, double z#ifdef AA , double a_position#else#ifdef ALL_AXES , double a_position#endif#endif#ifdef BB , double b_position#else#ifdef ALL_AXES , double b_position#endif#endif#ifdef CC , double c_position#else#ifdef ALL_AXES , double c_position#endif#endif);/* Perform a probing operation. This is a temporary addition to thecanonical machining functions and its semantics are not defined.When the operation is finished, all axes should be back where theystarted. */extern void STOP();/* stop motion after current feed */extern void DWELL(double seconds);/* freeze x,y,z for a time *//* Spindle Functions */extern void SPINDLE_RETRACT_TRAVERSE();/* Retract the spindle at traverse rate to the fully retracted position. */extern void START_SPINDLE_CLOCKWISE();/* Turn the spindle clockwise at the currently set speed rate. If thespindle is already turning that way, this command has no effect. */extern void START_SPINDLE_COUNTERCLOCKWISE();/* Turn the spindle counterclockwise at the currently set speed rate. Ifthe spindle is already turning that way, this command has no effect. */extern void SET_SPINDLE_SPEED(double r);extern void SET_SPINDLE_SPEED_MODE(CANON_SPEED_MODE speed_mode);extern void SET_SPINDLE_MAX_SPEED(double s);/* 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 spindlerotation. If the spindle is already turning and is at a differentspeed, change to the speed given with this command. */extern void STOP_SPINDLE_TURNING();/* Stop the spindle from turning. If the spindle is already stopped, thiscommand may be given, but it will have no effect. */extern void SPINDLE_RETRACT();extern void ORIENT_SPINDLE(double orientation, CANON_DIRECTION direction);extern void LOCK_SPINDLE_Z();extern void USE_SPINDLE_FORCE();extern void USE_NO_SPINDLE_FORCE();/* Tool Functions */#ifdef LATHE_FLAGextern void USE_TOOL_LENGTH_OFFSET(double length,double zOffset); //lathe tool#elseextern void USE_TOOL_LENGTH_OFFSET(double length);#endifvoid USE_TOOL_RADIUS(double radius);extern void CHANGE_TOOL(int slot); /* slot is slot number *//* It is assumed that each cutting tool in the machine is assigned to aslot (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 byslot_number (if any) being inserted in the spindle.If there is no tool in the slot designated by the slot argument, therewill be no tool in the spindle after this command is executed and noerror condition will result in the controller. Similarly, if there isno tool in the spindle when this command is given, no tool will bereturned to the carousel and no error condition will result in thecontroller, whether or not a tool was previously selected in theprogram.It is expected that when the machine tool controller is initialized,the designated slot for a tool already in the spindle will beestablished. This may be done in any manner deemed fit, including(for, example) recording that information in a persistent, crash-prooflocation so it is always available from the last time the machine wasrun, or having the operator enter it. It is expected that the machinetool controller will remember that information as long as it isnot re-initialized; in particular, it will be remembered betweenprograms.For the purposes of this command, the tool includes the tool holder.For machines which can carry out a select_tool command separately froma change_tool command, the select_tool command must have been givenbefore the change_tool command, and the value of slot must be the slotnumber of the selected tool. */extern void SELECT_TOOL(int i); /* i is slot number *//* Miscellaneous Functions */extern void CLAMP_AXIS(CANON_AXIS axis);/* Clamp the given axis. If the machining center does not have a clampfor that axis, this command should result in an error condition in thecontroller.An attempt to move an axis while it is clamped should result in anerror condition in the controller. */extern void COMMENT(char *s);/* This function has no physical effect. If commands are being printed orlogged, the comment command is printed or logged, including the stringwhich is the value of comment_text. This serves to allow formalcomments at specific locations in programs or command files. */extern void DISABLE_FEED_OVERRIDE();extern void ENABLE_FEED_OVERRIDE();extern void DISABLE_SPEED_OVERRIDE();extern void ENABLE_SPEED_OVERRIDE();extern void FLOOD_OFF();/* Turn flood coolant off. */extern void FLOOD_ON();/* Turn flood coolant on. */extern void MESSAGE(char *s);extern void MIST_OFF();/* Turn mist coolant off. */extern void MIST_ON();/* Turn mist coolant on. */extern void PALLET_SHUTTLE();/* If the machining center has a pallet shuttle mechanism (a mechanismwhich switches the position of two pallets), this command should causethat 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 commandshould result in an error condition in the controller. */extern void TURN_PROBE_OFF();extern void TURN_PROBE_ON();extern void UNCLAMP_AXIS(CANON_AXIS axis);/* Unclamp the given axis. If the machining center does not have a clampfor that axis, this command should result in an error condition in thecontroller. *//* NURB Functions */extern void NURB_KNOT_VECTOR(); /* double knot values, -1.0 signals done */extern void NURB_CONTROL_POINT(int i, double x, double y, double z, double w );extern void NURB_FEED(double sStart, double sEnd);/* Program Functions */extern void OPTIONAL_PROGRAM_STOP();/* If the machining center has an optional stop switch, and it is onwhen this command is read from a program, stop executing the programat this point, but be prepared to resume with the next line of theprogram. If the machining center does not have an optional stopswitch, or commands are being executed with a stop after each onealready (such as when the interpreter is being used with keyboardinput), this command has no effect. */extern void PROGRAM_END();/* If a program is being read, stop executing the program and be preparedto accept a new program or to be shut down. */extern void PROGRAM_STOP();/* If this command is read from a program, stop executing the program atthis point, but be prepared to resume with the next line of theprogram. If commands are being executed with a stop after each onealready (such as when the interpreter is being used with keyboardinput), this command has no effect. *//*************************************************************************//* Canonical "Give me information" functions for the interpreter to callIn general, returned values are valid only if any canonical do it commandsthat may have been called for have been executed to completion. If a functionreturns a valid value regardless of execution, that is noted in the commentsbelow.*//* The interpreter is not using this function// Returns the system angular unit factor, in units / degreeextern double GET_EXTERNAL_ANGLE_UNIT_FACTOR();*/// Returns the system feed rateextern double GET_EXTERNAL_FEED_RATE();// Returns the system feed rateextern double GET_EXTERNAL_TASK_FEED_RATE();// Returns the system value for flood coolant, zero = off, non-zero = onextern int GET_EXTERNAL_FLOOD();/* The interpreter is not using this function// Returns the system length unit factor, in units / mmextern double GET_EXTERNAL_LENGTH_UNIT_FACTOR();*/// Returns the system length unit typeCANON_UNITS GET_EXTERNAL_LENGTH_UNIT_TYPE();// Returns the system value for mist coolant, zero = off, non-zero = onextern int GET_EXTERNAL_MIST();// Returns the current motion control modeextern CANON_MOTION_MODE GET_EXTERNAL_MOTION_CONTROL_MODE();/* The interpreter is not using these six GET_EXTERNAL_ORIGIN functions#ifdef AA// returns the current a-axis origin offsetextern double GET_EXTERNAL_ORIGIN_A();#endif#ifdef BB// returns the current b-axis origin offsetextern double GET_EXTERNAL_ORIGIN_B();#endif#ifdef CC// returns the current c-axis origin offsetextern double GET_EXTERNAL_ORIGIN_C();#endif// returns the current x-axis origin offsetextern double GET_EXTERNAL_ORIGIN_X();// returns the current y-axis origin offsetextern double GET_EXTERNAL_ORIGIN_Y();// returns the current z-axis origin offsetextern double GET_EXTERNAL_ORIGIN_Z();*/// 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.extern void GET_EXTERNAL_PARAMETER_FILE_NAME(char * filename, int max_size);extern void GET_EXTERNAL_TOOL_FILE_NAME(char * filename, int max_size);// returns the currently active planeextern CANON_PLANE GET_EXTERNAL_PLANE();#ifdef AA// returns the current a-axis positionextern double GET_EXTERNAL_POSITION_A();#endif#ifdef BB// returns the current b-axis positionextern double GET_EXTERNAL_POSITION_B();#endif#ifdef CC// returns the current c-axis positionextern double GET_EXTERNAL_POSITION_C();#endif// returns the current x-axis positionextern double GET_EXTERNAL_POSITION_X();//extern void CANON_UPDATE_ENDPOINT(double x, double y, double z, double a, double b, double c);// returns the current y-axis positionextern double GET_EXTERNAL_POSITION_Y();// returns the current z-axis positionextern double GET_EXTERNAL_POSITION_Z();#ifdef AA// Returns the machine A-axis position at the last probe trip.extern double GET_EXTERNAL_PROBE_POSITION_A();#endif#ifdef BB// Returns the machine B-axis position at the last probe trip.extern double GET_EXTERNAL_PROBE_POSITION_B();#endif#ifdef CC// Returns the machine C-axis position at the last probe trip.extern double GET_EXTERNAL_PROBE_POSITION_C();#endif// Returns the machine X-axis position at the last probe trip.extern double GET_EXTERNAL_PROBE_POSITION_X();// Returns the machine Y-axis position at the last probe trip.extern double GET_EXTERNAL_PROBE_POSITION_Y();// Returns the machine Z-axis position at the last probe trip.extern double GET_EXTERNAL_PROBE_POSITION_Z();// Returns the value for any analog non-contact probing.extern double GET_EXTERNAL_PROBE_VALUE();// Returns zero if queue is not empty, non-zero if the queue is empty// This always returns a valid valueextern int GET_EXTERNAL_QUEUE_EMPTY();// Returns the system value for spindle speed in rpmextern double GET_EXTERNAL_SPEED();// Returns the system value for direction of spindle turningextern CANON_DIRECTION GET_EXTERNAL_SPINDLE();// returns current tool length offsetextern double GET_EXTERNAL_TOOL_LENGTH_OFFSET();// Returns number of slots in carouselextern int GET_EXTERNAL_TOOL_MAX();// 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.extern int GET_EXTERNAL_TOOL_SLOT();// Returns the CANON_TOOL_TABLE structure associated with the tool// in the given pocketextern CANON_TOOL_TABLE GET_EXTERNAL_TOOL_TABLE(int pocket);// Returns the system traverse rateextern double GET_EXTERNAL_TRAVERSE_RATE();extern FILE * _outfile; /* where to print, set in main */extern CANON_TOOL_TABLE _tools[]; /* in canon.cc */extern int _tool_max; /* in canon.cc */extern char _parameter_file_name[]; /* in canon.cc */#define PARAMETER_FILE_NAME_LENGTH 100//*****************add by wp *******************////extern void SET_PRE_AUX_MOVE(int m_precode[4][4]); /*setup prefix M-code*/extern void SET_AUX_MOVE(int m_code[4][4]);/*setup ohter M,S,T code*/extern void SET_AUX_TOOL(int t_num);extern void SET_MIDAUX_END();extern void SET_AUX_SPINDLE(double s_num);extern void SET_SUB_CALL(int level);extern double GET_CURRENT_FEED_RATE(double rate);extern void CANON_PARAMETERS_UPDATE();#ifdef LATHE_FLAGextern void THREAD_FEED(double x, double y, double z, double pitch);extern void SET_REV_FEED(double rate);#endif//add end#endif /* ifndef CANON_HH */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -