00001 #ifndef CANON_HH 00002 #define CANON_HH 00003 00004 #include <stdio.h> // FILE 00005 00006 /* canon.hh 00007 00008 This is the header file that all applications that use the 00009 canonical commands for three- to six-axis machining should include. 00010 00011 Three mutually orthogonal (in a right-handed system) X, Y, and Z axes 00012 are always present. In addition, there may be zero to three rotational 00013 axes: A (parallel to the X-axis), B (parallel to the Y-axis), and C 00014 (parallel to the Z-axis). 00015 00016 In the functions that use rotational axes, the axis value is that of a 00017 wrapped linear axis, in degrees. 00018 00019 It is assumed in these activities that the spindle tip is always at 00020 some location called the "current location," and the controller always 00021 knows where that is. It is also assumed that there is always a 00022 "selected plane" which must be the XY-plane, the YZ-plane, or the 00023 ZX-plane of the machine. 00024 00025 */ 00026 00027 typedef int CANON_PLANE; 00028 #define CANON_PLANE_XY 1 00029 #define CANON_PLANE_YZ 2 00030 #define CANON_PLANE_XZ 3 00031 00032 typedef int CANON_UNITS; 00033 #define CANON_UNITS_INCHES 1 00034 #define CANON_UNITS_MM 2 00035 #define CANON_UNITS_CM 3 00036 00037 typedef int CANON_MOTION_MODE; 00038 #define CANON_EXACT_STOP 1 00039 #define CANON_EXACT_PATH 2 00040 #define CANON_CONTINUOUS 3 00041 00042 typedef int CANON_SPEED_FEED_MODE; 00043 #define CANON_SYNCHED 1 00044 #define CANON_INDEPENDENT 2 00045 00046 typedef int CANON_DIRECTION; 00047 #define CANON_STOPPED 1 00048 #define CANON_CLOCKWISE 2 00049 #define CANON_COUNTERCLOCKWISE 3 00050 00051 typedef int CANON_FEED_REFERENCE; 00052 #define CANON_WORKPIECE 1 00053 #define CANON_XYZ 2 00054 00055 typedef int CANON_SIDE; 00056 #define CANON_SIDE_RIGHT 1 00057 #define CANON_SIDE_LEFT 2 00058 #define CANON_SIDE_OFF 3 00059 00060 typedef int CANON_AXIS; 00061 #define CANON_AXIS_X 1 00062 #define CANON_AXIS_Y 2 00063 #define CANON_AXIS_Z 3 00064 #define CANON_AXIS_A 4 00065 #define CANON_AXIS_B 5 00066 #define CANON_AXIS_C 6 00067 00068 /* Currently using the typedefs above rather than the enums below 00069 typedef enum {CANON_PLANE_XY, CANON_PLANE_YZ, CANON_PLANE_XZ} CANON_PLANE; 00070 typedef enum {CANON_UNITS_INCHES, CANON_UNITS_MM, CANON_UNITS_CM} CANON_UNITS; 00071 typedef enum {CANON_EXACT_STOP, CANON_EXACT_PATH, CANON_CONTINUOUS} 00072 CANON_MOTION_MODE; 00073 typedef enum {CANON_SYNCHED, CANON_INDEPENDENT} CANON_SPEED_FEED_MODE; 00074 typedef enum {CANON_STOPPED, CANON_CLOCKWISE, CANON_COUNTERCLOCKWISE} 00075 CANON_DIRECTION; 00076 typedef enum {CANON_WORKPIECE, CANON_XYZ} CANON_FEED_REFERENCE; 00077 typedef enum {CANON_SIDE_RIGHT, CANON_SIDE_LEFT, CANON_SIDE_OFF} CANON_SIDE; 00078 typedef enum {CANON_AXIS_X, CANON_AXIS_Y, CANON_AXIS_Z, CANON_AXIS_A, 00079 CANON_AXIS_B, CANON_AXIS_C} CANON_AXIS; 00080 */ 00081 00082 struct CANON_VECTOR 00083 { 00084 CANON_VECTOR() {} 00085 CANON_VECTOR(double _x, double _y, double _z) {x = _x; y = _y; z = _z;} 00086 double x, y, z; 00087 }; 00088 00089 struct CANON_POSITION 00090 { 00091 CANON_POSITION() {} 00092 CANON_POSITION(double _x, double _y, double _z 00093 #ifdef AA 00094 , double _a 00095 #endif 00096 #ifdef BB 00097 , double _b 00098 #endif 00099 #ifdef CC 00100 , double _c 00101 #endif 00102 ) 00103 { 00104 x = _x; y = _y; z = _z; 00105 #ifdef AA 00106 a = _a; 00107 #endif 00108 #ifdef BB 00109 b = _b; 00110 #endif 00111 #ifdef CC 00112 c = _c; 00113 #endif 00114 } 00115 double x, y, z 00116 #ifdef AA 00117 , a 00118 #endif 00119 #ifdef BB 00120 , b 00121 #endif 00122 #ifdef CC 00123 , c 00124 #endif 00125 ;}; 00126 00127 /* Tools are numbered 1..CANON_TOOL_MAX, with tool 0 meaning no tool. */ 00128 #define CANON_TOOL_MAX 128 // max size of carousel handled 00129 #define CANON_TOOL_ENTRY_LEN 256 // how long each file line can be 00130 00131 struct CANON_TOOL_TABLE 00132 { 00133 int id; 00134 double length; 00135 double diameter; 00136 }; 00137 00138 /* Initialization */ 00139 00140 /* reads world model data into the canonical interface */ 00141 extern void INIT_CANON(); 00142 00143 /* Representation */ 00144 00145 extern void SET_ORIGIN_OFFSETS( 00146 double x, double y, double z 00147 #ifdef AA 00148 , double a 00149 #else 00150 #ifdef ALL_AXES 00151 , double a 00152 #endif 00153 #endif 00154 #ifdef BB 00155 , double b 00156 #else 00157 #ifdef ALL_AXES 00158 , double b 00159 #endif 00160 #endif 00161 #ifdef CC 00162 , double c 00163 #else 00164 #ifdef ALL_AXES 00165 , double c 00166 #endif 00167 #endif 00168 ); 00169 00170 /* Offset the origin to the point with absolute coordinates x, y, z, 00171 a, b, and c. Values of x, y, z, a, b, and c are real numbers. The units 00172 are whatever length units are being used at the time this command is 00173 given. */ 00174 00175 extern void USE_LENGTH_UNITS(CANON_UNITS u); 00176 00177 /* Use the specified units for length. Conceptually, the units must 00178 be either inches or millimeters. */ 00179 00180 00181 extern void SELECT_PLANE(CANON_PLANE pl); 00182 00183 /* Use the plane designated by selected_plane as the selected plane. 00184 Conceptually, the selected_plane must be the XY-plane, the XZ-plane, or 00185 the YZ-plane. */ 00186 00187 /* Free Space Motion */ 00188 00189 extern void SET_TRAVERSE_RATE(double rate); 00190 00191 /* Set the traverse rate that will be used when the spindle traverses. It 00192 is expected that no cutting will occur while a traverse move is being 00193 made. */ 00194 00195 extern void STRAIGHT_TRAVERSE( 00196 double x, double y, double z 00197 #ifdef AA 00198 , double a_position 00199 #else 00200 #ifdef ALL_AXES 00201 , double a_position 00202 #endif 00203 #endif 00204 #ifdef BB 00205 , double b_position 00206 #else 00207 #ifdef ALL_AXES 00208 , double b_position 00209 #endif 00210 #endif 00211 #ifdef CC 00212 , double c_position 00213 #else 00214 #ifdef ALL_AXES 00215 , double c_position 00216 #endif 00217 #endif 00218 ); 00219 /* 00220 00221 Move at traverse rate so that at any time during the move, all axes 00222 have covered the same proportion of their required motion. The final 00223 XYZ position is given by x, y, and z. If there is an a-axis, its final 00224 position is given by a_position, and similarly for the b-axis and c-axis. 00225 A more positive value of a rotational axis is in the counterclockwise 00226 direction. 00227 00228 Clockwise or counterclockwise is from the point of view of the 00229 workpiece. If the workpiece is fastened to a turntable, the turntable 00230 will turn clockwise (from the point of view of the machinist or anyone 00231 else not moving with respect to the machining center) in order to make 00232 the tool move counterclockwise from the point of view of the 00233 workpiece. 00234 00235 */ 00236 00237 /* Machining Attributes */ 00238 00239 extern void SET_FEED_RATE(double rate); 00240 00241 /* 00242 00243 SET_FEED_RATE sets the feed rate that will be used when the spindle is 00244 told to move at the currently set feed rate. The rate is either: 00245 1. the rate of motion of the tool tip in the workpiece coordinate system, 00246 which is used when the feed_reference mode is "CANON_WORKPIECE", or 00247 2. the rate of motion of the tool tip in the XYZ axis system, ignoring 00248 motion of other axes, which is used when the feed_reference mode is 00249 "CANON_XYZ". 00250 00251 The units of the rate are: 00252 00253 1. If the feed_reference mode is CANON_WORKPIECE: 00254 length units (inches or millimeters according to the setting of 00255 CANON_UNITS) per minute along the programmed path as seen by the 00256 workpiece. 00257 00258 2. If the feed_reference mode is CANON_XYZ: 00259 A. For motion including one rotational axis only: degrees per minute. 00260 B. For motion including two rotational axes only: degrees per minute 00261 In this case, the rate applies to the axis with the larger angle 00262 to cover, and the second rotational axis rotates so that it has 00263 always completed the same proportion of its required motion as has 00264 the rotational axis to which the feed rate applies. 00265 C. For motion involving one or more of the XYZ axes (with or without 00266 simultaneous rotational axis motion): length units (inches or 00267 millimeters according to the setting of CANON_UNITS) per minute 00268 along the programmed XYZ path. 00269 00270 */ 00271 00272 extern void SET_FEED_REFERENCE(CANON_FEED_REFERENCE reference); 00273 00274 /* 00275 00276 This sets the feed_reference mode to either CANON_WORKPIECE or 00277 CANON_XYZ. 00278 00279 The CANON_WORKPIECE mode is more natural and general, since the rate 00280 at which the tool passes through the material must be controlled for 00281 safe and effective machining. For machines with more than the three 00282 standard XYZ axes, however, computing the feed rate may be 00283 time-consuming because the trajectories that result from motion in 00284 four or more axes may be complex. Computation of path lengths when 00285 only XYZ motion is considered is quite simple for the two standard 00286 motion types (straight lines and helical arcs). 00287 00288 Some programming languages (rs274kt, in particular) use CANON_XYZ 00289 mode. In these languages, the task of dealing with the rate at which 00290 the tool tip passes through material is pushed back on the NC-program 00291 generator, where the computation of path lengths is (almost always in 00292 1995) an off-line activity where speed of calculation is not critical. 00293 00294 In CANON_WORKPIECE mode, some motions cannot be carried out as fast as 00295 the programmed feed rate would require because axis motions tend to 00296 cancel each other. For example, an arc in the YZ-plane can exactly 00297 cancel a rotation around the A-axis, so that the location of the tool 00298 tip with respect to the workpiece does not change at all during the 00299 motion; in this case, the motion should take no time, which is 00300 impossible at any finite rate of axis motion. In such cases, the axes 00301 should be moved as fast as possible consistent with accurate 00302 machining. 00303 00304 It would be possible to omit the SET_FEED_REFERENCE command from the 00305 canonical commands and operate always in one mode or the other, 00306 letting the interpreter issue SET_FEED_RATE commands, if necessary to 00307 compensate if the NC language being interpreted used the other mode. 00308 00309 This would create two disadvantages when the feed_reference mode 00310 assumed by the canonical commands differed from that assumed by the NC 00311 language being interpreted: 00312 00313 1. The output code could have a lot of SET_FEED_RATE commands not 00314 found in the input code; this is a relatively minor consideration. 00315 00316 2. If the interpreter reads a program in language which uses the 00317 CANON_XYZ mode and writes canonical commands in the CANON_WORKPIECE 00318 mode, both the interpreter and the executor of the output canonical 00319 commands would have to perform a lot of complex calculations. With the 00320 SET_FEED_REFERENCE command available, both do only simple calculations 00321 for the same motions. 00322 00323 */ 00324 00325 extern void SET_MOTION_CONTROL_MODE(CANON_MOTION_MODE mode); 00326 00327 /* 00328 00329 This sets the motion control mode to one of: CANON_EXACT_STOP, 00330 CANON_EXACT_PATH, or CANON_CONTINUOUS. 00331 00332 */ 00333 00334 extern void SET_CUTTER_RADIUS_COMPENSATION(double radius); 00335 00336 /* Set the radius to use when performing cutter radius compensation. */ 00337 00338 extern void START_CUTTER_RADIUS_COMPENSATION(int direction); 00339 00340 /* Conceptually, the direction must be left (meaning the cutter 00341 stays to the left of the programmed path) or right. */ 00342 00343 extern void STOP_CUTTER_RADIUS_COMPENSATION(); 00344 00345 /* Do not apply cutter radius compensation when executing spindle 00346 translation commands. */ 00347 00348 extern void START_SPEED_FEED_SYNCH(); 00349 extern void STOP_SPEED_FEED_SYNCH(); 00350 00351 /* Machining Functions */ 00352 00353 extern void ARC_FEED( 00354 double first_end, 00355 double second_end, 00356 double first_axis, 00357 double second_axis, 00358 int rotation, 00359 double axis_end_point 00360 #ifdef AA 00361 , double a_position 00362 #else 00363 #ifdef ALL_AXES 00364 , double a_position 00365 #endif 00366 #endif 00367 #ifdef BB 00368 , double b_position 00369 #else 00370 #ifdef ALL_AXES 00371 , double b_position 00372 #endif 00373 #endif 00374 #ifdef CC 00375 , double c_position 00376 #else 00377 #ifdef ALL_AXES 00378 , double c_position 00379 #endif 00380 #endif 00381 ); 00382 00383 /* Move in a helical arc from the current location at the existing feed 00384 rate. The axis of the helix is parallel to the x, y, or z axis, 00385 according to which one is perpendicular to the selected plane. The 00386 helical arc may degenerate to a circular arc if there is no motion 00387 parallel to the axis of the helix. 00388 00389 1. If the selected plane is the xy-plane: 00390 A. first_end is the x-coordinate of the end of the arc. 00391 B. second_end is the y-coordinate of the end of the arc. 00392 C. first_axis is the x-coordinate of the axis (center) of the arc. 00393 D. second_axis is the y-coordinate of the axis. 00394 E. axis_end_point is the z-coordinate of the end of the arc. 00395 00396 2. If the selected plane is the yz-plane: 00397 A. first_end is the y-coordinate of the end of the arc. 00398 B. second_end is the z-coordinate of the end of the arc. 00399 C. first_axis is the y-coordinate of the axis (center) of the arc. 00400 D. second_axis is the z-coordinate of the axis. 00401 E. axis_end_point is the x-coordinate of the end of the arc. 00402 00403 3. If the selected plane is the zx-plane: 00404 A. first_end is the z-coordinate of the end of the arc. 00405 B. second_end is the x-coordinate of the end of the arc. 00406 C. first_axis is the z-coordinate of the axis (center) of the arc. 00407 D. second_axis is the x-coordinate of the axis. 00408 E. axis_end_point is the y-coordinate of the end of the arc. 00409 00410 If rotation is positive, the arc is traversed counterclockwise as 00411 viewed from the positive end of the coordinate axis perpendicular to 00412 the currently selected plane. If rotation is negative, the arc is 00413 traversed clockwise. If rotation is 0, first_end and second_end must 00414 be the same as the corresponding coordinates of the current point and 00415 no arc is made (but there may be translation parallel to the axis 00416 perpendicular to the selected plane and motion along the rotational axes). 00417 If rotation is 1, more than 0 but not more than 360 degrees of arc 00418 should be made. In general, if rotation is n, the amount of rotation 00419 in the arc should be more than ([n-1] x 360) but not more than (n x 00420 360). 00421 00422 The radius of the helix is determined by the distance from the current 00423 location to the axis of helix or by the distance from the end location 00424 to the axis of the helix. It is recommended that the executing system 00425 verify that the two radii are the same (within some tolerance) at the 00426 beginning of executing this function. 00427 00428 While the XYZ motion is going on, move the rotational axes so that 00429 they have always covered the same proportion of their total motion as 00430 a point moving along the arc has of its total motion. 00431 00432 */ 00433 00434 extern void STRAIGHT_FEED( 00435 double x, double y, double z 00436 #ifdef AA 00437 , double a_position 00438 #else 00439 #ifdef ALL_AXES 00440 , double a_position 00441 #endif 00442 #endif 00443 #ifdef BB 00444 , double b_position 00445 #else 00446 #ifdef ALL_AXES 00447 , double b_position 00448 #endif 00449 #endif 00450 #ifdef CC 00451 , double c_position 00452 #else 00453 #ifdef ALL_AXES 00454 , double c_position 00455 #endif 00456 #endif 00457 ); 00458 00459 /* Move at existing feed rate so that at any time during the move, 00460 all axes have covered the same proportion of their required motion. 00461 The meanings of the parameters is the same as for STRAIGHT_TRAVERSE.*/ 00462 00463 extern void STRAIGHT_PROBE ( 00464 double x, double y, double z 00465 #ifdef AA 00466 , double a_position 00467 #else 00468 #ifdef ALL_AXES 00469 , double a_position 00470 #endif 00471 #endif 00472 #ifdef BB 00473 , double b_position 00474 #else 00475 #ifdef ALL_AXES 00476 , double b_position 00477 #endif 00478 #endif 00479 #ifdef CC 00480 , double c_position 00481 #else 00482 #ifdef ALL_AXES 00483 , double c_position 00484 #endif 00485 #endif 00486 ); 00487 00488 /* Perform a probing operation. This is a temporary addition to the 00489 canonical machining functions and its semantics are not defined. 00490 When the operation is finished, all axes should be back where they 00491 started. */ 00492 00493 extern void STOP(); 00494 00495 /* stop motion after current feed */ 00496 00497 extern void DWELL(double seconds); 00498 00499 /* freeze x,y,z for a time */ 00500 00501 /* Spindle Functions */ 00502 00503 extern void SPINDLE_RETRACT_TRAVERSE(); 00504 00505 /* Retract the spindle at traverse rate to the fully retracted position. */ 00506 00507 extern void START_SPINDLE_CLOCKWISE(); 00508 00509 /* Turn the spindle clockwise at the currently set speed rate. If the 00510 spindle is already turning that way, this command has no effect. */ 00511 00512 extern void START_SPINDLE_COUNTERCLOCKWISE(); 00513 00514 /* Turn the spindle counterclockwise at the currently set speed rate. If 00515 the spindle is already turning that way, this command has no effect. */ 00516 00517 extern void SET_SPINDLE_SPEED(double r); 00518 00519 /* Set the spindle speed that will be used when the spindle is turning. 00520 This is usually given in rpm and refers to the rate of spindle 00521 rotation. If the spindle is already turning and is at a different 00522 speed, change to the speed given with this command. */ 00523 00524 extern void STOP_SPINDLE_TURNING(); 00525 00526 /* Stop the spindle from turning. If the spindle is already stopped, this 00527 command may be given, but it will have no effect. */ 00528 00529 extern void SPINDLE_RETRACT(); 00530 extern void ORIENT_SPINDLE(double orientation, CANON_DIRECTION direction); 00531 extern void LOCK_SPINDLE_Z(); 00532 extern void USE_SPINDLE_FORCE(); 00533 extern void USE_NO_SPINDLE_FORCE(); 00534 00535 /* Tool Functions */ 00536 extern void USE_TOOL_LENGTH_OFFSET(double length); 00537 00538 extern void CHANGE_TOOL(int slot); /* slot is slot number */ 00539 00540 /* It is assumed that each cutting tool in the machine is assigned to a 00541 slot (intended to correspond to a slot number in a tool carousel). 00542 This command results in the tool currently in the spindle (if any) 00543 being returned to its slot, and the tool from the slot designated by 00544 slot_number (if any) being inserted in the spindle. 00545 00546 If there is no tool in the slot designated by the slot argument, there 00547 will be no tool in the spindle after this command is executed and no 00548 error condition will result in the controller. Similarly, if there is 00549 no tool in the spindle when this command is given, no tool will be 00550 returned to the carousel and no error condition will result in the 00551 controller, whether or not a tool was previously selected in the 00552 program. 00553 00554 It is expected that when the machine tool controller is initialized, 00555 the designated slot for a tool already in the spindle will be 00556 established. This may be done in any manner deemed fit, including 00557 (for, example) recording that information in a persistent, crash-proof 00558 location so it is always available from the last time the machine was 00559 run, or having the operator enter it. It is expected that the machine 00560 tool controller will remember that information as long as it is 00561 not re-initialized; in particular, it will be remembered between 00562 programs. 00563 00564 For the purposes of this command, the tool includes the tool holder. 00565 00566 For machines which can carry out a select_tool command separately from 00567 a change_tool command, the select_tool command must have been given 00568 before the change_tool command, and the value of slot must be the slot 00569 number of the selected tool. */ 00570 00571 extern void SELECT_TOOL(int i); /* i is slot number */ 00572 00573 /* Miscellaneous Functions */ 00574 00575 extern void CLAMP_AXIS(CANON_AXIS axis); 00576 00577 /* Clamp the given axis. If the machining center does not have a clamp 00578 for that axis, this command should result in an error condition in the 00579 controller. 00580 00581 An attempt to move an axis while it is clamped should result in an 00582 error condition in the controller. */ 00583 00584 extern void COMMENT(char *s); 00585 00586 /* This function has no physical effect. If commands are being printed or 00587 logged, the comment command is printed or logged, including the string 00588 which is the value of comment_text. This serves to allow formal 00589 comments at specific locations in programs or command files. */ 00590 00591 extern void DISABLE_FEED_OVERRIDE(); 00592 extern void ENABLE_FEED_OVERRIDE(); 00593 extern void DISABLE_SPEED_OVERRIDE(); 00594 extern void ENABLE_SPEED_OVERRIDE(); 00595 extern void FLOOD_OFF(); 00596 /* Turn flood coolant off. */ 00597 extern void FLOOD_ON(); 00598 /* Turn flood coolant on. */ 00599 00600 extern void MESSAGE(char *s); 00601 00602 extern void MIST_OFF(); 00603 /* Turn mist coolant off. */ 00604 00605 extern void MIST_ON(); 00606 /* Turn mist coolant on. */ 00607 00608 extern void PALLET_SHUTTLE(); 00609 00610 /* If the machining center has a pallet shuttle mechanism (a mechanism 00611 which switches the position of two pallets), this command should cause 00612 that switch to be made. If either or both of the pallets are missing, 00613 this will not result in an error condition in the controller. 00614 00615 If the machining center does not have a pallet shuttle, this command 00616 should result in an error condition in the controller. */ 00617 00618 extern void TURN_PROBE_OFF(); 00619 extern void TURN_PROBE_ON(); 00620 00621 extern void UNCLAMP_AXIS(CANON_AXIS axis); 00622 00623 /* Unclamp the given axis. If the machining center does not have a clamp 00624 for that axis, this command should result in an error condition in the 00625 controller. */ 00626 00627 /* NURB Functions */ 00628 extern void NURB_KNOT_VECTOR(); /* double knot values, -1.0 signals done */ 00629 extern void NURB_CONTROL_POINT(int i, double x, double y, double z, double w ); 00630 extern void NURB_FEED(double sStart, double sEnd); 00631 00632 /* Program Functions */ 00633 extern void OPTIONAL_PROGRAM_STOP(); 00634 00635 /* If the machining center has an optional stop switch, and it is on 00636 when this command is read from a program, stop executing the program 00637 at this point, but be prepared to resume with the next line of the 00638 program. If the machining center does not have an optional stop 00639 switch, or commands are being executed with a stop after each one 00640 already (such as when the interpreter is being used with keyboard 00641 input), this command has no effect. */ 00642 00643 extern void PROGRAM_END(); 00644 /* If a program is being read, stop executing the program and be prepared 00645 to accept a new program or to be shut down. */ 00646 00647 extern void PROGRAM_STOP(); 00648 /* If this command is read from a program, stop executing the program at 00649 this point, but be prepared to resume with the next line of the 00650 program. If commands are being executed with a stop after each one 00651 already (such as when the interpreter is being used with keyboard 00652 input), this command has no effect. */ 00653 00654 00655 /*************************************************************************/ 00656 00657 /* Canonical "Give me information" functions for the interpreter to call 00658 00659 In general, returned values are valid only if any canonical do it commands 00660 that may have been called for have been executed to completion. If a function 00661 returns a valid value regardless of execution, that is noted in the comments 00662 below. 00663 00664 */ 00665 00666 /* The interpreter is not using this function 00667 // Returns the system angular unit factor, in units / degree 00668 extern double GET_EXTERNAL_ANGLE_UNIT_FACTOR(); 00669 */ 00670 00671 // Returns the system feed rate 00672 extern double GET_EXTERNAL_FEED_RATE(); 00673 00674 // Returns the system value for flood coolant, zero = off, non-zero = on 00675 extern int GET_EXTERNAL_FLOOD(); 00676 00677 /* The interpreter is not using this function 00678 // Returns the system length unit factor, in units / mm 00679 extern double GET_EXTERNAL_LENGTH_UNIT_FACTOR(); 00680 */ 00681 00682 00683 // Returns the system length unit type 00684 CANON_UNITS GET_EXTERNAL_LENGTH_UNIT_TYPE(); 00685 00686 // Returns the system value for mist coolant, zero = off, non-zero = on 00687 extern int GET_EXTERNAL_MIST(); 00688 00689 // Returns the current motion control mode 00690 extern CANON_MOTION_MODE GET_EXTERNAL_MOTION_CONTROL_MODE(); 00691 00692 /* The interpreter is not using these six GET_EXTERNAL_ORIGIN functions 00693 00694 #ifdef AA 00695 // returns the current a-axis origin offset 00696 extern double GET_EXTERNAL_ORIGIN_A(); 00697 #endif 00698 00699 #ifdef BB 00700 // returns the current b-axis origin offset 00701 extern double GET_EXTERNAL_ORIGIN_B(); 00702 #endif 00703 00704 #ifdef CC 00705 // returns the current c-axis origin offset 00706 extern double GET_EXTERNAL_ORIGIN_C(); 00707 #endif 00708 00709 // returns the current x-axis origin offset 00710 extern double GET_EXTERNAL_ORIGIN_X(); 00711 00712 // returns the current y-axis origin offset 00713 extern double GET_EXTERNAL_ORIGIN_Y(); 00714 00715 // returns the current z-axis origin offset 00716 extern double GET_EXTERNAL_ORIGIN_Z(); 00717 00718 */ 00719 00720 // returns nothing but copies the name of the parameter file into 00721 // the filename array, stopping at max_size if the name is longer 00722 // An empty string may be placed in filename. 00723 extern void GET_EXTERNAL_PARAMETER_FILE_NAME(char * filename, int max_size); 00724 00725 // returns the currently active plane 00726 extern CANON_PLANE GET_EXTERNAL_PLANE(); 00727 00728 #ifdef AA 00729 // returns the current a-axis position 00730 extern double GET_EXTERNAL_POSITION_A(); 00731 #endif 00732 00733 #ifdef BB 00734 // returns the current b-axis position 00735 extern double GET_EXTERNAL_POSITION_B(); 00736 #endif 00737 00738 #ifdef CC 00739 // returns the current c-axis position 00740 extern double GET_EXTERNAL_POSITION_C(); 00741 #endif 00742 00743 // returns the current x-axis position 00744 extern double GET_EXTERNAL_POSITION_X(); 00745 00746 // returns the current y-axis position 00747 extern double GET_EXTERNAL_POSITION_Y(); 00748 00749 // returns the current z-axis position 00750 extern double GET_EXTERNAL_POSITION_Z(); 00751 00752 #ifdef AA 00753 // Returns the machine A-axis position at the last probe trip. 00754 extern double GET_EXTERNAL_PROBE_POSITION_A(); 00755 #endif 00756 00757 #ifdef BB 00758 // Returns the machine B-axis position at the last probe trip. 00759 extern double GET_EXTERNAL_PROBE_POSITION_B(); 00760 #endif 00761 00762 #ifdef CC 00763 // Returns the machine C-axis position at the last probe trip. 00764 extern double GET_EXTERNAL_PROBE_POSITION_C(); 00765 #endif 00766 00767 // Returns the machine X-axis position at the last probe trip. 00768 extern double GET_EXTERNAL_PROBE_POSITION_X(); 00769 00770 // Returns the machine Y-axis position at the last probe trip. 00771 extern double GET_EXTERNAL_PROBE_POSITION_Y(); 00772 00773 // Returns the machine Z-axis position at the last probe trip. 00774 extern double GET_EXTERNAL_PROBE_POSITION_Z(); 00775 00776 // Returns the value for any analog non-contact probing. 00777 extern double GET_EXTERNAL_PROBE_VALUE(); 00778 00779 // Returns zero if queue is not empty, non-zero if the queue is empty 00780 // This always returns a valid value 00781 extern int GET_EXTERNAL_QUEUE_EMPTY(); 00782 00783 // Returns the system value for spindle speed in rpm 00784 extern double GET_EXTERNAL_SPEED(); 00785 00786 // Returns the system value for direction of spindle turning 00787 extern CANON_DIRECTION GET_EXTERNAL_SPINDLE(); 00788 00789 // returns current tool length offset 00790 extern double GET_EXTERNAL_TOOL_LENGTH_OFFSET(); 00791 00792 // Returns number of slots in carousel 00793 extern int GET_EXTERNAL_TOOL_MAX(); 00794 00795 // Returns the system value for the carousel slot in which the tool 00796 // currently in the spindle belongs. Return value zero means there is no 00797 // tool in the spindle. 00798 extern int GET_EXTERNAL_TOOL_SLOT(); 00799 00800 // Returns the CANON_TOOL_TABLE structure associated with the tool 00801 // in the given pocket 00802 extern CANON_TOOL_TABLE GET_EXTERNAL_TOOL_TABLE(int pocket); 00803 00804 // Returns the system traverse rate 00805 extern double GET_EXTERNAL_TRAVERSE_RATE(); 00806 00807 extern FILE * _outfile; /* where to print, set in main */ 00808 extern CANON_TOOL_TABLE _tools[]; /* in canon.cc */ 00809 extern int _tool_max; /* in canon.cc */ 00810 extern char _parameter_file_name[]; /* in canon.cc */ 00811 #define PARAMETER_FILE_NAME_LENGTH 100 00812 00813 #endif /* ifndef CANON_HH */