Overview
This StixCtlGenerate has a variety of built-in generation styles and can be configured in many ways to produce output that matches your needs.
At the simplest level, you can call setStyle() with the names in the table below to configure a generator object to produce that output. The second column shows the name of the C function that takes a reference to the generate object and configures it. The following uses are equivalent:
StixCtlGenerate fmt; fmt.setStyle("haas"); // look up by name stixctl_use_style_haas(fmt); // call function directly
If you need finer-grained control, you can test for a particular traversal event and emit your own codes as shown in the formatting example(). You can also change the format functions used by the format object with setEventFn(), setTypeFn(), setCommentFn(), or setOtherFn(). A list of built in comment functions and generation functions are shown at the end of this section.
Style Name | Function | Description |
---|---|---|
"apt" | stixctl_use_style_apt | APT program. Moves are converted into GOTO commands with appropriate FEDRAT, RAPID, and SPINDL modifiers. Tool changes are declared with the TLDATA/MILL style command used by NX. |
"crcl" | stixctl_use_style_crcl | Canonical Robot Command Language, a low level XML robot command format. The output does linear moves and simulated probing operations. |
"dmis" | stixctl_use_style_dmis | DMIS program that declares the datums defined by the STEP model and an inspection plan using the probing operations defined in the model. The output also declares the features for the geometry associated with the probing operations, so a group of probes on a cylindrical surface will be declared with a FEAT/CYLNDR and a MEAS/CYLNDR block. Similarly for FEAT/PLANE. |
"dmis-cnc" | stixctl_use_style_dmis | Alias for the "dmis" style |
"dmis-manual" | stixctl_use_style_dmis_manual | Same as the "dmis", but starts with MODE/MAN rather than MODE/PROG,MAN. |
"esab-cut" | stixctl_use_style_esab_cut | ESAB Plate Cutting with a plasma torch. One of three styles of output generated from STEP-NC process for plasma cutting and laser marking on ESAB controls. This was used by an NSRP project to explore STEP-NC for steel processing in shipbuilding. |
"esab-farmark" | stixctl_use_style_esab_farmark | ESAB Farside Mark with laser. See above. |
"esab-nearmark" | stixctl_use_style_esab_nearmark | ESAB Nearside Mark with laser. See above. |
"fanuc" | stixctl_use_style_fanuc | General FANUC program style. Program uses the getProgramNumber() value in the header declaration. Will use TCP mode G43.5 and command IJK for five axis moves. Uses Renishaw inspection-plus macros for probing. |
"fanuc-boeing" | stixctl_use_style_fanuc_boeing | FANUC variation that adds 100 to the tool number on tool changes and does not use M6. It also retracts to the security plane and does a C-axis unwind between every workingstep. |
"haas" | stixctl_use_style_haas | General Haas program style. Based on the FANUC style but has Haas codes for through-spindle coolant. Uses Renishaw inspection-plus macros for probing. |
"haas-rpi" | stixctl_use_style_haas_rpi | Haas variation with changes requested by the RPI CAT. |
"heidenhain" | stixctl_use_style_heidenhain | General Heidenhain program style. Forces all lines to have block numbers. Use one of the variants below for five axis programs. |
"heidenhain-ac" | stixctl_use_style_heidenhain_ac | Heidenhain variation for AC machines. Uses M128 and commands A/C for five axis moves. |
"heidenhain-bc" | stixctl_use_style_heidenhain_bc | Heidenhain variation for BC machines. Uses M128 and commands B/C for five axis moves. |
"mdsi" | stixctl_use_style_mdsi | MDSI program style for a left-handed lathe. This was used for early turning tests. It sets the destination transform to place everything into the ZX plane and reverse arc directions for the left-handed lathe. |
"okuma" | stixctl_use_style_okuma | General Okuma program style. Use one of the variants below for five axis programs. |
"okuma-ac" | stixctl_use_style_okuma_ac | Okuma variation for AC machines. Uses G169 and commands A/C for five axis moves. |
"okuma-bc" | stixctl_use_style_okuma_bc | Okuma variation for BC machines. Uses G169 and commands B/C for five axis moves. |
"okuma-omac" | stixctl_use_style_okuma_omac | Okuma variation with OMAC macros for spindle and other fuctions. |
"siemens" | stixctl_use_style_siemens | General Siemens program style. This uses TRAORI with A3/B3/C3 commands for five axis motion and the native CYCLE978 for XY probing. It also uses OMAC macros for spindle and other fuctions. |
"siemens-810" | stixctl_use_style_siemens_810 | Siemens variation that does not use any macros |
"siemens-dmdii" | stixctl_use_style_siemens_dmdii | Siemens variation that uses Renishaw inspection plus macros and TRAORI, but commands the AC axes. |
"siemens-nist" | stixctl_use_style_siemens_nist | Siemens variation that uses G700 to set units rather than G70. |
"siemens-renishaw" | stixctl_use_style_siemens_renishaw | Siemens variation that uses Renishaw inspection plus macros. |
"siemens-traori" | stixctl_use_style_siemens_traori | Siemens variation that explicitly calls TRAORI setup rather than expecting it to be done using OMAC macros. |
Comment Functions
The built-in comment functions are listed below. They all follow the StixCtlGenerateStringFn function prototype, which takes a generate object, a state vars object, and a string, then returns a string object with the result.
Function | Description |
---|---|
stixctl_gen_comment_none | No comment, returns null string |
stixctl_gen_comment_parens_uppercase | Wraps the string in parentheses, converts all alphabetic characters to uppercase and strips any non-printable characters, parens or percent signs |
stixctl_gen_comment_parens | Wraps the string in parentheses and strips any non-printable characters, parens or percent signs |
stixctl_gen_comment_semi | Prepends a semicolon to the start of the comment text. Strips any non-printable characters |
stixctl_gen_comment_dmis | Prepends a "$$" to the start of the comment text. |
stixctl_gen_comment_apt | Prepends a "$$" to the start of the comment text. |
stixctl_gen_comment_xml | Embeds the text in an XML comment <!-- --> |
Generation Functions
The built-in format functions are listed below. They all follow the StixCtlGenerateFn function prototype, which takes a generate object, a state vars object, and a cursor object, then returns a string object with the result. These are the functions that handle the details of the built-in styles.
Some of these functions are used with setEventFn() to handle events, some with setTypeFn() to handle specific types of process elements, but most are used with setOtherFn() to provide partial strings that are assembled into a complete response for an event.
Function | Description |
---|---|
stixctl_do_typefn | This is simply a wrapper around formatType() that simplifies calling the appropriate type function on a MOVE or OPERATION START event. |
stixctl_gen_none | No output. Always returns null string. |
stixctl_gen_coolant_apt | Turn coolant on or off as appropriate with COOLNT/FLOOD, COOLNT/MIST, and COOLNT/THRU, and the coolant_off function for off |
stixctl_gen_coolant_default | Turn coolant on or off as appropriate with M08 for flood, M07 for mist, and the coolant_off function for off. |
stixctl_gen_coolant_haas | Turn coolant on or off as appropriate with M08 for flood, M07 for mist, M88 for through-spindle and the coolant_off function for off. |
stixctl_gen_coolant_off_apt | Turn off all coolant with COOLNT/OFF |
stixctl_gen_coolant_off_default | Turn off all coolant with M09 |
stixctl_gen_coolant_off_haas | Turn off flood/mist coolant with M09 and through-spindle with M89. |
stixctl_gen_coolant_off_siemens_macro | Turn off flood coolant with WSCOOLOF. |
stixctl_gen_coolant_okuma | Turn coolant on or off as appropriate with M08 for flood, M07 for mist, M50 for through-spindle and the coolant_off function for off. |
stixctl_gen_coolant_siemens_macro | Turn on flood coolant with WS_FLOOD. |
stixctl_gen_error | Used to handle ERROR events from the cursor. Formats the error message as a comment. |
stixctl_gen_filename | Returns the name of the STEP-NC file as a comment. Used at the start of programs to identify the source of the process. |
stixctl_gen_move_apt | |
stixctl_gen_move_arc_apt | |
stixctl_gen_move_arc_default | |
stixctl_gen_move_arc_esab | |
stixctl_gen_move_arc_fanuc | |
stixctl_gen_move_arc_heidenhain | |
stixctl_gen_move_arc_siemens | |
stixctl_gen_move_contact | |
stixctl_gen_move_crcl | |
stixctl_gen_move_default | |
stixctl_gen_move_dmis | |
stixctl_gen_move_feed | |
stixctl_gen_move_feed_apt | |
stixctl_gen_move_feed_esab | |
stixctl_gen_move_helix_apt | |
stixctl_gen_move_helix_default | |
stixctl_gen_move_helix_fanuc | |
stixctl_gen_move_helix_heidenhain | |
stixctl_gen_move_helix_siemens | |
stixctl_gen_move_ijk_fanuc | |
stixctl_gen_move_ijk_siemens_traori | |
stixctl_gen_move_ijk_tcp_ab | |
stixctl_gen_move_ijk_tcp_ac | |
stixctl_gen_move_ijk_tcp_bc | |
stixctl_gen_move_none | |
stixctl_gen_move_trace | |
stixctl_gen_move_xyz | |
stixctl_gen_move_xyz_esab | |
stixctl_gen_ncfun_default | |
stixctl_gen_ncfun_exchange_pallet_default | |
stixctl_gen_ncfun_extended_default | |
stixctl_gen_ncfun_extended_esab | |
stixctl_gen_ncfun_index_pallet_default | |
stixctl_gen_ncfun_index_table_default | |
stixctl_gen_ncfun_index_table_heidenhain | |
stixctl_gen_ncfun_message_comma_uppercase | |
stixctl_gen_ncfun_message_comment | |
stixctl_gen_ncfun_message_default | |
stixctl_gen_ncfun_message_dmis | |
stixctl_gen_ncfun_message_okuma | |
stixctl_gen_ncfun_message_siemens | |
stixctl_gen_ncfun_optional_stop_apt | |
stixctl_gen_ncfun_optional_stop_default | |
stixctl_gen_ncfun_stop_apt | |
stixctl_gen_ncfun_stop_default | |
stixctl_gen_op_approach_paths | |
stixctl_gen_op_lift_paths | |
stixctl_gen_probe_comments | |
stixctl_gen_probe_comments_dmis | |
stixctl_gen_probe_crcl | |
stixctl_gen_probe_datums_dmis | |
stixctl_gen_probe_default | |
stixctl_gen_probe_dmis_feature | |
stixctl_gen_probe_dmis_feature_end | |
stixctl_gen_probe_dmis_feature_start | |
stixctl_gen_probe_dmis_ptfeat | |
stixctl_gen_probe_dmis_ptmeas | |
stixctl_gen_probe_fanuc_renishaw | |
stixctl_gen_probe_haas_renishaw | |
stixctl_gen_probe_heidenhain | |
stixctl_gen_probe_heidenhain_hhcycle | |
stixctl_gen_probe_okuma | |
stixctl_gen_probe_prog_begin_siemens | |
stixctl_gen_probe_siemens_renishaw | |
stixctl_gen_probe_siemens_xy | |
stixctl_gen_program_end_apt | |
stixctl_gen_program_end_crcl | |
stixctl_gen_program_end_default | |
stixctl_gen_program_end_dmis | |
stixctl_gen_program_end_esab | |
stixctl_gen_program_end_fanuc | |
stixctl_gen_program_end_heidenhain | |
stixctl_gen_program_end_okuma | |
stixctl_gen_program_end_okuma_omac | |
stixctl_gen_program_end_siemens | |
stixctl_gen_program_end_siemens_traori | |
stixctl_gen_program_start_apt | |
stixctl_gen_program_start_crcl | |
stixctl_gen_program_start_default | |
stixctl_gen_program_start_dmis | |
stixctl_gen_program_start_esab | |
stixctl_gen_program_start_fanuc | |
stixctl_gen_program_start_haas_rpi | |
stixctl_gen_program_start_heidenhain | |
stixctl_gen_program_start_mdsi | |
stixctl_gen_program_start_okuma | |
stixctl_gen_program_start_okuma_omac | |
stixctl_gen_program_start_siemens | |
stixctl_gen_refpoint_center | |
stixctl_gen_refpoint_contact | |
stixctl_gen_refpoint_left | |
stixctl_gen_refpoint_right | |
stixctl_gen_setup_start_default | |
stixctl_gen_spindle_apt | |
stixctl_gen_spindle_default | |
stixctl_gen_spindle_off_apt | |
stixctl_gen_spindle_off_default | |
stixctl_gen_spindle_off_siemens_macro | |
stixctl_gen_spindle_siemens_macro | |
stixctl_gen_spindle_speed_before_direction | |
stixctl_gen_tap_comment | |
stixctl_gen_tap_default | |
stixctl_gen_tap_first | |
stixctl_gen_tap_first_siemens | |
stixctl_gen_tap_last | |
stixctl_gen_tap_last_g84 | |
stixctl_gen_tap_point_default | |
stixctl_gen_tap_point_g84 | |
stixctl_gen_tap_point_siemens | |
stixctl_gen_timestamp | Returns the current time formatted as an ISO-style date in a comment. Used at the start of programs to identify when the output was created. |
stixctl_gen_tool_change_apt | |
stixctl_gen_tool_change_comment | |
stixctl_gen_tool_change_default | |
stixctl_gen_tool_change_fanuc_tcp | |
stixctl_gen_tool_change_fanuc_tcp_T100_no_M6 | |
stixctl_gen_tool_change_haas_rpi | |
stixctl_gen_tool_change_heidenhain | |
stixctl_gen_tool_change_mdsi | |
stixctl_gen_tool_change_okuma | |
stixctl_gen_tool_change_okuma_omac | |
stixctl_gen_tool_change_siemens | |
stixctl_gen_tool_change_siemens_810 | |
stixctl_gen_tool_change_siemens_traori | |
stixctl_gen_toolpath_start_default | |
stixctl_gen_units_apt | |
stixctl_gen_units_crcl | |
stixctl_gen_units_dmis | |
stixctl_gen_units_g20 | |
stixctl_gen_units_g70 | |
stixctl_gen_units_g700 | |
stixctl_gen_workingstep_end_default | |
stixctl_gen_workingstep_start_default | |
stixctl_gen_workingstep_start_esab | |
stixctl_gen_workingstep_start_fanuc_unwind | |
stixctl_gen_workoffset_default | |
stixctl_gen_workoffset_okuma | |
stixctl_gen_workplan_end_default | |
stixctl_gen_workplan_probe_end_default | |
stixctl_gen_workplan_probe_end_fanuc_renishaw | |
stixctl_gen_workplan_probe_end_haas_renishaw | |
stixctl_gen_workplan_probe_end_okuma | |
stixctl_gen_workplan_probe_end_siemens_renishaw | |
stixctl_gen_workplan_probe_start_default | |
stixctl_gen_workplan_probe_start_fanuc_renishaw | |
stixctl_gen_workplan_probe_start_haas_renishaw | |
stixctl_gen_workplan_probe_start_okuma | |
stixctl_gen_workplan_probe_start_siemens_renishaw | |
stixctl_gen_workplan_start_default | |
stixctl_gen_workplan_start_dmis |