OptiPath API
Introduction
OptiPath API is designed to enable an interface between VERICUT and customized plug-
in toolpath optimization programs. OptiPath API is only available on Windows platform.
When a system environment variable "CGTECH_OPAPI" is defined with a user's
optimization library name, VERICUT will automatically run OptiPath in API mode and
connect to user's program. VERICUT's own OptiPath function will no longer be
available.
NOTE: The files (opapi.lib, opapi_template.c, optiapi.h and optimport.h) referred to
below, are all located the \windows\optipath_api\ folder of your VERICUT software
installation.
In addition, there are 25 optional utility functions that provide the user program with
detailed process data. All the functions are described in the Function Definition section at
the end of this document. Examples can be found in "opapi_template.c".
1
VERICUT Development Tools
double opapi_get_axial_depth(void);
double opapi_get_program_feedrate(void);
double opapi_get_spindle_speed(void);
double opapi_get_total_distance(void);
double opapi_get_total_time(void);
double opapi_get_total_volume_removed(void);
double opapi_get_volume_removed(void);
int opapi_get_conventional_cut_flag(void);
int opapi_get_side_cut_flag(void);
int opapi_get_thin_cut_flag(void);
Include "opapi.h" and "optimport.h" in "opapi_usr.c". Compile and link all the usr files
with "opapi.lib". This will generate a ".dll" library.
2
VERICUT Development Tools
Set system environment variable "CGTECH_OPAPI" set to where this dll is , for
example, "c:\opapi\opapi_usr.dll" and place "opapi.dll" in the same directory where
"CGTech.dll" is. OptiPath API mode is now ready to go.
3
VERICUT Development Tools
Function Definitions
Setup Functions
void opapi_setup(void)
Setup function. Must be present with exactly the same declaration style and name. Called
when OptiPath API library is first loaded. It is to register user's optimization function.
The following functions can be and should only be called in this setup function:
opapi_set_initialize_function(OPAPI_InitializeFunction);
opapi_set_optimize_function(OPAPI_OptimizeFunction);
opapi_set_terminate_function(OPAPI_TerminateFunction);
opapi_set_tool_change_setup_function(OPAI_ToolSetupFunction);
opapi_set_user_data(void *);
4
VERICUT Development Tools
void opapi_set_tool_change_setup_function(OPAPI_ToolSetupFunction
func_p)
Register user's tool change setup function with VERICUT. The tool change function
registered, func_p, should have the following declaration style:
typedef int (*OPAPI_ToolSetupFunction)(void *userData);
which returns 1 if tool setup is successful or 0 if tool setup failed. If failed, no
optimization will occur for the current tool. Therefore, if a tool does not need to be
optimized, just return 0 when func_p is called for this tool. This function should only be
called in opapi_setup() function. Once registered, the tool setup function, func_p, will be
called each time a tool change occurs.
5
VERICUT Development Tools
Utility Functions
Parameters:
variable_name : Input, name of the variable.
Return the address of variable value depending the variable type.
If variable is a number, return the address of the double value (double *).
If variable is a text, return the address of the string (char *)
double opapi_get_axial_depth(void)
Return maximum axial depth.
double opapi_get_program_feedrate(void)
Return programmed feedrate.
double opapi_get_radial_width(void)
Return maximum radial width.
double opapi_get_spindle_speed(void)
Return spindle speed in rpm.
double opapi_get_total_distance(void)
Return total distance.
double opapi_get_total_time(void)
Return total time.
6
VERICUT Development Tools
double opapi_get_total_volume_removed(void)
Return total volume of material being removed.
double opapi_get_volume_removed(void)
Return the volume of material being removed by the current motion.
int opapi_get_conventional_cut_flag(void)
Return conventional cut flag.
int opapi_get_side_cut_flag(void)
Return side cut flag.
int opapi_get_thin_cut_flag(void)
Return thin cut flag.
{
double cutterDiameter;/* Cutter diameter, D */
double cutterHeight;/* Cutter height, H */
double cornerRadius; /* Corner radius, R */
double eDistance;/* Distance from tool centerline to corner radius center, E */
double fDistance;/* Distance from tool tip to corner radius center, F */
double baseAngle;/* Base angle, A */
double sideAngle;/* Side angle, B */
} sOPAPI_CUTTER;
7
VERICUT Development Tools
{
double toolEnd[2]; /* Tool tip at starting position projected to the projection grids, in
gridAxisX, gridAxisY */
double gridOrigin[3]; /* Origin of projection grids in X, Y, Z */
double gridAxisX[3];/* Projection grids' X axis in I, J, K. X axis in normal to the Z axis
and tool axis in starting position */
double gridAxisY[3]; /* Projection grids' Y axis in I, J, K */
double gridAxisZ[3]; /* Projection grids' Z axis in I, J, K. Z axis is the unit vector of
cutter translation position vector */
double gridSize; /* Length of each grid */
int numGridsX;/* Number of grids along gridAxisX */
int numGridsY;/* Number of grids along gridAxisY */
int maskSize; /* Number of int/32 bits that are used to store the mask */
int *gridMask; /* Pointer to grid mask */
} sOPAPI_MAP;
{
OPAPI_LINEAR = 0,
OPAPI_CIRCLE = 1,
OPAPI_NURBS = 2,
OPAPI_RAPID= 3,
}eOPAPI_MOTION_TYPE;
8
VERICUT Development Tools
Parameters:
data : Input, memory pointer.
Parameters:
contact : Output, 1 if tool is in contact with material, 0 if not.
area : Output, area of material that is in contact with the tool.
Parameters:
tool_id : Output, tool id of current tool as defined in tool library. Will be null if an apt
tool is defined by cutter statement.
is_apt : Output, 1 if an apt cutter, 0 if not.
apt_cutter : Output, cutter definition stored in sOPAPI_CUTTER if current tool is an apt
cutter.
Parameters:
start : Output, machine starting position in (X, Y, Z, U, V, W, A, B, C, A2, B2, C2)
end : Output, machine ending position in (X, Y, Z, U, V, W, A, B, C, A2, B2, C2)
9
VERICUT Development Tools
Parameters:
start : Output, tool starting position, defined by tool tip position [0-2] in (X, Y, Z) and
tool axis vector [3-5] in (I, J, K).
end : Output, tool ending position, defined by tool tip position [0-2] in (X, Y, Z) and tool
axis vector [3-5] in (I, J, K).
Parameters:
map : Input, a map structure that contains grid mask data.
size : Output, size of the unsigned array.
values : Output, pointer to the bit array. Must be freed by using opapi_free(char *).
Parameters:
map: Output, returned map->gridMask field must be freed by using opapi_free(char *).
VERICUT provides kinematics of cutter immersion data in the form of a grid map, a
mapping of what parts of the workpiece are in contact with the cuter and stores it in the
sOPAPI_MAP structure. The grid map is a projection plane (gridAxisX & gridAxisY)
that is normal to cutter transition vector (gridAxisZ). Each grid has a bit value of 1 or 0,
with 1 meaning the projected part on the workpiece is in contact with the cutter and 0
meaning no contact. All the grid bits are stored row by row, starting from bottom to top,
left to right, into (a) 32-bits integer(s).
10
VERICUT Development Tools
Parameters:
type : Output, motion type defined in eOPAPI_MOTION_TYPE
circle : Output, circle defined by circle center [0-2] in (X, Y, Z) and circle normal [3-5]
in (I, J, K) for circular motion.
Parameters:
rec_num : Output, current record number(line number) in toolpath file.
record : Output, current toolpath record being processed.
Parameters:
message : Input, message to be sent
display : Input, 0 written to log file; 1 displayed in logger; 2 display in logger and written
to log file.
Parameters:
rpm : Input, spindle speed in rpm.
11
VERICUT Development Tools
based on this distance. Distance is measured along the tool motion. This function should
only be called in the OPAPI_InitializeFunction.
If the user program does not set up a resolution by calling this function in initialization, a
default resolution distance based on the size of the cutting tool relative to the displayed
model is calculated by VERICUT. This choice is recommended when little or no
knowledge of cutting methods or feed rates is available.
Parameters:
distance : Input, optimization distance.
12
VERICUT Development Tools
This document describes the VERICUT 6.1 requirements for the Heidenhain iTNC API.
The API functions in this document are the minimum frame work needed for VERICUT
and the Heidenhain iTNC Controller to perform a successful simulation. The API
functions may and will be modified to take advantage of new and existing capabilities of
the Heidenhain iTNC Controller and new API functions will be implemented as needed.
The API functions must be implemented and exportable via the TNC DLL.
The API functions will isolate VERICUT from Heidenhain iTNC specific nuances as
much as possible. For example, TNC circle data is given as a set of intermediate points
on the circle. The TNC DLL must buffer up the intermediate points and then create the
circle data based on the buffered intermediate points. VERICUT does not want the
intermediate points. VERICUT wants just the resultant circle motion.
A new NC program type has been added to VERICUT 6.1. The new type is located in the
NC Program window:
Project menu > NC Programs
NC Program Type = Heidenhain iTNC
Set the following environment variable so that VERICUT will find the new TNC DLL:
The log file debug feature can be turned On/Off using the Debug Control API option on
the Process Options window: Debug tab (Project > Processing Options > G-Code >
Process Options).
The rest of this document defines the TNC API function prototypes which must be
implemented and exportable via the TNC DLL.
13
VERICUT Development Tools
/*********************************************************
This function shall initialize the COM interface, establish connection to the TNC and
initialize session variables.
Returns:
0, Error
1, OK
**********************************************************/
int ctlapi_hard_initialize_TNC(void);
/*********************************************************
This function shall perform a TNC disconnect, un-initialize the COM interface and reset
session variables.
Returns:
0, Error
1, OK
**********************************************************/
int ctlapi_hard_terminate_TNC(void);
/*********************************************************
This function shall set the main program file, set tool position, set feed rate and set
execution mode. This function will be called for initial setting of main program file, for
main program file change and at simulation reset.
14
VERICUT Development Tools
Returns:
0, Error
1, OK
**********************************************************/
/*********************************************************
This function shall start the execution of the selected main program file.
Returns:
0, Error
1, OK
**********************************************************/
int ctlapi_start_program_TNC(void);
/*********************************************************
Returns:
0, Error
1, OK
**********************************************************/
15
VERICUT Development Tools
int ctlapi_stop_program_TNC(void);
/*********************************************************
This function shall get the list of motions created from one record.
Returns:
number of motions (int)
**********************************************************/
/*********************************************************
This function shall open the tool file for write. The tool file should be located in the same
directory as the Main Program File (MPF). Extract the path from the specified MPF and
construct the tool file (path and name.)
Returns:
0, Error
1, OK
**********************************************************/
16
VERICUT Development Tools
/*********************************************************
This function shall close the tool file and send a request to the controller to load the tool
file.
Returns:
0, Error
1, OK
**********************************************************/
int ctlapi_frame_terminate_TNC(void);
/*********************************************************
This function shall write tool info to the tool file for a single tool.
Returns:
0, Error
1, OK
**********************************************************/
/*********************************************************
17
VERICUT Development Tools
Returns:
time (double)
**********************************************************/
double ctlapi_get_time_TNC(void);
/*********************************************************
Returns:
0, not at end of program
1, at end of program
**********************************************************/
int ctlapi_get_prog_at_end_TNC(void);
/*********************************************************
The event notify function shall notify VERICUT of one of the following events:
0 = program block
1 = tool change
2 = enter subroutine
18
VERICUT Development Tools
3 = leave subroutine
4 = current program line
5 = S word
6 = F word
7 = M word
8 = current message
Returns:
none
**********************************************************/
/*********************************************************
The client message function allows the controller to pass text messages to VERICUT.
Returns:
none
19
VERICUT Development Tools
**********************************************************/
20
VERICUT Development Tools
CME-API
Introduction
CME-API is the replacement for VERICUT Machine Developers Kit (DevKit). DevKit
consisted of a licensed compiler and documentation on how to create and compile
CGTech Macro Language (CML) programs. CML programs enabled the user to extend
VERICUT's control emulation with custom NC macros that emulate unique behavior of
the customer's machine. The CML program has access to specific "exported" functions
within VERICUT. The compiler produced a CGTech Macro Executable (CME) file
containing a compiled form of the CML program. The CME was then used by
VERICUT's control file to add customer-created NC macros to the control emulation.
The DevKit functionality is replaced by a new method for creating custom NC macros:
the C Macro Extension – Application Programming Interface, or CME–API.
Using CME-API, you can write a standard C, or C++, program which calls "exported"
functions in VERICUT (the exact same "exported" functions that were available to a
DevKit CML program). He then compiles this program using Microsoft's Visual Studio
6.0 C++ compiler, into a standard Windows Dynamic Link Library (DLL). The DLL is
loaded by VERICUT at runtime, extending VERICUT's control emulation with custom
NC macros (exactly the same as a DevKit-created CME).
CME-API replacement has several advantages over DevKit:
• CME-API uses an industry-standard language: C or C++
• CME-API gives the developer access to all the full, rich features of C and C++
• CME-API enables the developer to use standard C, and C++, debugging tools
• CME-API runs much faster than a CME file
CME-API Documentation
This document is intended to describe using "exported" VERICUT functions in a C
program, compiling a CME-API DLL in Microsoft Visual Studio, and how to use the
DLL in a VERICUT simulation. It will also contain a document on how to convert a
CML program to C.
21
VERICUT Development Tools
This documentation is written for use by a software developer with a working knowledge
of the C programming language and Microsoft Visual Studio. It is not intended to
document the C programming language, nor how to use Microsoft's development
environment. There are many fine books available on both these topics in libraries and
book stores. There are also many college and university courses on the C and C++
programming languages.
CME-API Deliverable
The CME-API deliverable consists of an example C source file ( example1.c ), a library (
( CGTech.lib ) , and header files ( cmeapi_defines.h, cmeapi_import.h, and
cmeapi_types.h ) that provide access to available "exported" functions These files can all
be found in the \windows\cmeapi\ directory of your VERICUT installation.
22
VERICUT Development Tools
/* ************************************************************************** */
#define DllExport _declspec(dllexport)
/* ************************************************************************** */
DllExport void cmeapi_init(void)
{
printf("cmeapi_init() Success!\n");
cmeapi_register_macro("UserCheckSpindle", cms_UserCheckSpindle);
}
23
VERICUT Development Tools
This section describes how to build a DLL in Visual Studio Express C++.
The following are the steps to required to configure Visual Studio Express C++ to work
with the VERICUT CME-API, and to build the example included with VERICUT.
24
VERICUT Development Tools
6. Launch VERICUT
• Top Menu > Configuration > Adv. Options > Dev Kit CME [tab] > Browse to
where the vericut_cme.dll was outputted (e.g. c:\vericut_cme\vericut_cme\debug\
vericut_cme.dll) > Click OK.
7. To confirm the DLL is being loaded, modify your vericut.bat file before launching
VERICUT.
• Change "%CGTECH_JRE%\bin\javaw" to "%CGTECH_JRE%\bin\java"
(remove the "w") so that the dialog window stays open.
25
VERICUT Development Tools
Registering Functions
Suppose you defined a function char *modify_input_str(char *) in C. The CME-API does
not know about it until you notify the CME-API by "registering" it. The function does not
have to be named modify_input_str, it can be named anything that you want, but it does
have to have a "char *" as the input argument and a "char *" as the return argument.
If the function name is char *modify_input_str(char *) then add the following call in
cmeapi_init():
cmeapi_register_modify_input_str(modify_input_str);
The following functions are provided to enable you to "register" three types of functions:
26
VERICUT Development Tools
This function is called when the DLL is loaded. You must define this functions in your
DLL.
Use this function to define a macro in VERICUT. This function should be called in
cmeapi_init()
The following is an example of code to needed to define, initialize, and register Macros
in VERICUT.
#include "cmeapi_import.h"
/* ************************************************************************** */
void UserTest(char *, char *, value)
{
printf("My UserTest macro was called\n");
}
/* ************************************************************************** */
DllExport void cmeapi_init(void)
{
printf("My cmeapi_init() was called\n");
cmeapi_register_macro("UserTest", UserTest);
}
27
VERICUT Development Tools
The following functions were converted from the CGTech Macro Language:
void cmeapi_abort_processing();
Causes immediate, normal termination of machine code block processing.
See also:
void cmeapi_add_nurbs_knot(knot);
void cmeapi_add_nurbs_objdata(knot);
void cmeapi_convert_nurbs_2_apt(subsystem, xreg, yreg, zreg, sequence_no);
void cmeapi_free_nurbs();
void cmeapi_free_nurbs_objdata(knot);
void cmeapi_init_nurbs();
double cmeapi_nurbs_get_next_point(xval, yval, zval);
void cmeapi_set_nurbs_order(order);
28
VERICUT Development Tools
void cmeapi_add_nurbs_knot(knot);
double knot;
See also:
void cmeapi_add_nurbs_ctrl(xval, yval, zval, ivector, jvector, kvector, weight);
void cmeapi_add_nurbs_objdata(knot);
void cmeapi_convert_nurbs_2_apt(subsystem, xreg, yreg, zreg, sequence_no);
void cmeapi_free_nurbs();
void cmeapi_free_nurbs_objdata(knot);
void cmeapi_init_nurbs();
double cmeapi_nurbs_get_next_point(xval, yval, zval);
void cmeapi_set_nurbs_order(order);.
void cmeapi_add_nurbs_objdata(knot);
double knot;
This function saves the current input data and associates it with the specified knot point.
This is used by OptiPath.
See also:
void cmeapi_add_nurbs_ctrl(xval, yval, zval, ivector, jvector, kvector, weight);
void cmeapi_add_nurbs_knot(knot);
void cmeapi_convert_nurbs_2_apt(subsystem, xreg, yreg, zreg, sequence_no);
void cmeapi_free_nurbs();
void cmeapi_free_nurbs_objdata(knot);
void cmeapi_init_nurbs();
double cmeapi_nurbs_get_next_point(xval, yval, zval);
void cmeapi_set_nurbs_order(order);
void cmeapi_anystrmatch(textstr1,textstr2);
This routine is passed any 2 "text" objects and returns "1" if they match, and "0" if they
don't.
NOTE: The comparison that is made is case insensitive.
29
VERICUT Development Tools
double cmeapi_atan_depth(expression);
char *expression;
Returns the depth of the current expression after the ATAN. It is assumed that [ ] will be
used as left and right precedence operators. The expression "ATAN [[[a/b]" has a current
depth of 2. If ATAN is not present in the string, the depth will be set to 1.
Returns the position number of the specified word in a block of machine code. It begins
searching at start position in the block, trying to match the next word with an address
greater than or equal to the minval and less than or equal to the maxval. Minval and
maxval are optional range values. If maxval is not supplied, it matches only the word. It
returns 0, if there is no word/address matched in the block.
The value of "a" is 2, because G90 is first word "G". The value of "b" is 3, because start
is 3, searching begins at G01. The value of "c" is 3, because G01 matches the word "G"
and the address 01 is between 0 and 3. The value of "d" is 0, because there is no word
"G" with an address that is between 17 and 19. The value of "e" is 3, because G01
30
VERICUT Development Tools
matches the word "G" and the address 01 matches the minval 1. The value of "f" is 0,
because there is no word "G" with an address equal to 2.
See also:
double cmeapi_current_command_number();
Calculates the normal to the specified motion plane relative to the part.
This function calls a registered macro within the C source. The first argument specifies
the name of the macro to be called. The remaining arguments are the standard arguments
for a Word/Value macro.
Returns 1 if the specified component is on the tool side of the machine, and returns 0 if it
is not.
31
VERICUT Development Tools
CMEAPI_VECTOR cmeapi_convert_machine_vector(input);
CMEAPI_VECTOR input;
Returns a vector converted from the input vector using the matrix calculated using the
components from the part to the base.
See also:
void cmeapi_set_fixture_offsets(subsystem, comp_reg_name, value);
void cmeapi_set_tool_length_offset(z_offset);
This function converts the previously defined NURBS curve into APT format, and prints
the result to the "OUTPUT" location. The input arguments are the register names for the
x, y, and z components, and the current sequence number.
See also:
void cmeapi_add_nurbs_ctrl(xval, yval, zval, ivector, jvector, kvector, weight);
void cmeapi_add_nurbs_knot(knot);
void cmeapi_add_nurbs_objdata(knot);
void cmeapi_free_nurbs();
void cmeapi_free_nurbs_objdata(knot);
void cmeapi_init_nurbs();
double cmeapi_nurbs_get_next_point(xval, yval, zval);
void cmeapi_set_nurbs_order(order);
32
VERICUT Development Tools
double cmeapi_current_command_number();
Returns the position number of the current object. For example a block of
N010G01X.1Y3, the N010 word/address is in the first object, the G01 word/address is
the second object, and so on.
See also:
double cmeapi_check_word_in_block(start, word, minval, maxval);
void cmeapi_default_word(word);
Defines a default word to be used if a number is read without a corresponding word
(during tokenizing).
void cmeapi_disable_all_macros();
Disables all macros from being called while tokenizing a block.
Sets 2 attributes associated with the wire. It is used while processing wire EDM jobs.
Show_wire_flag specifies whether the wire should be shown with the machine simulation
(1 for yes, and 0 for no), and the wire_thickness specifies the diameter of the wire.
33
VERICUT Development Tools
See also:
char *cmeapi_get_inch_format(word);
double cmeapi_get_inch_type(word);
char *cmeapi_get_metric_format(word);
double cmeapi_get_metric_type(word);
double cmeapi_get_multiplier(word);
void cmeapi_set_if_cond(flag);
void cmeapi_set_metric_mode();
void cmeapi_free_nurbs();
Frees the data associated with a NURBS structure. This routine should be called after the
processing of each NURBS statement.
See also:
void cmeapi_add_nurbs_ctrl(xval, yval, zval, ivector, jvector, kvector, weight);
void cmeapi_add_nurbs_knot(knot);
void cmeapi_add_nurbs_objdata(knot);
void cmeapi_convert_nurbs_2_apt(subsystem, xreg, yreg, zreg, sequence_no);
void cmeapi_free_nurbs_objdata(knot);
void cmeapi_init_nurbs();
double cmeapi_nurbs_get_next_point(xval, yval, zval);
void cmeapi_set_nurbs_order(order);
void cmeapi_free_nurbs_objdata(knot);
double knot;
This function frees the data that was previously allocated by void
cmeapi_add_nurbs_objdata().
See also:
void cmeapi_add_nurbs_ctrl(xval, yval, zval, ivector, jvector, kvector, weight);
void cmeapi_add_nurbs_knot(knot);
void cmeapi_add_nurbs_objdata(knot);
void cmeapi_convert_nurbs_2_apt(subsystem, xreg, yreg, zreg, sequence_no);
void cmeapi_free_nurbs();
void cmeapi_init_nurbs();
double cmeapi_nurbs_get_next_point(xval, yval, zval);
void cmeapi_set_nurbs_order(order);
34
VERICUT Development Tools
CMEAPI_VECTOR cmeapi_get_adj_tool_axis();
Returns the adjusted tool axis in its current position.
double cmeapi_get_alpha_nc_var(variable_name);
char *variable_name;
See also:
void cmeapi_get_nc_vars(nc_vars, start, end);
void cmeapi_set_alpha_nc_var(variable_name, value);
void cmeapi_set_nc_vars(nc_vars, start, end);
double cmeapi_get_block_sequence();
Returns the current block sequence count (the total number of blocks that has been
processed.
35
VERICUT Development Tools
CMEAPI_POINT cmeapi_get_c_3d_vars(variable);
double variable;
Returns the value of a specific variable. This function is used with array variables. The
indexed value into the specified array will be returned. Supported variables include:
CMS_C_BLOCK_NC_VACANT_VARS:
CMS_C_VAR_ARGUMENTS:
CMS_C_SEQ_LOOP_CNT:
CMS_C_SEQ_START:
CMS_C_ARGUMENTS:
CMS_C_SEQ_END:
CMS_C_SEQ_SUB:
CMS_C_SEQ_CALL:
CMS_C_BLOCK_NC_VARS:
CMS_C_MODAL_NC_VARS:
CMS_C_MODAL_NC_VACANT_VARS:
CMS_C_ROTATE_3D_MAT:
36
VERICUT Development Tools
CMEAPI_AXIS cmeapi_get_c_axis_vars(variable);
double variable;
37
VERICUT Development Tools
double cmeapi_get_c_numeric_vars(variable);
double variable;
38
VERICUT Development Tools
L_CW/MOTION_HEL_CCW/MOTION_FROM/MOTION_THREAD/MOTION_NUR
BS/MOTION_POLY
CMS_C_PREV_NON_RAPID_MOTION:
MOTION_RAPID/MOTION_LINEAR/MOTION_CW/MOTION_CCW/MOTION_HE
L_CW/MOTION_HEL_CCW/MOTION_FROM/MOTION_THREAD/MOTION_NUR
BS/MOTION_POLY
CMS_C_UNITS: CTL_INCH/CTL_METRIC
CMS_C_CUTCOM_MODE:
CUTCOM_OFF/CUTCOM_RAMPON/CUTCOM_RAMPOFF/CUTCOM_ON
CMS_C_MOTION_PLANE: XY_PLANE/ZX_PLANE/YZ_PLANE
CMS_C_CUTCOM_METHOD:
CMS_C_FEED_MODE:
FEED_PER_MINUTE/FEED_PER_REVOLUTION/INVERSE_TIME
CMS_C_CUTTER_COMP_VALUE:
CMS_C_CUTTER_COMP_INDEX:
CMS_C_CUTTER_OFFSET_VALUE:
CMS_C_TOOL_LEN_COMP
CMS_C_TOOL_LEN_COMP_DIR:
CMS_C_TOOLNUM:
CMS_C_SPINDLE_SPEED:
CMS_C_D3_TOOL_OFFSET_FLAG: TRUE/FALSE
CMS_C_FEEDRATE:
CMS_C_NEW_OVERRIDE_FEEDRATE: TRUE/FALSE
CMS_C_CUR_WORK_COORD:
CMS_C_SUB_CALL: TRUE/FALSE
CMS_C_SEQ_NEST_LEVEL:
CMS_C_ROTARY_ABS_DIRECTION:
ROTARY_POS_CCW/ROTARY_POS_CW/ROTARY_ALWAYS_CW/ROTARY_AL
WAYS_CW/ROTARY_SHORTEST_DISTANCE/ROTARY_LINEAR
CMS_C_ACTIVE_TOOL_NUMBER:
CMS_C_TOOL_OFFSET_NUM:
CMS_C_CDC_OFF_ADJ: TRUE/FALSE
CMS_C_LOWER_GUIDE_H:
CMS_C_UPPER_GUIDE_H:
CMS_C_LOWER2REF_PLANE:
CMS_C_REF2UPPER_PLANE:
CMS_C_SHOW_WIRE: TRUE/FALSE
CMS_C_CYCLE_SUBROUTINE: TRUE/FALSE
CMS_C_CYCLE_SUBROUTINE_DEPTH:
CMS_C_DYN_3D_TOOL_OFFSET:
CMS_C_MILLINTMODE_FLAG: TRUE/FALSE
CMS_C_NC_MACRO_MOTION: TRUE/FALSE
CMS_C_W_TOOL_SIDE: TRUE/FALSE
CMS_C_Z_TOOL_SIDE: TRUE/FALSE
CMS_C_W_ZERO_TRACKING: PRIMARY/SECONDARY
CMS_C_Z_ZERO_TRACKING: PRIMARY/SECONDARY
39
VERICUT Development Tools
CMS_C_TYPEII_STATE_INDEX:
CMS_C_PROBE_OFFSET_CNT:
CMS_C_PROBE_OFFSET_CNT:
CMS_C_RTCP: TRUE/FALSE
CMS_C_CYCLE_Z_AXIS: TRUE/FALSE
CMS_C_MULTI_AXIS_CYCLE: TRUE/FALSE
CMS_C_ROTATE_3D: TRUE/FALSE
CMS_C_APPLY_PIVOT_OFFSET: TRUE/FALSE
CMS_C_MULTIPLE_PASS: TRUE/FALSE
CMS_C_MULTIPASS_NEEDED: TRUE/FALSE
CMS_C_PASS_NUMBER:
CMS_C_MULTI_AXIS_MACHINE: TRUE/FALSE
CMS_C_MILLTURN: MILLING/TURNING/WIRE_EDM
CMS_C_MAX_TABLE_SPEED:
CMS_C_SURFACE_SPEED:
CMS_C_SPINDLE_MODE: SPINDLE_CSS/SPINDLE_RPM
CMS_C_PROGRAMMING_METHOD:
CMS_C_TURRET_TOOLS_LOADED:
CMS_C_EPSILON:
CMS_C_ANGLE_EPSILON:
CMS_C_TANGENT_EPSILON:
CMS_C_MAZAK_PART_LOADER_CNT:
40
VERICUT Development Tools
41
VERICUT Development Tools
CMEAPI_AXIS new_axis;
double new_asign;
double new_bsign;
double new_csign;
CMEAPI_AXIS new_count;
CMEAPI_POINT new_map;
CMEAPI_AXIS new_active;
char *cmeapi_get_c_text_vars(variable);
double variable:
42
VERICUT Development Tools
Returns the values associated with the specified typeII argument (the input argument that
specifies which type II argument you want data on). If index is set to -1, the type II
special argument is returned.
Index 2:
char *= "10+5"
value = 15
argtype = 1
Index 3:
char *= "test"
value = 0
argtype = 2 (text argument)
Index -1:
char *= "1"
value = 1
argtype = 1 (???)
The special argument is the argument that comes after the ";".
43
VERICUT Development Tools
CMEAPI_POINT cmeapi_get_component_location(comp_register_name);
char *comp_register_name
double cmeapi_get_file_id();
Returns the various filenames that are being used by this job in the corresponding
arguments. The full_path_flag is set to 1, the full path name will be returned for each file,
otherwise only the last level file name will be returned.
double cmeapi_get_gage_length(tool_component);
char *tool_component;
Returns the length of the tool which is connected to the specified component as measured
from the zero point of the tool to the gage_line. If a tool component is not specified, the
current active tool component will be used.
44
VERICUT Development Tools
double cmeapi_get_gage_offset(active_tool_component);
char *active_tool_component;
Calculates and returns the gage offset for the current tool in the "active_tool_component".
This is calculated as: GAGEPOINT_OFFSET - DRIVENPOINT_OFFSET. This function
replaces void cmeapi_get_gage_length() which only retrieved the Z Axis length of the
tool.
double cmeapi_get_gage_offset2(active_tool_component);
char *active_tool_component;
Calculates and returns the gage offset for the current tool in the "active_tool_component".
This is calculated as: -(Cutter Origin Offset + DRIVENPOINT_OFFSET). This function
is only used in special circumstances. Typically, the void cmeapi_get_gage_offset()
macro is used instead of this function.
double cmeapi_get_guide_z_distance();
Returns the vertical distance between the guides.
char *cmeapi_get_inch_format(word);
char *word;
See also:
double cmeapi_format_number(format, type, value);
double cmeapi_get_inch_type(word);
char *cmeapi_get_metric_format(word);
double cmeapi_get_metric_type(word);
double cmeapi_get_multiplier(word);
void cmeapi_set_if_cond(flag);
void cmeapi_set_metric_mode();
45
VERICUT Development Tools
double cmeapi_get_inch_type(word);
char *word;
Returns the inch type for the specified word . A return value of 0 means Decimal, 1
means Leading, and 2 means Trailing.
See also:
double cmeapi_format_number(format, type, value);
char *cmeapi_get_inch_format(word);
char *cmeapi_get_metric_format(word);
double cmeapi_get_metric_type(word);
double cmeapi_get_multiplier(word);
void cmeapi_set_if_cond(flag);
void cmeapi_set_metric_mode();
void cmeapi_get_input_block();
Returns the current block.
double cmeapi_get_input_location();
Returns the position in the machine code file of the current block.
See also:
double cmeapi_get_next_input_location();
double cmeapi_set_input_location(location, sequence_number, file_id);
char *cmeapi_get_macro_modal(modal_name);
char *modal_name;
46
VERICUT Development Tools
See also:
void cmeapi_get_last_token(word, value);
char *cmeapi_get_metric_format(word);
char *word;
See also:
double cmeapi_format_number(format, type, value);
char *cmeapi_get_inch_format(word);
double cmeapi_get_inch_type(word);
double cmeapi_get_metric_type(word);
double cmeapi_get_multiplier(word);
void cmeapi_set_if_cond(flag);
void cmeapi_set_metric_mode();
double cmeapi_get_metric_type(word);
char *word;
Returns the metric type for the specified word . A return value of 0 means Decimal, 1
means Leading, and 2 means Trailing.
See also:
double cmeapi_format_number(format, type, value);
char *cmeapi_get_inch_format(word);
double cmeapi_get_inch_type(word);
char *cmeapi_get_metric_format(word);
double cmeapi_get_multiplier(word);
void cmeapi_set_if_cond(flag);
void cmeapi_set_metric_mode();
char *cmeapi_get_mm_menu_string(modal_item);
char *modal_item;
Returns the text string that is to be associated with the specified macro modal menu item.
47
VERICUT Development Tools
Returns the text string that is to be associated with the specified widget and its value. The
first argument is the name of the label widget. The second argument is the name of the
value widget (if it is a choice item). The corresponding label string and value string are
returned in the third and fourth arguments.
double cmeapi_get_multiplier(word);
char *word;
See also:
double cmeapi_format_number(format, type, value);
char *cmeapi_get_inch_format(word);
double cmeapi_get_inch_type(word);
char *cmeapi_get_metric_format(word);
double cmeapi_get_metric_type(word);
void cmeapi_set_if_cond(flag);
void cmeapi_set_metric_mode();
void cmeapi_get_input_block();
double cmeapi_set_input_location(location, sequence_number, file_id);
int cmeapi_get_nc_vacant_var(var_name);
double var_name;
Returns a value (1 for YES or 0 for NO) indicating whether the specified nc variable has
been set.
48
VERICUT Development Tools
Returns in the first argument, an array of numbers (1 for YES or 0 for NO) indicating
whether the specified nc variables have been set. The vacant indicator array of numbers
corresponds to the nc variables starting with the second argument (start_index) and
ending with the third argument (end_index).
double cmeapi_get_nc_var(var_name);
double var_name;
Returns an array of values for the nc variables beginning from start index and ending at
end index.
See also:
double cmeapi_get_alpha_nc_var(variable_name);
void cmeapi_set_alpha_nc_var(variable_name, value);
void cmeapi_set_nc_vars(nc_vars, start, end);
double cmeapi_get_next_input_location();
Returns the machine code file position of the beginning of the next block following the
current block.
double cmeapi_get_num_errors();
Returns the number of errors which have occurred.
49
VERICUT Development Tools
double cmeapi_get_num_warns();
Returns the number of warnings which have occurred.
double cmeapi_get_number_of_objects();
Returns the number of objects in the current block.
double cmeapi_get_number_of_opti_objects();
Returns the number of optimizeable objects in the current block. Comments and
assignments are not included in this list of objects.
char *cmeapi_get_operator_input();
Raises the main message window, and prompts the operator for input. The operator's
input is then returned.
void cmeapi_get_opti_block_type(return_value);
double return_value;
Returns the current opti_block_type as specified within Vericut. Possible values are:
VC_UNDEFINED, VC_FIRST_BLOCK, VC_MIDDLE_BLOCK, and
VC_LAST_BLOCK. This is used to detemine which word/value pairs will be in the
current output block.
char *cmeapi_get_part_spindle();
Returns the name of the first ROTARY or SPINDLE component that is found moving
from the part to the base. If no ROTARY or SPINDLE component is found, an empty
string is returned.
50
VERICUT Development Tools
double cmeapi_get_programming_method();
Returns the programming method (0 for tool tip, 1 for gage length, and 2 for tool length
compensation).
Returns a series of information associated with RAPID motion for the specified
component.
51
VERICUT Development Tools
CMEAPI_VECTOR *cmeapi_get_tool_axis();
CMEAPI_POINT
cmeapi_get_tool_axis_position(tool_name);
char *tool_name;
This function is passed a X,Y,Z offset that is to be applied to the current tool component.
This functions multiplies this offset by the tool's current transformation matrix, and
returns this value within the structure OFFSET_TYPE. It also returns within the 4th, 5th,
and 6th arguments, the register names of the components which moves the current tool
component along the X,Y,Z axis. Here is the definition of the OFFSET_TYPE type
structure.
type OFFSET_TYPE {
double x, y, z, a, b, c, u, v, w;
};
CMEAPI_TOOL_REC cmeapi_get_tool_location(status_flag);
double status_flag;
Returns the current tool location's X, Y, Z position as well as the tool orientation I, J, K,
vector in the structure CMEAPI_TOOL_REC. Here is the definition of the
CMEAPI_TOOL_REC type structure. If status flag is set to 1, the tool's position will be
updated within the status window.
52
VERICUT Development Tools
type CMEAPI_POINT {
double x,y,z;
};
type CMEAPI_VECTOR {
double i,j,k;
};
type CMEAPI_TOOL_REC {
CMEAPI_POINT pos;
CMEAPI_VECTOR vec;
};
See also:
double cmeapi_is_component_register(register_name);
double cmeapi_machine_is_multi_axis();
void cmeapi_process_motion(subsystem, register_name, value);
CMEAPI_TOOL_REC cmeapi_get_wire_location();
Returns the current position and angle of the wire. The current position is based off of the
lower guide.
If the specified word is found in the current block, the corresponding value will be
returned. If the value is a numeric value, the value will be returned in the second
argument and the function will return a 1. If the value is a text value, the value will be
returned in the third argument, and the function will return a 2. If the word is not found,
the function will return a 0.
Determines whether either of the guides are fixed (in X and Y). The corresponding guide
is set to 0 if not fixed, and 1 if fixed.
53
VERICUT Development Tools
void cmeapi_init_nurbs();
Initializes a NURBS structure. This routine should be called at the beginning of each
NURBS statement.
See also:
void cmeapi_add_nurbs_ctrl(xval, yval, zval, ivector, jvector, kvector, weight);
void cmeapi_add_nurbs_knot(knot);
void cmeapi_add_nurbs_objdata(knot);
void cmeapi_convert_nurbs_2_apt(subsystem, xreg, yreg, zreg, sequence_no);
void cmeapi_free_nurbs();
void cmeapi_free_nurbs_objdata(knot);
double cmeapi_nurbs_get_next_point(xval, yval, zval);
void cmeapi_set_nurbs_order(order);
void cmeapi_init_polynomial(p1x, p1y, p1z, p2x, p2y, p2z, ax, bx, ay, by, az,
bz, t);
double p1x;
double p1y;
double p1z;
double p2x;
double p2y;
double p2z;
double ax;
double bx;
double ay;
double by;
double az;
double bz;
double t;
Inititializes of polynomial curve with its appropriate values. This routine was written
specifically for Siemens.
54
VERICUT Development Tools
This function is the same as void cmeapi_set_var() except only initializes the variable if it
has not been initialized by the user (Job file). Sets the nc variable specified by the first
argument to either the double value of the fourth argument or the text value of the third
argument. The second argument contains the data type (1 for number, 2 for text).
double cmeapi_is_component_register(register_name);
char *register_name;
See also:
MEAPI_TOOL_REC void cmeapi_get_tool_location(status_flag);
double cmeapi_machine_is_multi_axis();
void cmeapi_process_motion(subsystem, register_name, value);
double cmeapi_is_multiple_pass();
Returns 1 during multiple pass operation, otherwise a 0 is returned.
See also:
OFFSET_TYPE cmeapi_get_pivot_offset();
double cmeapi_is_optimizing();
Returns 1 if optipath is currently turned on, otherwise a 0 is returned.
void cmeapi_log(message);
char *message;
Outputs the specified message to the log file. If the log file is not defined, the message
will be printed to standard out.
55
VERICUT Development Tools
double cmeapi_machine_is_multi_axis();
Returns a 1 if the machine definition contains any rotary components or if the machine
tool normal vector is not (0, 0, 1).
See also:
CMEAPI_TOOL_REC cmeapi_get_tool_location(status_flag);
double cmeapi_is_component_register(register_name);
void cmeapi_process_motion(subsystem, register_name, value);
void cmeapi_max_errors(max_errors);
double max_errors;
void cmeapi_max_warnings(max_warnings);
double max_warnings;
This function is called to execute a dwell. In most cases, this will simply cause the time
to be incremented by delta_time . If, however, the current machine is a dual head
machine running in synchronous mode, additional calculations are done to keep the heads
in sync. This is the reason for the additional arguments. Delta_time is given in minutes.
Dwell_time is the specified dwell time. The units for the dwell_time is dependent on the
feed_mode . The feed_mode is 1 for "Feed Per Minute", 2 for "Feed Per Revolution", and
3 for "Inverse Time". The spindle_speed is specified as either "Revolutions Per Minute"
or "Units Per Minute" depending on the spindle_mode . The spindle_mode is 1 for
Constant Surface Speed, and 2 for RPM. Max_table_speed is specified in "Units Per
56
VERICUT Development Tools
Minute" and is used to calculate RPM when the spindle is in Constant Surface Speed
mode.
This function returns the next point associated with the NURBS curve. This function
should not be called until the NURBS curve has been fully defined. The next point is
based off of the NURBS curve, and an internal tolerance value that is associated with the
NURBS curve. Returns 1 if there is a next point, otherwise it returns 0.
See also:
void cmeapi_add_nurbs_ctrl(xval, yval, zval, ivector, jvector, kvector, weight);
void cmeapi_add_nurbs_knot(knot);
void cmeapi_add_nurbs_objdata(knot);
void cmeapi_convert_nurbs_2_apt(subsystem, xreg, yreg, zreg, sequence_no);
void cmeapi_free_nurbs();
void cmeapi_free_nurbs_objdata(knot);
void cmeapi_init_nurbs();
void cmeapi_set_nurbs_order(order);
void cmeapi_operator_input(msg);
char *msg;
Sends a message to the operator and waits for input from the operator. The way this has
been implemented is that the specified msg is sent to the INFO location, and the
processing of the mcd file is stopped. The user/operator can then decide what to do next
in response to the specified msg .
void cmeapi_output(msg);
char *string;
The function void cmeapi_output() outputs string to the current output file. It outputs
string to standard output, when the output file is not specified.
57
VERICUT Development Tools
This routine outputs a text string to action queue. When running in look ahead mode, text
output generally should not be sent out immediately, but buffered and sent out as the
block is processed. This routine insures that the text is sent out at the right time.
void cmeapi_pass1_tool_change(tool_num);
double tool_num;
This function is called during the scan pass and is used to build a tool list. This functions
allows a tool list to be created without fully processing the file. This function will only
work however if the file does not contain subroutines..
This function returns the next point associated with the polynomial curve. This function
should not be called until the polynomial curve has been fully defined. The next point is
based off of the polynomial curve, and an internal tolerance value that is associated with
the polynomial curve. Returns 1 if these is a next point, otherwise it returns 0.
58
VERICUT Development Tools
See also:
CMEAPI_TOOL_REC cmeapi_get_tool_location(status_flag);
double cmeapi_is_component_register(register_name);
double cmeapi_machine_is_multi_axis();
59
VERICUT Development Tools
void cmeapi_process_sync();
char *register_name;
double value;
Tells the current head to stop processing and wait until the other head gets to the
corresponding sync location.
60
VERICUT Development Tools
Passes the macro modal information for a specific category to Machine Simulation. After
the CME file is loaded, Machine Simulation will call register_macro_modals(). This
macro then calls void cmeapi_register_macro_modals() repeatedly, once for each
category of macro modals. For each category , a menu item will be created in Machine
Simulation. The modals parameter contains a list of modal definitions, terminated with a
NULL string. Each modal definition contains a list of arguments, terminated with a
NULL string. The first argument is the label for the modal. The second argument is the
default value. If the modal is a text field, no other arguments are needed. If the modal is a
choice field, additional arguments are given for each choice field.
Defines a CME state variable, and list the corresponding values that can be associated
with the given state variable.
void cmeapi_register_table_names(table_names);
char *table_names[];
Passes the list of table names that are defined in the CME. This list is used to create
dynamic menu options.
void cmeapi_reset_job_send_types();
Resets the information associated with the send_types. Calling void
cmeapi_set_send_value() dynamically allocate memory. This memory is freed with the
call to this function.
void cmeapi_reset_job_values();
Resets a few job values that are used by both Machine Simulation and the CME.
Currently these values include: num_errors, total_num_errors, num_warnings, and
total_time.
61
VERICUT Development Tools
void cmeapi_reset_states();
Resets the machsim state variables associated with the current CME.
void cmeapi_screen(message,);
char *message;
Prints the specified message to the screen. In general, this routine should not be used.
void cmeapi_send() is the preferred method of sending information.
This is the general purpose function for the printing of all messages. Message_type
specifies the type of message (error, warning, info, debug,...). The message_type also
indicated the destination for the message. This relationship was established with the void
cmeapi_set_send_value() cfunc. For OUTPUT message types (6), the sequence_number
is concatenated to the message.
void cmeapi_set_active_tool(component_name);
char *component_name;
See also:
double cmeapi_get_alpha_nc_var(variable_name);
void cmeapi_get_nc_vars(nc_vars, start, end);
void cmeapi_set_nc_vars(nc_vars, start, end);
62
VERICUT Development Tools
Sets the value of a specific variable. This function is used with array variables. The
indexed value into the specified array will be set. See double cmeapi_get_c_array_vars()
for a list of supported variables.:
63
VERICUT Development Tools
64
VERICUT Development Tools
65
VERICUT Development Tools
66
VERICUT Development Tools
Sets the text value of a specific variable. See char* cmeapi_get_c_text_vars() for a list of
supported variables.
Sets the values associated with the specified typeII argument. If index is set to -1, the
type II special argument is returned.
Passes the block skip information to Machine Simulation. Block_skip_char is the block
skip character marker. Num_switches indicates the number of switches that are
67
VERICUT Development Tools
supported, and switch_values are the current value for each switch (0 for OFF, and 1 for
ON).
void cmeapi_set_coolant(coolant_str);
char *coolant_str;
Passes the current coolant string to Machine Simulation. For example: COOLANT/ON or
COOLANT/MIST,... This is typically used to set the corresponding status field.
void cmeapi_set_cycle_component(component_register_name);
char *component_register_name;
void cmeapi_set_cycle_motion(cycle_motion_type);
double cycle_motion_type;
Set the type of cycle motion. Valid types are: IGNORE, BOTTOM_ONLY, or
FULL_MOTION.
Passes the current feedrate to Machine Simulation. This is typically used to set the
corresponding status field.
68
VERICUT Development Tools
See also:
CMEAPI_VECTOR cmeapi_convert_machine_vector(input);
void cmeapi_set_tool_length_offset(z_offset);
void cmeapi_set_if_cond(flag);
double flag
Sets a flag indicating whether the previous "IF" condition was true or not.
void cmeapi_set_inch_mode();
Sets Machine Simulation into inch mode. In inch mode, Machine Simulation uses the
inch formats to convert all word values.
See also:
double cmeapi_format_number(format, type, value);
char *cmeapi_get_inch_format(word);
double cmeapi_get_inch_type(word);
char *cmeapi_get_metric_format(word);
double cmeapi_get_metric_type(word);
double cmeapi_get_multiplier(word);
void cmeapi_set_metric_mode();
69
VERICUT Development Tools
Sets the file position of the machine code file to location and the block sequence number
to sequence_number . The return value of 0 means the cfunc succeeded, a nonzero value
means failure. If file_id is present, it specifies the file being referenced.
See also:
double cmeapi_get_next_input_location();
void cmeapi_set_math_precedence(value);
double value;
Sets the type of math precedence to be used when parsing the mcd file. Options are: 0 for
normal rules of mathematical precedence, and 1 for left to right precedence.
void cmeapi_set_metric_mode();
Sets Machine Simulation into metric mode. In metric mode, Machine Simulation uses the
metric formats to convert all word values.
See also:
double cmeapi_format_number(format, type, value);
char *cmeapi_get_inch_format(word);
double cmeapi_get_inch_type(word);
char *cmeapi_get_metric_format(word);
double cmeapi_get_metric_type(word);
double cmeapi_get_multiplier(word);
void cmeapi_set_if_cond(flag);
70
VERICUT Development Tools
Sets the vacant flags for the nc variables beginning from start and ending at end to the
values beginning at the first position of nc_vars.
Sets the values for the nc variables beginning from start and ending at end to the values
beginning at the first position of nc_vars.
See also:
double cmeapi_get_alpha_nc_var(variable_name);
void cmeapi_get_nc_vars(nc_vars, start, end);
void cmeapi_set_alpha_nc_var(variable_name, value);
void cmeapi_set_nurbs_order(order);
double order;
See also:
void cmeapi_add_nurbs_ctrl(xval, yval, zval, ivector, jvector, kvector, weight);
void cmeapi_add_nurbs_knot(knot);
void cmeapi_add_nurbs_objdata(knot);
void cmeapi_convert_nurbs_2_apt(subsystem, xreg, yreg, zreg, sequence_no);
void cmeapi_free_nurbs();
void cmeapi_free_nurbs_objdata(knot);
void cmeapi_init_nurbs();
double cmeapi_nurbs_get_next_point(xval, yval, zval);
71
VERICUT Development Tools
void cmeapi_set_program_block_start(value);
double value;
Sets the starting block, during the conversion pass, to be either the current block, or the
next block. If value is set to 0,set it to the current block. If value is set to 1, set it to the
next block. This function will typically only be called during the scan pass.
Specifies where to send a specific message type. Any number of message types can be
used. The following, however, have pre-defined meaning.
1 = Error
2 = Warning
3 = Informational
4 = Debug
5 = Input
6 = Output
10 = A continuation of a previous Error message
The above values can be added together. For example: A value of 5 specifies that the
destination is both the output file and the screen.
72
VERICUT Development Tools
void cmeapi_set_spindle(spindle_str);
char *spindle_str;
Passes the current spindle setting (ON, OFF, or speed) to Machine Simulation. This is
typically used to set the corresponding status field.
void cmeapi_set_spindle_mode(mode);
char *mode;
Passes the current spindle mode(1 for CSS, 2 for RPM) to Machine Simulation. This is
typically used to set the corresponding status field.
void cmeapi_set_tool_length_offset(z_offset);
double z_offset;
See also:
CMEAPI_VECTOR cmeapi_convert_machine_vector(input);
void cmeapi_set_fixture_offsets(subsystem, comp_reg_name, value);
73
VERICUT Development Tools
Sets the nc variable specified by the first argument to either the double value of the fourth
argument or the text value of the third argument. The second argument contains the data
type (1 for number, 2 for text).
void cmeapi_set_word_string(text_str);
char *text_str;
Passes a textt string back to the tokenize logic. This is used while processing conditional
macros. Currently it is only used to pass a function name that is to be executed if the
conditional macro evaluates to be a function.
void cmeapi_siemens_last_nurbs_line();
This routine is a siemens specific routine which takes a peek at the next line to determine
if the current line is the last line of the NURBS statement. It returns 0 if the NURBS
statement continues on the next line, and returns 1 if the current line is the last line of the
NURBS statement.
This routine is a siemens specific routine which parses a text string and returns 3 values.
74
VERICUT Development Tools
Substitutes word/value pairs into the existing input block. If the specified word is not
found in the input block, and this is a new value for this word, the new word/value string
will be concatenated to the original input block (before any comments or end of block
characters). The resulting string is returned.
NOTE: This routine now makes use of the block_type (first, middle, last) to determine
whether the sequence number and the after motion word/value pairs should be included
in the output block.
void cmeapi_sync_transfer();
This function is only used when running dual heads in synchronous mode. While in
synchronous mode, 1 head is in control. This function transfer the control to the other
head.
75
VERICUT Development Tools
void cmeapi_user_abort_processing(message);
char *message;
This function stops the current processing of the MCD file, and prints an informational
message (if a message is specified).
76