You are on page 1of 218

Contents

CTRL_SINUMERIK_BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
LIB_CTRL_custom_cycle800_auto_set_kin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
LIB_CTRL_custom_cycle800_plane_output_kin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
LIB_ISV_ini_get_env_dir_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
LIB_ISV_init_ini_files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
LIB_main_origin_call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
LIB_RETURN_move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7

CTRL_FANUC_BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
LIB_ISV_ini_get_env_dir_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
LIB_ISV_init_ini_files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
LIB_main_origin_call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
LIB_RETURN_move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5

CTRL_GENERIC_BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
LIB_ISV_ini_get_env_dir_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
LIB_ISV_init_ini_files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
LIB_main_origin_call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
LIB_RETURN_move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5

CTRL_HEIDENHAIN_BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
LIB_main_origin_call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
LIB_output_local_zero_offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
LIB_RETURN_move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
LIB_start_of_program_blk_form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5

CTRL_OKUMA_BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
LIB_ISV_ini_get_env_dir_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
LIB_ISV_init_ini_files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
LIB_main_origin_call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
LIB_RETURN_move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5

LIB_DOCUMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
LIB_DC_check_variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
LIB_DC_complete_formatline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
LIB_DC_ellipsis_character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
LIB_DC_escape_string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
LIB_DC_format_string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
LIB_DC_time_format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8

LIB_FILE_HANDLING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1

Library commands for Post Configurator 1


Contents
Contents

LIB_FH_cleanup_directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
LIB_FH_create_directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
LIB_FH_create_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
LIB_FH_escape_special_characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
LIB_FH_file_to_list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
LIB_FH_file_to_list_line_numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
LIB_FH_file_writable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
LIB_FH_format_database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
LIB_FH_list_to_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
LIB_FH_open_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
LIB_FH_output_literal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
LIB_FH_reverse_escape_special_characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
LIB_FH_search_file_glob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
LIB_FH_search_path_recursively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15

LIB_GENERAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1

LIB_CONF_do_prop_custom_proc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
LIB_CONF_prop_custom_proc_body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
LIB_GE_abort_message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
LIB_GE_ask_type_subtype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
LIB_GE_cleanup_list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
LIB_GE_command_buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
LIB_GE_command_buffer_output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
LIB_GE_command_buffer_seq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10
LIB_GE_comment_convert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11
LIB_GE_CONF_add_chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-12
LIB_GE_CONF_set_property_access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
LIB_GE_CONF_set_property_datatype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-15
LIB_GE_CONF_set_property_options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-16
LIB_GE_CONF_set_property_ui . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-18
LIB_GE_copy_var_range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-19
LIB_GE_date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20
LIB_GE_delayed_output_message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
LIB_GE_error_message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
LIB_GE_format_path_names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
LIB_GE_generate_chain_selection_condition_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
LIB_GE_is_path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-25
LIB_GE_is_unc_path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
LIB_GE_lappend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
LIB_GE_message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
LIB_GE_message_dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-30
LIB_GE_MSG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-31
LIB_GE_read_database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-33
LIB_GE_read_expression_value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-35
LIB_GE_replace_special_characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-36
LIB_GE_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-37
LIB_GE_snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-38
LIB_GE_sort_value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-40
LIB_GE_string_range_toupper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-41

2 Library commands for Post Configurator


Contents

LIB_GE_string_toupper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-42
LIB_GE_time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-43
LIB_GE_truncate_line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-44
LIB_GE_ui . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-46
LIB_GE_wish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-48

LIB_STANDARD_POST_FUNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1

EQ_is_equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
EQ_is_ge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
EQ_is_gt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
EQ_is_le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
EQ_is_lt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6
EQ_is_zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7
hiset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
isset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9
LIB_SPF_abort_postrun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
LIB_SPF_add_warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
LIB_SPF_array_to_vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
LIB_SPF_ask_address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13
LIB_SPF_ask_block_template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
LIB_SPF_ask_delta_4th_or_5th . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15
LIB_SPF_ask_format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16
LIB_SPF_ask_smaller_of_4th_5th . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-17
LIB_SPF_ask_type_subtype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-18
LIB_SPF_atan_polar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-19
LIB_SPF_catch_warning_by_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20
LIB_SPF_convert_binary_to_decimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21
LIB_SPF_convert_decimal_to_binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-22
LIB_SPF_convert_hex_to_string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-23
LIB_SPF_convert_point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24
LIB_SPF_convert_to_md5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25
LIB_SPF_deg_to_rad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26
LIB_SPF_eliminate_zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-27
LIB_SPF_eliminate_zero_inline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-28
LIB_SPF_execute_op_tool_param_condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-29
LIB_SPF_exists_address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-30
LIB_SPF_exists_block_template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-31
LIB_SPF_exists_format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-32
LIB_SPF_extract_udecode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-33
LIB_SPF_get_partnname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-34
LIB_SPF_get_pretreatment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-35
LIB_SPF_get_pretreatment_eventbased . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-37
LIB_SPF_is_divisible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-39
LIB_SPF_is_empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-40
LIB_SPF_is_floating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-41
LIB_SPF_is_integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-42
LIB_SPF_is_matrix_equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-43
LIB_SPF_is_no_decimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-44
LIB_SPF_is_number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-45

Library commands for Post Configurator 3


Contents
Contents

LIB_SPF_is_part_of_string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-46
LIB_SPF_is_vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-47
LIB_SPF_list_non_common_elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-48
LIB_SPF_list_reverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-49
LIB_SPF_list_to_table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-50
LIB_SPF_list_trim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-52
LIB_SPF_list_trim_elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-53
LIB_SPF_list_trim_left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-54
LIB_SPF_list_trim_right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-55
LIB_SPF_matrix_to_list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-56
LIB_SPF_mcs_vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-57
LIB_SPF_modulo_sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-58
LIB_SPF_pretreatment_add_var . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-59
LIB_SPF_pt_exists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-60
LIB_SPF_pt_exists_not_empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-61
LIB_SPF_rad_to_deg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-62
LIB_SPF_read_oper_attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-63
LIB_SPF_read_part_attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-64
LIB_SPF_read_programview_attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-65
LIB_SPF_read_tool_attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-66
LIB_SPF_reset_motions_to_zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-67
LIB_SPF_restore_mom_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-68
LIB_SPF_round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-69
LIB_SPF_set_op_tool_param_condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-70
LIB_SPF_store_mom_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-72
LIB_SPF_vector_to_array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-73
MTX3_add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-74
MTX3_init_x_y_z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-75
MTX3_is_equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-76
MTX3_multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-77
MTX3_scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-78
MTX3_sub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-79
MTX3_transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-80
MTX3_vec_multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-81
MTX3_x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-82
MTX3_y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-83
MTX3_z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-84
OUTPUT_adr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-85
VEC3_add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-86
VEC3_angle_3points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-87
VEC3_angle_between . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-88
VEC3_cross . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-89
VEC3_dist_point_line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-90
VEC3_dot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-91
VEC3_dot_A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-92
VEC3_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-93
VEC3_init_s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-94
VEC3_is_equal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-95
VEC3_is_parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-96

4 Library commands for Post Configurator


Contents

VEC3_is_zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-97
VEC3_mag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-98
VEC3_negate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-99
VEC3_rotate_arbitary_axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-100
VEC3_scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-101
VEC3_sub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-102
VEC3_unitize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-103
VMOV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-104

Library commands for Post Configurator 5


Chapter 1: CTRL_SINUMERIK_BASE

Library commands for Post Configurator 1-1


Chapter
Chapter 1: 1: CTRL_SINUMERIK_BASE
CTRL_SINUMERIK_BASE

LIB_CTRL_custom_cycle800_auto_set_kin
Purpose Allows to define the kinematics used for cycle800 machine/customer specific
The kinematics for a specific CYCLE800 _MODE (39,54...) can be
implemented

The proc is called from LIB_SPF_KINEMATICS_set_plane_output_kin_ENTRY


and gets
[CONF_S840D_cycle800 _MODE] as argument

The proc returns 0 if the specific mode is not treaten in the proc, otherwise 1
Format LIB_CTRL_custom_cycle800_auto_set_kin <mode>

Return value
Examples Example 1
implementation of a specific kin setting for mode 54:

if {$mode == 54} {
CONF_SPF_plane_kin set 4th_axis "X"
CONF_SPF_plane_kin set 4th_leader "A"
CONF_SPF_plane_kin set 4th_axis_min_limit 0
set lib_parameter(inclined_plane_4th_axis_max_limit) 180.
CONF_SPF_plane_kin set 5th_axis "Y"
CONF_SPF_plane_kin set 5th_leader "B"
CONF_SPF_plane_kin set 5th_axis_min_limit 0.0
CONF_SPF_plane_kin set 5th_axis_max_limit 359.999
return 1
}

1-2 Library commands for Post Configurator


CTRL_SINUMERIK_BASE

LIB_CTRL_custom_cycle800_plane_output_kin
Purpose Allows to define the kinematics used for cycle800 machine/customer specific
The kinematics for a specific CYCLE800 _MODE (39,54...) can be
implemented

The proc is called from LIB_CSYS_plane_output_init and gets


[CONF_S840D_cycle800 _MODE] as argument

The proc returns 0 if the specific mode is not treaten in the proc, otherwise 1
Format LIB_CTRL_custom_cycle800_plane_output_kin <mode>

Return value
Examples Example 1
implementation of a specific kin setting for mode 54:

if {$mode == 54} {
set lib_parameter(cycle800,_A) $lib_coord_ang_B
set lib_parameter(cycle800,_B) $lib_coord_ang_A
set lib_parameter(cycle800,_C) $lib_coord_ang_C
return 1
}

Library commands for Post Configurator 1-3


Chapter
Chapter 1: 1: CTRL_SINUMERIK_BASE
CTRL_SINUMERIK_BASE

LIB_ISV_ini_get_env_dir_info
Purpose This function returns the path, defined with the environment variable
UGII_CAM_CSE_USER_DIR.
If the variable is not set it returns an empty string and displays an information
in the listing window.
Format LIB_ISV_ini_get_env_dir_info <mode>

Return value String with the value of the environment variable or empty string if not defined.
Examples Example 1
set cse_dir [LIB_ISV_ini_get_env_dir_info]

1-4 Library commands for Post Configurator


CTRL_SINUMERIK_BASE

LIB_ISV_init_ini_files
Purpose This procedure is automatically called in order to define how the ini file for the
cse simulation should be handled.
The following mom variables are to be set with the options for the simulation.ini
file output.
mom_sinumerik_ini_create
"Yes" ini files will be created
"No " ini files will not be created

mom_sinumerik_ini_location
"Part" ini files will be output to a subfolder \cse_files\subprog
of cam part file location. If \cse_files\subprog does not exist,
post will create this folder.
"CSE" ini files will be output to sub folder \subprog of \cse_driver
folder which is located in same directory of \postprocessor in
the respective machine ki.
"ENV" ini files will be output to a sub folder \subprog in a directory
specified over the environment variable UGII_CAM_CSE_USER_DIR.

mom_sinumerik_ini_existing
"Rename" Rename existing ini files in place where the one is created.
"Keep" Keep ini files in place where the one is created.
"Delete" Delete ini files in place where the one is created.

mom_sinumerik_ini_end_status
"Rename" Rename created ini file after post run.
"Keep" Keep created ini files after post run.
"Delete" Delete created ini files after post run.
Format LIB_ISV_init_ini_files <mode>

Return value
Examples Example 1
proc LIB_ISV_init_ini_files {} {
global mom_sinumerik_ini_create
global mom_sinumerik_ini_location
global mom_sinumerik_ini_keep_existing
global mom_sinumerik_ini_end_status

set mom_sinumerik_ini_create "Yes"


set mom_sinumerik_ini_location "Part"
set mom_sinumerik_ini_existing "Rename"
set mom_sinumerik_ini_end_status "Keep"
}

This example will activate the creation of simulation.ini at the same location as
the
partfile. If a simulation.ini file already exists, it will be renamed with a suffix.
The newly created simulation.ini file will be conserved at the end of post
processor

Library commands for Post Configurator 1-5


Chapter
Chapter 1: 1: CTRL_SINUMERIK_BASE
CTRL_SINUMERIK_BASE

LIB_main_origin_call
Purpose Writes the active main origin to the NC-code, provided that the property
[CONF_CTRL_origin use_main] is set to 'On'.
Format LIB_main_origin_call <offset_nbr> <create>

Parameters offset_nbr

Reserved argument.

create

Reserved argument.

Return value
Examples Output active origin
LIB_main_origin_call

Writes G54 for fixture_offset_number 1

1-6 Library commands for Post Configurator


CTRL_SINUMERIK_BASE

LIB_RETURN_move
Purpose Writes return motions to the NC-code. Settings for home motions
(CONF_CTRL_moves return_mode)
are taken into consideration for the output format of the return motions.
Format LIB_RETURN_move <Addresses> <property>

Parameters Addresses

String with space separated axis names that should perform a return move.
Valid options:
X / Y / Z / XY / ZX / ZY or a template name

property

Reserved argument.

Return value None.


Examples Example using axis names
LIB_RETURN_move "Z XY"

Writes return moves for Z and then XY to the NC-code in Sinumerik-Format.


Result will be:
G153 Z99999.9 D0
G153 X99999.9 Y99999.9
Example using template names
LIB_RETURN_move "custom_return_template1 custom_return_template2"

Assuming we have two custom specific block templates


custom_return_template1 and custom_return_template2,
we can call them here by their name. It's okay to mix template names and
axes names (see ex. 1)

Library commands for Post Configurator 1-7


Chapter 2: CTRL_FANUC_BASE

Library commands for Post Configurator 2-1


Chapter
Chapter 2: 2: CTRL_FANUC_BASE
CTRL_FANUC_BASE

LIB_ISV_ini_get_env_dir_info
Purpose This function returns the path, defined with the environment variable
UGII_CAM_CSE_USER_DIR.
If the variable is not set it returns an empty string and displays an information
in the listing window.
Format LIB_ISV_ini_get_env_dir_info <offset_nbr> <create>

Return value String with the value of the environment variable or empty string if not defined.
Examples Example 1
set cse_dir [LIB_ISV_ini_get_env_dir_info]

2-2 Library commands for Post Configurator


CTRL_FANUC_BASE

LIB_ISV_init_ini_files
Purpose This procedure is automatically called in order to define how the ini file for the
cse simulation should be handled.
The following mom variables are to be set with the options for the simulation.ini
file output.
mom_fanuc_ini_create
"Yes" ini files will be created
"No " ini files will not be created

mom_fanuc_ini_location
"Part" ini files will be output to a subfolder \cse_files\subprog
of cam part file location. If \cse_files\subprog does not exist,
post will create this folder.
"CSE" ini files will be output to sub folder \subprog of \cse_driver
folder which is located in same directory of \postprocessor in
the respective machine ki.
"ENV" ini files will be output to a sub folder \subprog in a directory
specified over the environment variable UGII_CAM_CSE_USER_DIR.

mom_fanuc_ini_existing
"Rename" Rename existing ini files in place where the one is created.
"Keep" Keep ini files in place where the one is created.
"Delete" Delete ini files in place where the one is created.

mom_fanuc_ini_end_status
"Rename" Rename created ini file after post run.
"Keep" Keep created ini files after post run.
"Delete" Delete created ini files after post run.
Format LIB_ISV_init_ini_files <offset_nbr> <create>

Return value None.


Examples Example 1
proc LIB_ISV_init_ini_files {} {
global mom_fanuc_ini_create
global mom_fanuc_ini_location
global mom_fanuc_ini_keep_existing
global mom_fanuc_ini_end_status

set mom_fanuc_ini_create "Yes"


set mom_fanuc_ini_location "Part"
set mom_fanuc_ini_existing "Rename"
set mom_fanuc_ini_end_status "Keep"
}

This example will activate the creation of simulation.ini at the same location as
the
partfile. If a simulation.ini file already exists, it will be renamed with a suffix.
The newly created simulation.ini file will be conserved at the end of post
processor

Library commands for Post Configurator 2-3


Chapter
Chapter 2: 2: CTRL_FANUC_BASE
CTRL_FANUC_BASE

LIB_main_origin_call
Purpose Writes the active main origin to the NC-code, provided that the property
[CONF_CTRL_origin use_main] is set to 'On'.
Format LIB_main_origin_call <offset_nbr> <create>

Parameters offset_nbr

Reserved argument.

create

Reserved argument.

Return value
Examples Output active origin
LIB_main_origin_call

Writes G54 for fixture_offset_number 1

2-4 Library commands for Post Configurator


CTRL_FANUC_BASE

LIB_RETURN_move
Purpose Writes return motions to the NC-code. Settings for home motions
(CONF_CTRL_moves return_mode)
are taken into consideration for the output format of the return motions.
Format LIB_RETURN_move <Addresses> <property>

Parameters Addresses

String with space separated axis names that should perform a return move.
Valid options:
X / Y / Z / XY / ZX / ZY or a template name

property

Reserved argument.

Return value None.


Examples Example using axis names
LIB_RETURN_move "Z XY"

Writes return moves for Z and then XY to the NC-code in Fanuc-Format.


Result will be:
G0 G28 G91 Z0.
G0 G28 G91 X0. Y0.
Example using template names
LIB_RETURN_move "custom_return_template1 custom_return_template2"

Assuming we have two custom specific block templates


custom_return_template1 and custom_return_template2,
we can call them here by their name. It's okay to mix template names and
axes names (see ex. 1)

Library commands for Post Configurator 2-5


Chapter 3: CTRL_GENERIC_BASE

Library commands for Post Configurator 3-1


Chapter
Chapter 3: 3: CTRL_GENERIC_BASE
CTRL_GENERIC_BASE

LIB_ISV_ini_get_env_dir_info
Purpose This function returns the path, defined with the environment variable
UGII_CAM_CSE_USER_DIR.
If the variable is not set it returns an empty string and displays an information
in the listing window.
Format LIB_ISV_ini_get_env_dir_info <offset_nbr> <create>

Return value String with the value of the environment variable or empty string if not defined.
Examples Example 1
set cse_dir [LIB_ISV_ini_get_env_dir_info]

3-2 Library commands for Post Configurator


CTRL_GENERIC_BASE

LIB_ISV_init_ini_files
Purpose This procedure is automatically called in order to define how the ini file for the
cse simulation should be handled.
The following mom variables are to be set with the options for the simulation.ini
file output.
mom_fanuc_ini_create
"Yes" ini files will be created
"No " ini files will not be created

mom_fanuc_ini_location
"Part" ini files will be output to a subfolder \cse_files\subprog
of cam part file location. If \cse_files\subprog does not exist,
post will create this folder.
"CSE" ini files will be output to sub folder \subprog of \cse_driver
folder which is located in same directory of \postprocessor in
the respective machine ki.
"ENV" ini files will be output to a sub folder \subprog in a directory
specified over the environment variable UGII_CAM_CSE_USER_DIR.

mom_fanuc_ini_existing
"Rename" Rename existing ini files in place where the one is created.
"Keep" Keep ini files in place where the one is created.
"Delete" Delete ini files in place where the one is created.

mom_fanuc_ini_end_status
"Rename" Rename created ini file after post run.
"Keep" Keep created ini files after post run.
"Delete" Delete created ini files after post run.
Format LIB_ISV_init_ini_files <offset_nbr> <create>

Return value None.


Examples Example 1
proc LIB_ISV_init_ini_files {} {
global mom_fanuc_ini_create
global mom_fanuc_ini_location
global mom_fanuc_ini_keep_existing
global mom_fanuc_ini_end_status

set mom_fanuc_ini_create "Yes"


set mom_fanuc_ini_location "Part"
set mom_fanuc_ini_existing "Rename"
set mom_fanuc_ini_end_status "Keep"
}

This example will activate the creation of simulation.ini at the same location as
the
partfile. If a simulation.ini file already exists, it will be renamed with a suffix.
The newly created simulation.ini file will be conserved at the end of post
processor

Library commands for Post Configurator 3-3


Chapter
Chapter 3: 3: CTRL_GENERIC_BASE
CTRL_GENERIC_BASE

LIB_main_origin_call
Purpose Writes the active main origin to the NC-code, provided that the property
[CONF_CTRL_origin use_main] is set to 'On'.
Format LIB_main_origin_call <offset_nbr> <create>

Parameters offset_nbr

Reserved argument.

create

Reserved argument.

Return value
Examples Output active origin
LIB_main_origin_call

Writes G54 for fixture_offset_number 1

3-4 Library commands for Post Configurator


CTRL_GENERIC_BASE

LIB_RETURN_move
Purpose Writes return motions to the NC-code. Settings for home motions
(CONF_CTRL_moves return_mode)
are taken into consideration for the output format of the return motions.
Format LIB_RETURN_move <Addresses> <property>

Parameters Addresses

String with space separated axis names that should perform a return move.
Valid options:
X / Y / Z / XY / ZX / ZY or a template name

property

Reserved argument.

Return value None.


Examples Example using axis names
LIB_RETURN_move "Z XY"

Writes return moves for Z and then XY to the NC-code.


Result will be:
G0 G28 G91 Z0.
G0 G28 G91 X0. Y0.
Example using template names
LIB_RETURN_move "custom_return_template1 custom_return_template2"

Assuming we have two custom specific block templates


custom_return_template1 and custom_return_template2,
we can call them here by their name. It's okay to mix template names and
axes names (see ex. 1)

Library commands for Post Configurator 3-5


Chapter 4: CTRL_HEIDENHAIN_BASE

Library commands for Post Configurator 4-1


Chapter
Chapter 4: 4: CTRL_HEIDENHAIN_BASE
CTRL_HEIDENHAIN_BASE

LIB_main_origin_call
Purpose Writes the active main origin to the NC-code, provided that the property
[CONF_CTRL_origin use_main] is set to 'On'.
Format LIB_main_origin_call <Addresses> <property>

Return value
Examples Output active origin
LIB_main_origin_call

Writes CYCL DEF 247 .. Q339=1 for fixture_offset_number 1

4-2 Library commands for Post Configurator


CTRL_HEIDENHAIN_BASE

LIB_output_local_zero_offset
Purpose Output the local origin reset and definition only when needed (CYCL DEF 7)
Format LIB_output_local_zero_offset <Addresses> <property>

Return value
Examples

Library commands for Post Configurator 4-3


Chapter
Chapter 4: 4: CTRL_HEIDENHAIN_BASE
CTRL_HEIDENHAIN_BASE

LIB_RETURN_move
Purpose Writes return motions to the NC-code. Settings for home motions
(CONF_CTRL_moves return_mode)
are taken into consideration for the output format of the return motions.
Format LIB_RETURN_move <Addresses> <property>

Parameters Addresses

String with space separated axis names that should perform a return move.
Valid options:
X / Y / Z / XY / ZX / ZY or a template name

property

Reserved argument.

Return value None.


Examples Example using axis names
LIB_RETURN_move "Z XY"

Writes return moves for Z and then XY to the NC-code in Heidenhain-Format.


Result will be:
L Z99999.9 FMAX M91
L X99999.9 Y99999.9 FMAX M91
Example using template names
LIB_RETURN_move "custom_return_template1 custom_return_template2"

Assuming we have two custom specific block templates


custom_return_template1 and custom_return_template2,
we can call them here by their name. It's okay to mix template names and
axes names (see ex. 1)

4-4 Library commands for Post Configurator


CTRL_HEIDENHAIN_BASE

LIB_start_of_program_blk_form
Purpose This function outputs the BLK FORM definition for simulation purposes on the
heidenhain controller.
Default values are -20 inches in XYZ up to +20 inches respectively -500mm up
to +500mm.
Block form may be defined by an UDE with two points. mom_blk_point_1
defines the lower left point while
mom_blk_point_2 defines the upper right point.
The whole procedure may be copied to the service layer for customization
purposes.
Format LIB_start_of_program_blk_form <Addresses> <property>

Return value
Examples Sourcecode for customizing
proc LIB_start_of_program_blk_form {} {
global mom_output_unit
global mom_blk_point_1 mom_blk_point_1
if {$mom_output_unit == "IN"} {
set tmp_blk_point_1(0) -20
set tmp_blk_point_1(1) -20
set tmp_blk_point_1(2) -20
set tmp_blk_point_2(0) +20
set tmp_blk_point_2(1) +20
set tmp_blk_point_2(2) +20
} else {
set tmp_blk_point_1(0) -500
set tmp_blk_point_1(1) -500
set tmp_blk_point_1(2) -500
set tmp_blk_point_2(0) +500
set tmp_blk_point_2(1) +500
set tmp_blk_point_2(2) +500
}
if {[LIB_PT_get_header_var mom_blk_point_1(0) exists]} {
set tmp_blk_point_1(0) [LIB_PT_get_header_var mom_blk_point_1(0)]
set tmp_blk_point_1(1) [LIB_PT_get_header_var mom_blk_point_1(1)]
set tmp_blk_point_1(2) [LIB_PT_get_header_var mom_blk_point_1(2)]
set tmp_blk_point_2(0) [LIB_PT_get_header_var mom_blk_point_2(0)]
set tmp_blk_point_2(1) [LIB_PT_get_header_var mom_blk_point_2(1)]
set tmp_blk_point_2(2) [LIB_PT_get_header_var mom_blk_point_2(2)]
}
MOM_output_literal "BLK FORM 0.1 Z X[format %.f $tmp_blk_point_1(
MOM_output_literal "BLK FORM 0.2 X[format %.f $tmp_blk_point_2(0)
}

Copy and modify if necessary.

Library commands for Post Configurator 4-5


Chapter 5: CTRL_OKUMA_BASE

Library commands for Post Configurator 5-1


Chapter
Chapter 5: 5: CTRL_OKUMA_BASE
CTRL_OKUMA_BASE

LIB_ISV_ini_get_env_dir_info
Purpose This function returns the path, defined with the environment variable
UGII_CAM_CSE_USER_DIR.
If the variable is not set it returns an empty string and displays an information
in the listing window.
Format LIB_ISV_ini_get_env_dir_info <offset_nbr> <create>

Return value String with the value of the environment variable or empty string if not defined.
Examples Example 1
set cse_dir [LIB_ISV_ini_get_env_dir_info]

5-2 Library commands for Post Configurator


CTRL_OKUMA_BASE

LIB_ISV_init_ini_files
Purpose This procedure is automatically called in order to define how the ini file for the
cse simulation should be handled.
The following mom variables are to be set with the options for the simulation.ini
file output.
mom_fanuc_ini_create
"Yes" ini files will be created
"No " ini files will not be created

mom_okuma_ini_location
"Part" ini files will be output to a subfolder \cse_files\subprog
of cam part file location. If \cse_files\subprog does not exist,
post will create this folder.
"CSE" ini files will be output to sub folder \subprog of \cse_driver
folder which is located in same directory of \postprocessor in
the respective machine ki.
"ENV" ini files will be output to a sub folder \subprog in a directory
specified over the environment variable UGII_CAM_CSE_USER_DIR.

mom_okuma_ini_existing
"Rename" Rename existing ini files in place where the one is created.
"Keep" Keep ini files in place where the one is created.
"Delete" Delete ini files in place where the one is created.

mom_okuma_ini_end_status
"Rename" Rename created ini file after post run.
"Keep" Keep created ini files after post run.
"Delete" Delete created ini files after post run.
Format LIB_ISV_init_ini_files <offset_nbr> <create>

Return value None.


Examples Example 1
proc LIB_ISV_init_ini_files {} {
global mom_okuma_ini_create
global mom_okuma_ini_location
global mom_okuma_ini_keep_existing
global mom_okuma_ini_end_status

set mom_okuma_ini_create "Yes"


set mom_okuma_ini_location "Part"
set mom_okuma_ini_existing "Rename"
set mom_okuma_ini_end_status "Keep"
}

This example will activate the creation of simulation.ini at the same location as
the
partfile. If a simulation.ini file already exists, it will be renamed with a suffix.
The newly created simulation.ini file will be conserved at the end of post
processor

Library commands for Post Configurator 5-3


Chapter
Chapter 5: 5: CTRL_OKUMA_BASE
CTRL_OKUMA_BASE

LIB_main_origin_call
Purpose Writes the active main origin to the NC-code, provided that the property
[CONF_CTRL_origin use_main] is set to 'On'.
Format LIB_main_origin_call <offset_nbr> <create>

Parameters offset_nbr

Reserved argument.

create

Reserved argument.

Return value
Examples Output active origin
LIB_main_origin_call

Writes G54 for fixture_offset_number 1

5-4 Library commands for Post Configurator


CTRL_OKUMA_BASE

LIB_RETURN_move
Purpose Writes return motions to the NC-code. Settings for home motions
(CONF_CTRL_moves return_mode)
are taken into consideration for the output format of the return motions.
Format LIB_RETURN_move <Addresses> <property>

Parameters Addresses

String with space separated axis names that should perform a return move.
Valid options:
X / Y / Z / XY / ZX / ZY or a template name

property

Reserved argument.

Return value None.


Examples Example using axis names
LIB_RETURN_move "Z XY"

Writes return moves for Z and then XY to the NC-code in Okuma-Format.


Result will be:
G0 G30 G91 Z0.
G30 X0. Y0.
Example using template names
LIB_RETURN_move "custom_return_template1 custom_return_template2"

Assuming we have two custom specific block templates


custom_return_template1 and custom_return_template2,
we can call them here by their name. It's okay to mix template names and
axes names (see ex. 1)

Library commands for Post Configurator 5-5


Chapter 6: LIB_DOCUMENT

Library commands for Post Configurator 6-1


Chapter
Chapter 6: 6: LIB_DOCUMENT
LIB_DOCUMENT

LIB_DC_check_variable
Purpose Checks if a given expression is an existing variable and gives back its current
value.
If it is not an existing variable it gives back the defaulttext
Format LIB_DC_check_variable <variable> <defaulttext>

Parameters variable

Name of a variable.

defaulttext

value that should be returned if a variable is not existing or not set.

Return value value of the variable respectively defaulttext


Examples Example 1
set variable [LIB_DC_check_variable mom_path_name "It's empty"]

variable will have the current value of mom_path_name

6-2 Library commands for Post Configurator


LIB_DOCUMENT

LIB_DC_complete_formatline
Purpose Formats a string with repeated characters at a given number.
This proc is mainly used by "LIB_DC_complete_formatline".
You may use this proc to easyly format a line like "==========".
The full strength of this proc is to format more complex strings, by
giving string lists as input argument.
The searchstring has to be defined in the following format:
"character-number of repetition-character".
Format LIB_DC_complete_formatline <string> <character>

Parameters string

String or string list in the requested format for each element


(character-number-character)

character

characters to be considered for repetitions in the string (list)

Return value formated string.


Examples Simple example
set result [LIB_DC_complete_formatline "=10=" "="]

considers the character '=' in the string and repeats it 10 times.


The result will be '=========='
Complex example
set formatline "| <3< : <5< <10< : >4> 5 |"
set variable [LIB_DC_complete_formatline $formatline [list "<" ">

considers the characters '<', '>' and ' ' in the string list and substitutes
the string like defined.
The result will be '| <<< : <<<<< <<<<<<<<<< : >>>> |'

Library commands for Post Configurator 6-3


Chapter
Chapter 6: 6: LIB_DOCUMENT
LIB_DOCUMENT

LIB_DC_ellipsis_character
Purpose This function generates a shortened representation of a given string. It is
mostly used for
displaying long filenames and paths.
Format LIB_DC_ellipsis_character <string> <length> <postion> <placeholder>
Parameters string

String to be shortened.

length

Maximum length to be displayed.

postion

Position where the string shpild be shortened.


Valid arguments are:
start - shortens at the start of the string
end - shortens at the end of the string
middle - shortens in the middle of the string
middlepath - shortens near the middle of the string in order to have the
best path representation as possible
This argument is optional. Default value is 'middlepath'

placeholder

Character(s) used for the shortened part.


This argument is optional. Default value is '...'

Return value
Examples Example 1
set result [LIB_DC_ellipsis_character 123456789012345678901234567

result = ...45678901234567890
Example 2
set result [LIB_DC_ellipsis_character 123456789012345678901234567

result = 1234567890123456....
Example 3
set result [LIB_DC_ellipsis_character 123456789012345678901234567

result = 12345678xxxx34567890
Example 4
set result [LIB_DC_ellipsis_character "C:\NextGeneration\custom\l

result = C:\NextGeneration\cu...\Libraries\lib_standard_post_func.pce
Example 5

6-4 Library commands for Post Configurator


LIB_DOCUMENT

set result [LIB_DC_ellipsis_character "C:\NextGeneration\custom\l

result = ...ibraries\lib_standard_post_func.pce

Library commands for Post Configurator 6-5


Chapter
Chapter 6: 6: LIB_DOCUMENT
LIB_DOCUMENT

LIB_DC_escape_string
Purpose This function escapes an input string in order to be further used in tcl language
Format LIB_DC_escape_string <arg1>

Parameters arg1

input string

Return value escaped string


Examples Example1
set result [LIB_DC_escape_string {This [is] (the) {special} $test

result = "This \[is\] \(the\) \{special\} \$test"

6-6 Library commands for Post Configurator


LIB_DOCUMENT

LIB_DC_format_string
Purpose Formats a string according to a given pattern witch describes columns. It
defines the length of an
string element per column, the alignment and also separators between
columns.
Format LIB_DC_format_string <string> <character> <ellipsis>

Parameters string

Format string according the following rules


example: | >>>> __ <<<< +++ <<< |
where '|' '__' '+++' are characters which wil be used as they are
'>>>>' format of first text - right alignement (alignement character must
match with [CONF_DC_settings left_justify])
'<<<<' format of second text - left alignement justification (alignement
character must match with [CONF_DC_settings right_justify])
textstrings will be truncated if they are longer than the according format
string

character

String list with text to be filled in the format string.

Return value formatted string


Examples Example 1
set returnvalue [LIB_DC_format_string "<<<<< <<<<< >>>>>" [list "

returns "Text 1.123 mm"


Column output
set returnvalue [LIB_DC_format_string "| T<<<< | D<< | <<<<<<<<<<

returns "| T102 | D1 | Milling Tool |"

Library commands for Post Configurator 6-7


Chapter
Chapter 6: 6: LIB_DOCUMENT
LIB_DOCUMENT

LIB_DC_time_format
Purpose Formats minute values into time format hh:min:sec
Format LIB_DC_time_format <arg1>

Parameters arg1

input value in minutes

Return value formatted time string


Examples 59 minutes
set timeval [LIB_DC_time_format "59"]

timeval = 00:59:00
125 minutes
set timeval [LIB_DC_time_format "125"]

timeval = 02:05:00
almost a day
set timeval [LIB_DC_time_format "7199.5"]

timeval = 23:59:30

6-8 Library commands for Post Configurator


Chapter 7: LIB_FILE_HANDLING

Library commands for Post Configurator 7-1


Chapter
Chapter 7: 7: LIB_FILE_HANDLING
LIB_FILE_HANDLING

LIB_FH_cleanup_directory
Purpose Deletes all files in a given directory.
Format LIB_FH_cleanup_directory <directory> <expression>

Parameters directory

The full path name to the directory to be cleaned up. Windows and UNIX
formats are supported.

expression

The file mask. All matching files will be deleted.

Return value None.


Examples Example 1
LIB_FH_cleanup_directory "H:\Pool\" "*.osd"

deletes all files with filemask *.osd in H:\Pool (note: don't forget to escape
backslashes).
Example 2
LIB_FH_cleanup_directory "C:/Temp/mydir" "*"

deletes all files in C:\Temp\mydir (note: here we use UNIX directory format and
don't need to escape the backslashes).

7-2 Library commands for Post Configurator


LIB_FILE_HANDLING

LIB_FH_create_directory
Purpose Creates a new directory if it's not yet existing.
Directory can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash)).
Format LIB_FH_create_directory <directory>

Parameters directory

directory (full pathname) to be created.

Return value 0 - directory created or already existing


1 - error
Examples Example 1
set error [LIB_FH_create_directory "C:\Temp\Test\"]

error will be 0 if C:\Temp\Test could be created.


Example 2
set error [LIB_FH_create_directory "C:/Temp/Test"]

error will be 0 if C:\Temp\Test could be created.

Library commands for Post Configurator 7-3


Chapter
Chapter 7: 7: LIB_FILE_HANDLING
LIB_FILE_HANDLING

LIB_FH_create_file
Purpose Creates a textfile with a given directory and filename. A given variable or list
will be written in the textfile.
Format LIB_FH_create_file <filename> <fileoption> <filebody>

Parameters filename

Filename (full pathname, filename, extension) to be created.


Filename can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash))

fileoption

option argument for the creation of the file, derived from the standard tcl
open command.
w Open the file for writing only. Truncate it if it exists. If it does not exist,
create a new file.
w+ Open the file for reading and writing. Truncate it if it exists. If it does
not exist, create a new file.
a Open the file for writing only. If the file does not exist, create a new
empty file. Set the file pointer to the end of the file prior to each write.
a+ Open the file for reading and writing. If the file does not exist, create a
new empty file. Set the initial access position to the end of the file.
This argument is optional. Default value is 'w+'

filebody

text to be written in the file. If you specify a list, each list element will be
written to a new line.

Return value None.


Examples Example 1
LIB_FH_create_file "C:\Temp\Test.txt" "w+" "This is text..."

Example 2
LIB_FH_create_file "C:/Temp/Test.txt" "a" [list "line 1" "line 2"

Example 3
LIB_FH_create_file "C:/Temp/emptyfile.txt"

7-4 Library commands for Post Configurator


LIB_FILE_HANDLING

LIB_FH_escape_special_characters
Purpose This function escapes special characters
Format LIB_FH_escape_special_characters <output>

Parameters output

String where special characters should be escaped.

Return value escaped string.


Examples Example 1
set result [LIB_FH_escape_special_characters {This string contain

result will be:


This string contains \[special\] characters\@xmldoc_example_descr@quot;

Library commands for Post Configurator 7-5


Chapter
Chapter 7: 7: LIB_FILE_HANDLING
LIB_FILE_HANDLING

LIB_FH_file_to_list
Purpose This function reads a textfile into a string list.
The function can be used safely as it opens and closes the textfile automatically
and provides
errorhandling.
Format LIB_FH_file_to_list <filename> <filename_to_list> <apportion>

Parameters filename

Filename (full pathname, filename, extension) to be read.


Filename can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash))

filename_to_list

Reserved option.
If this option is specified, the function adds the filename of the textfile to
the string list named with this option.
This may be useful to collect the names of all files that have been
accessed.

apportion

By default this function splits lines at every linebreak '\n'


If you set this option to zero, the returning list will be a single line.
This argument is optional. Default value is '1'

Return value
Examples Example 1
set filelist [LIB_FH_file_to_list C:\Temp\Test.txt]

7-6 Library commands for Post Configurator


LIB_FILE_HANDLING

LIB_FH_file_to_list_line_numbers
Purpose This function reads a textfile into a string list with a maximum of 'counter' lines.
This is the same function as LIB_FH_file_to_list, with the option to specify the
number of lines to be read.
Format LIB_FH_file_to_list_line_numbers <filename> <counter>

Parameters filename

Filename (full pathname, filename, extension) to be read.


Filename can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash))

counter

Number of lines to be read.

Return value
Examples Example 1
set filelist [LIB_FH_file_to_list_line_numbers C:\Temp\Test.txt 1

Library commands for Post Configurator 7-7


Chapter
Chapter 7: 7: LIB_FILE_HANDLING
LIB_FILE_HANDLING

LIB_FH_file_writable
Purpose This function checks if a given file is writable or not.
Format LIB_FH_file_writable <file>

Parameters file

Full filename (directory, path, filename and extension) to be checked.


Filename can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash))

Return value 1 - if the file is writable.


0 - if the file is not writable (e.g. set to readonly)
Examples Example 1
set status [LIB_FH_file_writable C:\Temp\Test.txt]

7-8 Library commands for Post Configurator


LIB_FILE_HANDLING

LIB_FH_format_database
Purpose This function formats the lines in a given .dat file to be exactly aligned per each
column.
The formatted lines are returned as string list. Optionally the dat file can be
updated
directly with the formatted lines.
Format LIB_FH_format_database <filename> <overwrite>

Parameters filename

complete filename with path of the dat file which should be formatted.

overwrite

if this option is set, the dat file will be updated with the formatted lines.
This argument is optional. Default value is '0'

Return value String list containing the formatted dat file.


Examples format machine_database file
set curr_mac_db [file join [MOM_ask_env_var UGII_CAM_LIBRARY_MACH
set machine_db [LIB_FH_format_database $curr_mac_db 1]

this command formats the corrend machine_database.dat file and updates it.

Library commands for Post Configurator 7-9


Chapter
Chapter 7: 7: LIB_FILE_HANDLING
LIB_FILE_HANDLING

LIB_FH_list_to_file
Purpose This function writes the entry of a given string list to a text file.
Format LIB_FH_list_to_file <list> <filename> <fileoption>

Parameters list

string list to be written in the text file.

filename

Filename (full pathname, filename, extension) to be written.


Filename can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash))

fileoption

option argument for the creation of the file, derived from the standard tcl
open command.
w Open the file for writing only. Truncate it if it exists. If it does not exist,
create a new file.
w+ Open the file for reading and writing. Truncate it if it exists. If it does
not exist, create a new file.
a Open the file for writing only. If the file does not exist, create a new
empty file. Set the file pointer to the end of the file prior to each write.
a+ Open the file for reading and writing. If the file does not exist, create a
new empty file. Set the initial access position to the end of the file.
This argument is optional. Default value is 'w+'

Return value None.


Examples Example 1
LIB_FH_list_to_file $content "C:\Temp\Test.txt"

7-10 Library commands for Post Configurator


LIB_FILE_HANDLING

LIB_FH_open_file
Purpose This function creates a new or opens an existing file, specified with the
argument 'name'
using the tcl command 'open' and the specified file access type.
After this command, the function LIB_FH_output_literal writes directly to this
file.
The file will automatically be closed at the end of the post processor run.
Format LIB_FH_open_file <name> <access>

Parameters name

Filename (full pathname, filename, extension) to be created.


Filename can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash))
fileoption
option argument for the creation of the file, derived from the standard tcl
open command.
w Open the file for writing only. Truncate it if it exists. If it does not exist,
create a new file.
w+ Open the file for reading and writing. Truncate it if it exists. If it does
not exist, create a new file.
a Open the file for writing only. If the file does not exist, create a new
empty file. Set the file pointer to the end of the file prior to each write.
a+ Open the file for reading and writing. If the file does not exist, create a
new empty file. Set the initial access position to the end of the file.

Return value fileid of the opened file. This id is not important when using
LIB_FH_output_literal
Examples create new file
LIB_FH_open_file d:\tmp\sub_prog.spf w+

creates a new file sub_prog.spf and opens it for write access


create new file and write to it
LIB_FH_open_file d:/tmp/newfile.txt w+
LIB_FH_output_literal "this text goes into the txt file"

creates a new file newfile.txt, opens it for write access and writes to it.

Library commands for Post Configurator 7-11


Chapter
Chapter 7: 7: LIB_FILE_HANDLING
LIB_FILE_HANDLING

LIB_FH_output_literal
Purpose This function writes text to the last file which was opened by LIB_FH_open_file.
See there for more information.
Format LIB_FH_output_literal <output>

Parameters output

Text to be added to the last opened file.

Return value None.


Examples Example 1
LIB_FH_output_literal "write this line to a file"

7-12 Library commands for Post Configurator


LIB_FILE_HANDLING

LIB_FH_reverse_escape_special_characters
Purpose This function reverses escaped strings back to special characters.
It is the opposite function to LIB_FH_escape_special_characters.
Format LIB_FH_reverse_escape_special_characters <output>

Parameters output

String where escaped characters should be reversed to special characters.

Return value string with special characters.


Examples Example 1
set result [LIB_FH_reverse_escape_special_characters {This string

result will be:


This string contains [special] characters"

Library commands for Post Configurator 7-13


Chapter
Chapter 7: 7: LIB_FILE_HANDLING
LIB_FILE_HANDLING

LIB_FH_search_file_glob
Purpose This function searches for a file in a given directory, using globstyle search.
This means that the filename can be specified with wildcards (*).
The first match is returned.
Format LIB_FH_search_file_glob <pathname> <filename> <resultname>

Parameters pathname

Directory and pathname where the file should be searched.


Pathname can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash))

filename

Filename and Extension to be searched for. May be specified in globstyle.

resultname

Variablename where the match should be stored.

Return value 0 - nothing found


1 - file matching the glob style has been found.
Examples Check if .tmp files exist
set result [LIB_FH_search_file_glob C:\Temp\ *.tmp resultname]

result will be 1 if there is at least one .tmp file in the given directory.
Search for a nc file
set result [LIB_FH_search_file_glob d:/ncfiles/ O12*.nc resultnam

result will be 1 if there is a .nc file beginning with O12 in the given directory.
The variable resultname will hold the full path and name of the nc file.

7-14 Library commands for Post Configurator


LIB_FILE_HANDLING

LIB_FH_search_path_recursively
Purpose This function iterates through subdirectories, starting at a given path and gives
back
a list of all found sub directories.
Format LIB_FH_search_path_recursively <folders> <dirs>

Parameters folders

The full path name of the start directory for the search.

dirs

not used.
This argument is optional. Default value is '.'

Return value String list.


Examples Example 1
set directories [LIB_FH_search_path_recursively "D:/Temp/Test"]

returns: D:/Temp/Test D:/Temp/Test/Functions D:/Temp/Test/Librarys


D:/Temp/Test/Librarys/Test

Library commands for Post Configurator 7-15


Chapter 8: LIB_GENERAL

Library commands for Post Configurator 8-1


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_CONF_do_prop_custom_proc
Purpose This function is used to execute a proc body stored in a CONFIG objects
property
(e.g. defined in a COMMANDBLOCK object in PostConfigurator UI)
Format LIB_CONF_do_prop_custom_proc <obj> <prop> <special_syntax> <start_in

Parameters obj

Name of CONF-object

prop

Property in question

special_syntax

Currently only "short_template_syntax" supported.


This is used in MOM_tool_change_LIB to support "legacy" customisation
only containing template names
without the command call 'MOM_do_template'

start_index

If not not all the contents of the property in question should be interpreted
as proc body, define the list index
where proc body starts (used to support "legacy" customisation in
'LIB_return_move')
This argument is optional. Default value is '0'

Return value None.


Examples Example 1
LIB_CONF_do_prop_custom_proc CONF_CTRL_setting header_name

8-2 Library commands for Post Configurator


LIB_GENERAL

LIB_CONF_prop_custom_proc_body
Purpose This function allows to define a custom proc for a CONFIG-property directly in
the tcl script.
If defining the custom proc with the use of this function, the contents of the
custom proc will properly be showed in
the PostConfigurator UI
Format LIB_CONF_prop_custom_proc_body <code>

Parameters code

Body of the custom proc

Return value Correctly formatted code to be set for a specific property.


Examples Example
CONF_CTRL_tool set auto_change_template [LIB_CONF_prop_custom_pro
{

global mom_tool_number
if {$mom_tool_number > 1000} {
LIB_GE_message "This is a big tool number"
} else {
LIB_GE_message "This is a small tool number"
}
MOM_do_template tool_change
}
]

Auto change template is set to the given Tcl-code.

Library commands for Post Configurator 8-3


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_abort_message
Purpose Issues an abort message that causes the post processing to stop. A dialog
box will be displayed.
Note: the message is formatted with PostConfigurator internal functions and
may contain text
to be translated (see LIB_GE_MSG). The setting from [CONF_GE_msg
comment_case] will also
be applied before showing the message dialog.

Format LIB_GE_abort_message <msg1> <msg2> <option> <translation> <force>

Parameters msg1

Error message to be displayed.

msg2

First line (title) for the dialog box.

option

Type of the message. This will influence the displayed icon of the dialog
box.
Valid options are:
ERROR, INFORMATION, QUESTION or WARNING
This argument is optional. Default value is 'ERROR'

translation

If set to 1 (default), messages are being translated before displaying them.


See LIB_GE_MSG.
This argument is optional. Default value is '1'

force

Reserved.
This argument is optional. Default value is '0'

Return value None.

Examples Example with translation


LIB_GE_abort_message "File INS->$datafile<- not found" "Please ve

File not found will be translated and a warning message will be displayed.

Example 2
LIB_GE_abort_message "Post processing will stop now" "It's too la

An information message will be displayed.

8-4 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_ask_type_subtype
Purpose This function returns the tag, type and subtype of a given path_name.
Format LIB_GE_ask_type_subtype <path_name> <tag> <type> <subtype>
Parameters path_name

Name of the path to query.

tag

Variable name where the tag should be stored.

type

Variable name where the type should be stored.

subtype

Variable name where the subtype should be stored.

Return value TYPE 100 = machining operation

SUBTYPE 1 = mach instanced oper


SUBTYPE 2 = mach orphan oper
SUBTYPE 10 = mach oldopr
SUBTYPE 11 = mach mill post cmnds
SUBTYPE 13 = mach lathe post cmnds
SUBTYPE 17 = mach wed post cmnds
SUBTYPE 110 = mach pocket
SUBTYPE 210 = mach surface contour
SUBTYPE 211 = mach vasc
SUBTYPE 220 = mach gssm main op
SUBTYPE 221 = mach gssm sub op
SUBTYPE 222 = mach gssm grip
SUBTYPE 230 = mach param line
SUBTYPE 240 = mach zig zag surf
SUBTYPE 250 = mach rough to depth
SUBTYPE 260 = mach cavity milling
SUBTYPE 261 = mach face milling
SUBTYPE 262 = mach volumn milling
SUBTYPE 263 = mach zlevel milling
SUBTYPE 264 = mach fb hole milling
SUBTYPE 265 = mach plunge milling
SUBTYPE 266 = mach vazl milling
SUBTYPE 310 = mach lathe rough
SUBTYPE 320 = mach lathe finish
SUBTYPE 330 = mach lathe groove
SUBTYPE 340 = mach lathe thread
SUBTYPE 350 = mach drill
SUBTYPE 360 = mach lathe face
SUBTYPE 450 = mach point to point
SUBTYPE 460 = mach seq curve mill

Library commands for Post Configurator 8-5


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

SUBTYPE 461 = mach seq curve lathe


SUBTYPE 510 = mach turn rough
SUBTYPE 520 = mach turn finish
SUBTYPE 530 = mach turn teachmode
SUBTYPE 540 = mach turn thread
SUBTYPE 550 = mach turn cdrill
SUBTYPE 560 = mach turn auxiliary
SUBTYPE 600 = mach hole making
SUBTYPE 700 = mach wedm
SUBTYPE 800 = mach mill ud
SUBTYPE 900 = mach gmc
SUBTYPE 1000 = mach probing
SUBTYPE 1100 = mach mill mc
SUBTYPE 1200 = mach lathe mc
SUBTYPE 1300 = mach wedm mc
SUBTYPE 1400 = mach lathe ud
SUBTYPE 1500 = mach wedm ud
SUBTYPE 1600 = mach mass edit
SUBTYPE 1700 = mach thread milling
SUBTYPE 1800 = insp tolerance
SUBTYPE 1900 = insp path
SUBTYPE 2000 = insp output
SUBTYPE 2100 = insp misc
SUBTYPE 2200 = insp align
SUBTYPE 2300 = insp sensor
SUBTYPE 2400 = insp construct
SUBTYPE 2500 = insp bounding feature
SUBTYPE 2600 = insp feature
SUBTYPE 2700 = mach cylinder milling subtype
SUBTYPE 2800 = mach canned cycle subtype
SUBTYPE 2900 = mach laser teachmode subtype
SUBTYPE 3000 = mach hole drilling subtype
SUBTYPE 3100 = mach groove milling subtype
SUBTYPE 3200 = mach chamfer milling subtype
SUBTYPE 3300 = mach radial groove milling subtype
Examples Example 1
set error [LIB_GE_ask_type_subtype $mom_path_name tag type subtyp

8-6 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_cleanup_list
Purpose This function filters all duplicates from a list and returns the adjusted list.
Format LIB_GE_cleanup_list <list> <newlist> <remove>

Parameters list

String list to be cleaned up.

newlist

Optionally the name of an existing string list can be specified. If so, the
new list will
be merged into this list by checking duplicates in both lists.

remove

When specifying an existing string list, this option tells the function either
to remove
duplicates from the existing list or not.
This argument is optional. Default value is '0'

Return value Adjusted string list


Examples Example 1
result will be: car train plane bike boat
set mylist [list car train plane bike car boat]
set result [LIB_GE_cleanup_list $mylist]

Example 2
result will be: car train plane bike car boat helicopter
set oldlist [list car train plane bike car boat]
set newlist [list helicopter plane]
set result [LIB_GE_cleanup_list $newlist $oldlist]

Example 3
result will be: helicopter
(with option '1' we are removing elements from $newlist. As plane is
already in $oldlist, the result is 'helicopter').
set oldlist [list car train plane bike car boat]
set newlist [list helicopter plane]
set result [LIB_GE_cleanup_list $oldlist $newlist 1]

Library commands for Post Configurator 8-7


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_command_buffer
Purpose This function is a very powerful command for expert post developers, allowing
programmers
to easyly modify output sequences. Please see 'LIB_GE_command_buffer_seq'
to understand how
sequences can be modified.
In order to use LIB_GE_command_buffer_seq, code sequences have to be
exported with this
command 'LIB_GE_command_buffer' and 'LIB_GE_command_buffer_output'.

This proc can be called in 2 ways

LIB_GE_command_buffer section_name
–> if called with one argument, the argument is the name of the following code
section

LIB_GE_command_buffer command tag


–> if called with two arguments first one is the command to buffer, second one
is a tag/identifier
for that command. The tag always starts with "@"

the combination of
*the name of the Calling proc
*name of current section
*tag name
HAS TO BE UNIQUE!!

When this command is called in a proc at the end of that proc


LIB_GE_command_buffer_output has to be called
Format LIB_GE_command_buffer <args>
Parameters args

section_name
or
command tag

Return value
Examples Example 1
LIB_GE_command_buffer TRANS_ROT
--> This call indicates the start of the code section named "TRAN

LIB_GE_command_buffer {MOM_do_template rapid_rotary} @RAPID_ROTAR


--> This call assigns the "tag" @RAPID_ROTARY to the command {MOM

LIB_GE_command_buffer_output
--> This call terminates the buffering of the section named "TRAN

From now on the code in the tag '@RAPID_ROTARY' is evaluated out of the
buffer and can be moved easyly.

8-8 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_command_buffer_output
Purpose This function is a very powerful command for expert post developers, allowing
programmers
to easyly modify output sequences. Please see 'LIB_GE_command_buffer_seq'
to understand how
sequences can be modified.
'LIB_GE_command_buffer_output' closes the definition of sequences (set by
LIB_GE_command_buffer)
and outputs them.
Format LIB_GE_command_buffer_output <args>

Return value
Examples Example 1
see LIB_GE_command_buffer

Library commands for Post Configurator 8-9


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_command_buffer_seq
Purpose This function is a very powerful command, allowing programmers to easyly
modify output sequences.
'LIB_GE_command_buffer_seq' he procedure allows to resequence, remove
elements, add new elements

args:
proc_name: name of the proc which generates the output
section_name: name of the output section in the proc in question
command_list: list of commands to output in the right order
command_list elements can be:
*command tag: @xxxxxx (see LIB_GE_command_buffer)
@DEFAULT (use this to keep all the default output and only add your
modification
before or afterthis default output.
This has the advantage that you don't have to define all the TAGs of the default
case
and, even more important, you still get enhancements from default
implementation without
adding manually new TAGs)
*any TCL/MOM command
Format LIB_GE_command_buffer_seq <proc_name> <section_name> <command_list>

Return value
Examples Example 1
LIB_GE_command_buffer_seq LIB_CSYS_plane_output_init TRANS_ROT {@

8-10 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_comment_convert
Purpose This function converts a text in the desired format for comment output to the
NC-code.
The desired format is controlled with the properties [CONF_GE_msg
comment_case] (convert
to upper or lower case) and
[CONF_GE_msg comment_replace_character] (replace special characters).
Format LIB_GE_comment_convert <comment>

Parameters comment

String to be output as comment.

Return value Formatted string.


Examples Example 1
set variable [LIB_GE_comment_convert "comment"]

Library commands for Post Configurator 8-11


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_CONF_add_chain
Purpose This function allows you to define chains.
Format LIB_GE_CONF_add_chain <chain_id> <ui_name> <ui_descr> <ui_sequence>

Parameters chain_id

id of the chain

ui_name

ui name of the chain

ui_descr

ui description of the chain

ui_sequence

positon of the chain in the chain list

Return value None.


Examples Example 1
LIB_GE_CONF_add_chain test_chain "Test Chain" "Description of Tes

8-12 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_CONF_set_property_access
Purpose This function allows to set the 'access' for a given property in a given
CONF-object
for a given license level

(only 'downgrading' the access level is permitted, this means the access level,
for each individual license level,
can only decrease compared to the level in the initial CONF-object definition)
Format LIB_GE_CONF_set_property_access <object> <properties> <licenses> <ac

Parameters object

Name of the CONF object

properties

Name(s) of the properties for which you want to set the access levels.
You may give a single property, a list of properties or 'ALL' to set all
properties of the respective CONF object.

licenses

License level(s) for which you want to set the access.


Valid options are: BASIC , ADVANCED, FULL or any combination of those
options (list)

access_code

Access level to be set. Valid options are: HIDE, READONLY, WRITE

forceSet

Reserved.
This argument is optional. Default value is '0'

Return value None.


Examples Example 1
LIB_GE_CONF_set_property_access CONF_GE_msg date_format "BASIC AD

Example 2
LIB_GE_CONF_set_property_access CONF_GE_msg "time_format date_for

Example 3
LIB_GE_CONF_set_property_access CONF_GE_msg all "BASIC" HIDE

this will hide all the properties and therefore the entire CONF-object
Example 4
LIB_GE_CONF_set_property_access CONF_GE_msg all "BASIC" WRITE

Library commands for Post Configurator 8-13


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

this can be used to reset to default. (access level of each property will be set
to the highest allowed level)

8-14 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_CONF_set_property_datatype
Purpose This allows to set 'datatype' attribute of a given property in a given CONF-object
Format LIB_GE_CONF_set_property_datatype <object> <property> <datatype> <fo

Parameters object

Name of the CONF object

property

Name of the property in question

datatype

Datatype to set for the property in question

forceSet

Reserved.
This argument is optional. Default value is '0'

Return value None.


Examples Example 1
LIB_GE_CONF_set_property_datatype CONF_GCode_Setting mom_sys_rapi

Library commands for Post Configurator 8-15


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_CONF_set_property_options
Purpose This function allows to manipulate the displayed options of a given options
property in a given CONF-object
You can add/insert new options or remove existing ones.
(It is in potwriters responsibility that the action to a new option is implemented
in the code).
Format LIB_GE_CONF_set_property_options <object> <property> <operation> <op

Parameters object

Name of the CONF object

property

Name of the property in question

operation

'remove' or 'insert'

opt_id

Id of the option to treat (to be removed or to be inserted)

opt_name

Ui name for new option (only if the option for 'operation' is 'insert')

pos

Zero-based position index for property to be inserted (only if the option for
'operation' is 'insert')
This argument is optional. Default value is 'end'

forceSet

Reserved.
This argument is optional. Default value is '0'

Return value None.

8-16 Library commands for Post Configurator


LIB_GENERAL

Examples Example 1
LIB_GE_CONF_set_property_options CONF_S840D_controller sinumerik_

remove the option 'Powerline' from property CONF_S840D_controller


sinumerik_control_version
Example 2
LIB_GE_CONF_set_property_options CONF_S840D_controller sinumerik_

add the removed options in a differnet position (in this case start of the list)
Example 3
LIB_GE_CONF_set_property_options CONF_S840D_controller sinumerik_

add option 'Jack' to 3th position of option list. UI name of that option will be
'Black Jack'
Example
LIB_GE_CONF_set_property_options KinContainer_MTB mom_kin_machine
LIB_GE_CONF_set_property_options KinContainer_MTB mom_kin_machine

remove wedm options from mom_kin_machine_type options list

Library commands for Post Configurator 8-17


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_CONF_set_property_ui
Purpose This function allows to set 'ui_parent' and 'ui_sequence' attribute of a given
property in a given CONF-object
Important to know:
This can be used to reorder common properties and UI_TREE properties as
well.
Therefore you are also able to e.g. reattach an entire group to a different
branch of UI - tree
Note: to know the ui element ID's to reference as parent, you can switch
property 'Show element IDs in UI' to ON
(only available with 'full' license). The name will be displayed next to the node
name (*NodeID = ....)
Format LIB_GE_CONF_set_property_ui <object> <property> <parent> <seq> <forc

Parameters object

Name of the CONF object

property

Name of the property in question

parent

ui_parent name of object to which the property in question should be


attached

seq

ui_sequence to be set

forceSet

Reserved.
This argument is optional. Default value is '0'

Return value None.


Examples Example 1
LIB_GE_CONF_set_property_ui CONF_GE_msg date_format @CUI_CtrlVers

8-18 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_copy_var_range
Purpose This function copies a whole range of global variables (scalars and arrays),
identified by a prefix,
to a new range of variables.
The new range of variable will be named based on a defined prefix.
Format LIB_GE_copy_var_range <to_var_prefix> <from_var_prefix>

Parameters to_var_prefix

Prefix to add to the copied mom_variables.

from_var_prefix

Prefix identifying the mom_variables to be copied.

Return value None.


Examples Example 1
LIB_GE_copy_var_range kin_rot1 mom_kin_4th

This will copy all the variables of pattern "mom_kin_4th*" to variables of pattern
"kin_rot1*"
e.g.
mom_kin_4th_axis_ang_offset to kin_rot1_axis_ang_offset
mom_kin_4th_axis_center_offset(0) to kin_rot1_axis_center_offset(0)

Library commands for Post Configurator 8-19


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_date
Purpose This function returns 'date' as formated string, respecting the date format
defined in
the property [CONF_GE_msg date_format].
Format LIB_GE_date <date>

Parameters date

Date in seconds since Thu Jan 01 01:00:01 CET 1970 (see ). If no value is
given, the current time will be returned.
This argument is optional. Default value is '0'

Return value Formatted date.


Examples Example 1
MOM_output_literal "(it is now: [LIB_GE_date])"

8-20 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_delayed_output_message
Purpose This function gives programmer the opportunity to engage themselve
something over inserts
to an specific event, what ever he need. It is only possible to execute the next
following
event by name.

LIB_GE_delayed_output_message <EVENT> <TEXT> <OPT: POSITION


(start/end)> <OPT: OUTPUTSTYLE>

Following options are available

With "create" the value will be returned, with "output" a MOM_output_literal is


executed

create_0 = variable is returned directly


create_1 = variable is returned with prefix from lib_ge_message_dspa1 and
suffix from lib_ge_message_dspz1
create_2 = variable is returned with prefix from lib_ge_message_dspa2 and
suffix from lib_ge_message_dspz2
create_3 = variable is returned with prefix from lib_ge_message_dspa3 and
suffix from lib_ge_message_dspz3
output_0 = variable is outputed directly
output_1 = variable is outputed directly with prefix from lib_ge_message_dspa1
and suffix from lib_ge_message_dspz1
output_2 = variable is outputed directly with prefix from lib_ge_message_dspa2
and suffix from lib_ge_message_dspz2
output_3 = variable is outputed directly with prefix from lib_ge_message_dspa3
and suffix from lib_ge_message_dspz3
Format LIB_GE_delayed_output_message <proc> <text> <output> <option>

Return value
Examples Example for UDE Insert:
TCL->LIB_GE_delayed_output_message MOM_end_of_path "This is my te
or
TCL->LIB_GE_delayed_output_message MOM_end_of_path "This is my te

These commands will write 'This is my text' after the Event MOM_end_of_path.

Library commands for Post Configurator 8-21


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_error_message
Purpose Issues an error message which will be displayed in a message box during post
run.
Note: the message is formatted with PostConfigurator internal functions and
may contain text
to be translated (see LIB_GE_MSG). The setting from [CONF_GE_msg
comment_case] will also
be applied before showing the message dialog.

Format LIB_GE_error_message <msg1> <msg2> <option> <translation> <force>

Parameters msg1

Error message to be displayed.

msg2

First line (title) for the dialog box.

option

Type of the message. This will influence the displayed icon of the dialog
box.
Valid options are:
ERROR, INFORMATION, QUESTION or WARNING
This argument is optional. Default value is 'WARNING'

translation

If set to 1 (default), messages are being translated before displaying them.


See LIB_GE_MSG.
This argument is optional. Default value is '1'

force

Reserved.
This argument is optional. Default value is '0'

Return value None.

Examples Example with translation


LIB_GE_error_message "File INS->$datafile<- not found" "Please ve

File not found will be translated and a warning message will be displayed.

Example 2
LIB_GE_error_message "Post processing has finished" "That's it" "

An information message will be displayed.

8-22 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_format_path_names
Purpose This procedure may be used to format pathnames from unix format in windows
format and delete double backslash.
Format LIB_GE_format_path_names <pathname> <exclusion> <forced> <escape>

Parameters pathname

Pathname to be formatted. It can be specified in unix format (directory


separator with /) or in windows format (separator with \ (=escaped
backslash))

exclusion

If set to 1, the resulting path will be closed with slash or backslash.


This argument is optional. Default value is '0'

forced

0 - automatically format path to the corresponding file system.


1 - format the path in Windows style
2 - format the path in Unix style
This argument is optional. Default value is '0'

escape

If set to 1 all backslashes will be escaped.


This argument is optional. Default value is '0'

Return value Formatted path.


Examples Example 1
set result [LIB_GE_format_path_names "D:/Temp/mom/debug.out"]

result will be 'D:\Temp\mom\debug.out' on windows


Example 2
set result [LIB_GE_format_path_names "D:\Temp\mom" 1]

result will be 'D:\Temp\mom\' on windows


Example 3
set result [LIB_GE_format_path_names "D:\Temp\mom" 1 2]

result will be 'D:/Temp/mom/'

Library commands for Post Configurator 8-23


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_generate_chain_selection_condition_vars
Purpose This function is used to initialize the condition variables used to display chain
selection conditions
in the UI. By default for each chain a selection condition is added (without
explicitly calling this function)
Format LIB_GE_generate_chain_selection_condition_vars <number_of_conditions

Parameters number_of_conditions

the total amount of chain selection conditions

Return value None.


Examples Example 1
LIB_GE_generate_chain_selection_condition_vars 4

8-24 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_is_path
Purpose This function checks if a given pathname is a valid directoryname or not.
The existence of the directory will not be checked, it's only a logical check.
Format LIB_GE_is_path <path>

Parameters path

Pathname to check.
Pathname can be specified in unix format (directory separator with /) or in
windows format (separator with \ (=escaped backslash))
UNC Path are valid as well.

Return value 0 - no valid pathname


1 - valid pathname
Examples Example 1
set result [LIB_GE_is_path "C:\Temp"]

result will be 1
Example 2
set result [LIB_GE_is_path "d:/nc-progs"]

result will be 1
Example 3
set result [LIB_GE_is_path "\\fileserver\userdir\user2"]

result will be 1

Library commands for Post Configurator 8-25


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_is_unc_path
Purpose This function checks if a given pathname is a valid UNC directoryname or not.
The existence of the directory will not be checked, it's only a logical check.
Format LIB_GE_is_unc_path <path>

Parameters path

Pathname to check.

Return value 0 - no UNC path


1 - UNC pathname

0 - no valid pathname
1 - valid pathname
Examples Example 1
Example 1
set result [LIB_GE_is_unc_path "C:\Temp"]
set result [LIB_GE_is_unc_path "\\fileserver\userdir\user2"]

result will be 0
result will be 1

8-26 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_lappend
Purpose This function appends the value 'para2' to the global list 'para1'.
Grace to this function it's not necessary to define the list 'para1' with 'global'.
Format LIB_GE_lappend <para1> <para2>

Parameters para1

Name of the variable to define globally.

para2

Value of the variable to append.

Return value None.


Examples Example 1
LIB_GE_lappend test value

Library commands for Post Configurator 8-27


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_message
Purpose This is an enhanced string handling function which will be called internally to
output text
messages to the NC code. It is used for outputting comments, nc inserts, user
messages and more.
You may use this proc wherever needed instead of 'MOM_output_literal'.
Not only the prefix and suffix of the output string can be controlled over the
arguments.
This function also gives the programmer an opportunity to enrich the output
with control codes.
The following codes are valid:

Insert the values of MOM variables which are available at the respective event.
MOM->XXX<-

Insert the values of expressions in NX


EXP->XXX<-

Call procedures and functions with TCL-Code


TCL->XXX<-

- How to handle it:


LIB_GE_message "The Toolradius is TCL->expr
MOM->mom_tool_diameter<-/2<- at the expression EXP->Test1<-"
- very advanced example:
LIB_GE_message "The Toolperimeter is TCL->format %.2f
[expr 2*(2.0*asin(1.0))*(MOM->mom_tool_diameter<-/2)]<- at
MOM->mom_tool_name<-"
- or with a function call
proc myproc {} {
return "now active"
}
LIB_GE_message "Laser TCL->myproc<-"
Format LIB_GE_message <message> <option> <forcelinenumber> <replace_special
Parameters message

Message to be output. Message can be enriched with control codes as


described above.

option

create_0 = variable is returned without prefix/suffix


create_1 = variable is returned with prefix from dspa1 and suffix from
dspz1 (both is set in PostConfig object message)
create_2 = variable is returned with prefix from dspa2 and suffix from
dspz2 (both is set in PostConfig object message)
create_3 = variable is returned with prefix from dspa3 and suffix from
dspz3 (both is set in PostConfig object message)
output_0 = variable is written to the nc code without prefix/suffix

8-28 Library commands for Post Configurator


LIB_GENERAL

output_1 = variable is written to the nc code with prefix from dspa1 and
suffix from dspz1 (both is set in PostConfig object message)
output_2 = variable is written to the nc code with prefix from dspa2 and
suffix from dspz2 (both is set in PostConfig object message)
output_3 = variable is written to the nc code with prefix from dspa3 and
suffix from dspz3 (both is set in PostConfig object message)
This argument is optional. Default value is 'output_1'

forcelinenumber

Output to NC code with line number (only for option output_0..output_3),


provided that in PostConfig object 'message' the property
message_with_seqnum is set to true.
This argument is optional. Default value is '0'

replace_special_characters

Define character conversion if desired. Valid options are


0 = direct output
1 = replace special characters to international spelling
2 = replace special characters to html
3 = replace UTF-8 to Unicode

wordwrap

0 = No word wrap
1 = Split string to several lines if maximum string length exeeds
[CONF_SPF_file max_line_length] (only for option output_0..output_3).
This argument is optional. Default value is '0'

Return value None for option output_0..output_3.


Formatted message for option create_0..create_3.

Examples Simple text output


LIB_GE_message "This is the message text"

Creates a MOM_output_literal "This is the message text"

Comment output
LIB_GE_message "this is a comment" output_1

Writes 'this is a comment' with respective comment prefix and suffix to the
NC code.

Creates a string with the value of an NX expression


set result [LIB_GE_message EXP->R_Param1<- create_0]

result will contain the value of R_Param1

Library commands for Post Configurator 8-29


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_message_dialog
Purpose Displays a dialog box and waits for user interaction.
This function currently only works on Windows platforms. For other plattforms
please use LIB_GE_wish.
Format LIB_GE_message_dialog <args>

Parameters args

There are three mandatory and four optional arguments to be passed:


Mandatory:
argument1: title of the message
argument2: message
argument3: message type (valid options: ERROR, WARNING,
INFORMATION, QUESTION)

Optional:
argument4: number of buttons (1-3)
argument5: label button 1
argument6: label button 2
argument7: label button 3

Return value The index of the selected button.


Examples Simple error message
LIB_GE_message_dialog "Dialog title" "Message" "ERROR"

A simple error message with ok button will be displayed.


1 button dialog box
LIB_GE_message_dialog "Dialog title" "Message" "WARNING" 1 "I agr

A warning message will be displayed with 'I agree' button.


2 buttons dialog box
set response [LIB_GE_message_dialog "Dialog title" "Message" "QUE

A question will be displayed. 'response' holds the user choice: 1-yes, 2-no.
3 buttons dialog box
set response [LIB_GE_message_dialog "Dialog title" "Message" "INF

An information will be displayed. 'response' holds the user choice: 1-button1,


2-button2, 3-button3

8-30 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_MSG
Purpose This function translates postprocessor core messages into the desired
language.
The desired language is derived from the NX variable UGII_LANG but can be
set in
PostConfigurator with [CONF_GE_language operator_language].
In order to translate text, the messages have to be defined in the language
files.
System messages are defined in lib_msg (encrypted). Controller messages
are defined in
ctrl_XXXX_base_msg. Additional message files can be added in a
customer_msg file in the following
format:
set lib_msg(0000,customer,core) "File INS-><- not found"
set lib_msg(0000,customer,english) "File INS-><- not found"
set lib_msg(0000,customer,german) "Datei INS-><- nicht gefunden"
set lib_msg(0000,customer,french) "Fichier INS-><- non trouve"
set lib_msg(0000,customer,italian) "File INS-><- non trovato"
set lib_msg(0001,customer,core) "Message2"
set lib_msg(0001,customer,english) "Message2"
set lib_msg(0001,customer,german) "Nachricht2"
set lib_msg(0001,customer,french) "Message2"
set lib_msg(0001,customer,italian) "Messaggio2"
Format LIB_GE_MSG <text> <possibilities> <replace_special_characters>

Parameters text

Text to be translated. Text has to match the lib_msg(xx,yy,core) part to


be translated.

possibilities

language - e.g. german: direct translation into desired language and omit
default language setting.
2 - for debug purpose: display message number of respective message.

replace_special_characters

Define character conversion if desired. Valid options are


0 = direct output
1 = replace special characters to international spelling
2 = replace special characters to html
3 = replace UTF-8 to Unicode

Return value Translated text. If no translation could be found, the text is returned unchanged.

Library commands for Post Configurator 8-31


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

Examples Standard translation


set message [LIB_GE_MSG "Configuration file does not exist"]

message will contain the text translated into the current postprocessor
language.
Translation of variable text
set message [LIB_GE_MSG "File can not be copied from INS->xxx<- t

Variable text has to be between INS-> and <-. Only the rest is translated and
the
variable text will be insert between INS-><-. The text in the message file has to
contain the INS-><- statement (see description above).
Translation of variable text, example 2
set message [LIB_GE_MSG "File INS->C:\Temp\xxx.txt<- not found"]

'File not found' will be translated. 'C:\Temp\xxx.txt' will be conserved as it is.


Translation into special language
set message [LIB_GE_MSG "SURFACE COORDINATE" "german"]

message will contain the translated text in german language.

8-32 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_read_database
Purpose This function reads an acii file based database in NX-library style. This function
automatically
opens, reads and closes the file. The function provides error handling in case
when the file is
not existing.
Format LIB_GE_read_database <environment> <datafile> <variablelist> <format

Parameters environment

Place where the database is. You may either give an NX environment
variable or a file path.

datafile

Filename and extension of the database.

variablelist

Columns to read in the database. Define as a list. Names are case


sensitive.
Columns will be searched in the 'FORMAT' line of the database.

formatdescription

Identifier for the database header. Usually don't touch.


This argument is optional. Default value is 'FORMAT'

datedescription

Identifier for the database lines. Usually don't touch.


This argument is optional. Default value is 'DATA'

mode

Reaction if database file cannot be found. Options are:


abort - post processing will be aborted
everything else: function returns 'No information available' for each column
defined in 'variablelist'.
This argument is optional. Default value is 'abort'

Return value String list containing the parsed data.

Library commands for Post Configurator 8-33


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

Examples Example on standard db


set dbdata [LIB_GE_read_database "UGII_CAM_LIBRARY_MACHINE_DATA_D

dbdata will contain the all the data of the machine_database with the columns
LIBRF, T and POST.
Example on user db
set dbdata [LIB_GE_read_database "d:\temp\" "mazak_zerodef.ini" "

assume the mazak_zerodef contains data in the following format:


FORMAT ON NN
DATA | G54.1P1 | G54
DATA | G54.1P2 | G55
DATA | G54.1P3 | G56
Then the function will return: dbdata= {{G54.1P1 G54} {G54.1P1 G55}
{G54.1P1 G56}}
You may now access the info like this:
foreach entry $dbdata {
set db(on) [lindex $entry 0]
set db(nn) [lindex $entry 1]
}

8-34 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_read_expression_value
Purpose This function reads expression values out of NX. You may specify the error
handling in case when the expression is missing.
Format LIB_GE_read_expression_value <expression> <defaultValue> <errorHandl

Parameters expression

Expression to be read.

defaultValue

Value to be returned if expression is not defined


If this option is not defined, an empty string will be returned

errorHandling

Defines what kind of message should be generated if the expression is not


defined
* warning : add a warning to the warning list in listing window
* abortMsg : abort postprocessor run
* errorMsg : generate error message (popup dialog) and add add a
warning to the warning list in listing window
* noWarning (or any other value) : do not generate any
warning/message/abort
This argument is optional. Default value is 'abortMsg'

Return value Value of the queried expression or default value if expression not defined.
Examples Example 1
set result [LIB_GE_read_expression_value "MY_EXPRESSION" "my_expr

Library commands for Post Configurator 8-35


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_replace_special_characters
Purpose This function converts multibyte text into an other character set.
Format LIB_GE_replace_special_characters <text> <special> <interaction>

Parameters text

Text to be converted.

special

Target character set:


0 - no conversion, leave text as it is (default)
1 - replace special characters to international spelling
2 - replace special characters to html
3 - replace UTF-8 to Unicode
4 - replace UTF-8 to Unicode
5 - replace special characters to xml
6 - replace special characters to batch
7 - replace special characters to batch (for regex pattern of FINDSTR)
8 - replace special characters to MOM__part_attributes
This argument is optional. Default value is '0'

interaction

1 - do the conversion and returns the converted text.


2 - check if text needs conversion. Returns 1 if it needs a conversion, 0 if
text needs no conversion (has no special characters)
This argument is optional. Default value is '1'

Return value Converted text if 'interaction' is set to 1 (default). Else returns check if text
needs a conversion.
Examples Example 1
set text [LIB_Shell_replace_special_characters $text]

8-36 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_set
Purpose This function sets a new global variable 'para1' with the value 'para2'.
Grace to this function it's not necessary to define the variable with 'global'.
Format LIB_GE_set <para1> <para2>

Parameters para1

Name of the variable to define globally.

para2

Value of the variable to set.

Return value None.


Examples Example 1
LIB_GE_set test value

Library commands for Post Configurator 8-37


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_snapshot
Purpose LIB_GE_snapshot allows to CREATE and REUSE a snapshot of a given set of
global variables
at a given point of time.
This means you can store some defined variables in a given event and reload
them later on in a differnet event

The proc can be used in 4 different ways:


CREATE:
LIB_GE_snapshot CREATE {list of variables to store}
return value: list for thid SnapShot (which can be reused to LOAD the
SnapShot)
LOAD:
LIB_GE_snapshot LOAD {snapshot list created by LIB_GE_snapshot
CREATE}
load the SnapShot defined in the list. This means the global variables
(captured by LIB_GE_snapshot CREATE)
will be set to the value at the point of time when the SnapShot was created.
This can later on be undone by calling LIB_GE_snapshot UNLOAD
UNLOAD:
LIB_GE_snapshot UNLOAD
unload the currently loaded SnapShot. This means the global variables
affected by the loaded SnapShot are reset
to the state, befor the SnapShot was loaded. If currently no SnapShot is
loaded, this call has no effect
LOAD_PERMANENT:
LIB_GE_snapshot LOAD_PERMANENT {snapshot list created by
LIB_GE_snapshot CREATE}
same as LIB_GE_snapshot LOAD . Only difference is, that a SnapShot loaded
with LOAD_PERMANENT will not be registered
for unload. This means LIB_GE_snapshot UNLOAD will have no effect if the
SnapShot was loaded permanent

Format LIB_GE_snapshot <arg1> <arg2>

Parameters arg1

Task to do. Valid arguments are:


CREATE - creates a snapshot. Define the variables to be considered for
the snapshot in arg2.
LOAD - loads the variables of a given snapshot. Define the snapshot in
arg2.
UNLOAD - unloads an active snapshot and resets to the state that was
active before. No arg2 needed.
LOAD_PERMANENT - the same as LOAD but cannot be unloaded later
on.

arg2

additional arguments as described in arg1.

8-38 Library commands for Post Configurator


LIB_GENERAL

Return value None. Variables are set directly


Examples Create a snapshot
set snapshot(1) [LIB_GE_snapshot CREATE "mom_tool_name mom_pos mo

This will store mom_tool_name, the entire array of mom_pos the array elemet
"0" of mom_out_angle_pos and
all the global variables matching the pattern mom_sys* in snapshot(1).
Load a snapshot
LIB_GE_snapshot LOAD $snapshot(1)

This will set the values for the global variables in $snapshot(1) (created by
LIB_GE_snapshot CREATE) to the values
at point of time when Snapshot was created
Unload a snapshot
LIB_GE_snapshot UNLOAD

undo the modifications of the global variables done by LIB_GE_snapshot


LOAD

Library commands for Post Configurator 8-39


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_sort_value
Purpose This function return the smallest or biggest value out of a list.
Format LIB_GE_sort_value <valuelist> <sequence>

Parameters valuelist

List containing numbers to be examined.

sequence

0 - returns the smallest value.


1 - returns the biggest value.
This argument is optional. Default value is '0'

Return value Smallest or biggest value.


Examples Smallest value
set result [LIB_GE_sort_value {1 5 -11 2 9 -10 4 18 10 20 11 -1 1

result will be -11


Biggest value
set result [LIB_GE_sort_value {1 5 -11 2 9 -10 4 18 10 20 11 -1 1

result will be 20

8-40 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_string_range_toupper
Purpose This function converts a part of a string to upper case letters.
Format LIB_GE_string_range_toupper <text> <from> <to>

Parameters text

Text to convert partially to uppercase

from

First character to convert (zero-based)


This argument is optional. Default value is '0'

to

Last character to convert. 'end' converts until the last character.


This argument is optional. Default value is 'end'

Return value Converted string.


Examples Example 1
set text [LIB_GE_string_range_toupper "operations with no moves"

result will be "Operations with no moves"


Example 2
set text [LIB_GE_string_range_toupper "operations with no moves"

result will be "operations WITH no moves"


Example 3
set text [LIB_GE_string_range_toupper "operations with no moves"

result will be "operations with NO MOVES"

Library commands for Post Configurator 8-41


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_string_toupper
Purpose This function converts a string to upper case. Use this function when working
with multibyte
strings as the standard tcl function "string toupper" causes problems when
converting special
characters.
Format LIB_GE_string_toupper <arg> <check>

Parameters arg

String to convert to uppercase.

check

If set to 1, special characters (like umlaut) are converted before doing the
uppercase.
This argument is optional. Default value is '0'

Return value Converted string.


Examples Example 1
set text [LIB_GE_string_toupper $text]

8-42 Library commands for Post Configurator


LIB_GENERAL

LIB_GE_time
Purpose This function returns 'time' as formated string, respecting the time format
defined in
the property [CONF_GE_msg time_format].
Format LIB_GE_time <time>

Parameters time

Time in seconds. If no value is given, the current time will be returned.


This argument is optional. Default value is '0'

Return value Formatted time.


Examples Example 1
MOM_output_literal "(it is now: [LIB_GE_time])"

Library commands for Post Configurator 8-43


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_truncate_line
Purpose This function splits a line into multiple lines if it overpasses a defined maximum
length.
The output command (e.g. MOM_output_literal, MOM_output_text) has to
be defined.
Format LIB_GE_truncate_line <command> <leader> <text> <trailer> <length> <s

Parameters command

MOM-command to be used for the output. In most cases this is


MOM_output_literal.

leader

Character(s) to be added at the start of every output line.

text

Text to output.

trailer

Character(s) to be added at the end of every output line.

length

Maximum output length per line. If this length is overpassed, a new line
will be output with the rest of the text.
This argument is optional. Default value is '999'

suppress

Is set to 1, no line numbers are output


This argument is optional. Default value is '0'

Return value If the given 'text' is shorter than 'length', the whole string will be returned here.
If the given 'text' is longer, only the remaining part of 'text' will be returned here.
The other parts are output
directly with the command 'command'.

8-44 Library commands for Post Configurator


LIB_GENERAL

Examples Example 1
set result [LIB_GE_truncate_line MOM_output_literal "" "$message"

'message' will be splitted and output with 'MOM_output_literal' on several lines


if it's longer than '80' characters.
The remaining part will be returned to 'result'.
Example 2
MOM_output_literal [LIB_GE_truncate_line MOM_output_literal "(" "

'message' will be splitted and output with 'MOM_output_literal' on several lines


if it's longer than '40' characters.
The remaining part will be output MOM_output_literal. Every line will start with
'(' and end with ')' and line numbers
are suppressed.

Library commands for Post Configurator 8-45


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_ui
Purpose Utility to create UI Nodes/Groups
UI structure elements are defined in a CONFIG object like any other property.
The CONFIG object is of special type 'UI_TREE'
( LIB_GE_CREATE_obj My_UI_elements {UI_TREE} {....} )
To Create the individual UI structure elemets within that CONFIG object you
can use this utility.
(like this you are able to define a UI element in a single, readable line.
the needed Property structure will be generated for you)
Format LIB_GE_ui <name> <type> <id_name> <parent> <sequence> <groupstat> <a

Parameters name

Text to be displayed in UI

type

Element type to be created (options are 'NODE' or 'GROUP')


Important to know:
* 2 Levels of nodes are currently supported
* node parent can only be either 'root' or an other node
* 2 levels of groups are currently supported
* group parent can either be a node (only node of last level in current tree
branch) or an other group
* only 'GROUP' elements are able hold properties. Therefore a minimal
tree branch definition consists of 1 node + 1 group

id_name

unique name for that element. This will be the name to reference in
properties to be displayed in that group.
the name has to be a string without any blanks/spaces or special
characters
do not use prefix '@CUI_' for your string. This prefix is reserved for CoreUI
definitions (in core libraries)

parent

id_name of the parent to hold this element (keyword 'root' references to


top level of the tree)

sequence

tree position of the element in question. 0 based list index.


-1 indicates that the element is positioned automatically in the tree.

groupstat

for elements of type 'GROUP' this indicates if the default state of the group
is closed (0) or open (1)

access

8-46 Library commands for Post Configurator


LIB_GENERAL

defines the access level for the UI element. Like for common properties
the code assigns access rights
for each license level. The value has to be a 3 digit integer 'XYZ' where X
ist the access code for 'basic'
Y for 'advanced' and Z for 'full' license. 0 (hide), 1 (readonly) or 2 (full
access) are the valid values for X,Y and Z
(The access level of an UI_TREE type property can be changed by the
command LIB_GE_CONF_set_property_access like for any
common property )

Return value None.


Examples Example 1
LIB_GE_ui "My Ui Node" "NODE" @MyNodeID root
LIB_GE_ui "My Ui SubNode" "NODE" @MySubNodeID @MyNodeID 0 1 222
LIB_GE_ui "My Ui Group" "GROUP" @MyGroupID @MySubNodeID 0 1 222

to assign a property to @MyGroupID the ui_parent attribute of that property


has to be set to the value '@MyGroupID'
This can be done
1) in the property definition (if you are the owner of the property) (set
ui_parent($id) @MyGroupID)
2) by calling 'LIB_GE_CONF_set_property_ui CONF_GE_msg date_format
@MyGroupID 1'
(for detailed description refer to LIB_GE_CONF_set_property_ui)

Library commands for Post Configurator 8-47


Chapter
Chapter 8: 8: LIB_GENERAL
LIB_GENERAL

LIB_GE_wish
Purpose
Format LIB_GE_wish <msg> <submsg> <title> <type> <icon> <replace_special_ch
Parameters msg

Message to be displayed.

submsg

Second message line.

title

Title of the dialog box.

type

1 = abortretryignore –> Displays three buttons whose symbolic names are


abort, retry and ignore.
2 = ok –> Displays one button whose symbolic name is ok.
3 = okcancel –> Displays two buttons whose symbolic names are ok and
cancel.
4 = retrycancel –> Displays two buttons whose symbolic names are retry
and cancel.
5 = yesno –> Displays two buttons whose symbolic names are yes and no.
6 = yesnocancel –> Displays three buttons whose symbolic names are
yes, no and cancel.
This argument is optional. Default value is '2'

icon

1 = error
2 = info
3 = question
4 = warning
This argument is optional. Default value is '4'

replace_special_characters

By default the text is output as it is.


Tcl/Tk has issues with special characters, so you might want to convert it
before outputting by giving one of the following options:
0 - no conversion, leave text as it is (default)
1 - replace special characters to international spelling
2 - replace special characters to html
3 - replace UTF-8 to Unicode
4 - replace UTF-8 to Unicode
5 - replace special characters to xml
6 - replace special characters to batch
7 - replace special characters to batch (for regex pattern of FINDSTR)
8 - replace special characters to MOM__part_attributes

8-48 Library commands for Post Configurator


LIB_GENERAL

Return value The selected button will be returned:


1 = ok
2 = yes
3 = no
4 = abort
5 = retry
6 = ignore
7 = cancel
Examples Simple message
LIB_GE_wish "Message"

A simple message with ok button will be displayed.


Simple message with ok, cancel
LIB_GE_wish "Message" "" "Message title" 3

A simple message with ok and cancel button will be displayed.


Retry or Cancel
set response [LIB_GE_wish "Nc-Code cannot be sent to the printer.

A warning will be displayed. 'response' holds the user choice: 5-retry,7-cancel

Library commands for Post Configurator 8-49


Chapter 9: LIB_STANDARD_POST_FUNC

Library commands for Post Configurator 9-1


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

EQ_is_equal
Purpose This function checks if two given values are equal within a given tolerance.
Format EQ_is_equal <s> <t> <tol>

Parameters s

Value 1

Value 2

tol

Tolerance within the equality will be detected.


If tolerance is not specified, mom_system_tolerance will be used instead.
This argument is optional. Default value is '0'

Return value 1 if values are equal.


0 if values are not equal.
Examples Example 1
set result [EQ_is_equal 12.0 12.0 0.0001]

result will be 1
Example 2
set result [EQ_is_equal 11.999 12.0 0.0001]

result will be 0
Example 3
set result [EQ_is_equal 11.999 12.0 0.01]

result will be 1

9-2 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

EQ_is_ge
Purpose This function checks if value1 is greater or equal (_ge) than value 2 within a
given tolerance.
Format EQ_is_ge <s> <t> <tol>

Parameters s

Value 1

Value 2

tol

Tolerance within the values will be checked.


If tolerance is not specified, mom_system_tolerance will be used instead.
This argument is optional. Default value is '0'

Return value 1 if value 1 is greater or equal than value 2.


0 if value1 is not greater or equal than value 2.
Examples Example 1
set result [EQ_is_ge 12.0 12.0 0.0001]

result will be 1
Example 2
set result [EQ_is_ge 11.999 12.0 0.0001]

result will be 0
Example 3
set result [EQ_is_ge 12.0 11.999 0.0001]

result will be 1

Library commands for Post Configurator 9-3


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

EQ_is_gt
Purpose This function checks if value1 is greater than (_gt) value 2 within a given
tolerance.
Format EQ_is_gt <s> <t> <tol>

Parameters s

Value 1

Value 2

tol

Tolerance within the values will be checked.


If tolerance is not specified, mom_system_tolerance will be used instead.
This argument is optional. Default value is '0'

Return value 1 if value 1 is greater than value 2.


0 if value1 is not greater than value 2.
Examples Example 1
set result [EQ_is_gt 12.0 12.0 0.0001]

result will be 0
Example 2
set result [EQ_is_gt 11.999 12.0 0.0001]

result will be 0
Example 3
set result [EQ_is_gt 12.0 11.999 0.0001]

result will be 1

9-4 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

EQ_is_le
Purpose This function checks if value1 is less or equal (_le) than value 2 within a
given tolerance.
Format EQ_is_le <s> <t> <tol>

Parameters s

Value 1

Value 2

tol

Tolerance within the values will be checked.


If tolerance is not specified, mom_system_tolerance will be used instead.
This argument is optional. Default value is '0'

Return value 1 if value 1 is less or equal than value 2.


0 if value1 is not less or equal than value 2.
Examples Example 1
set result [EQ_is_le 12.0 12.0 0.0001]

result will be 1
Example 2
set result [EQ_is_le 11.999 12.0 0.0001]

result will be 1
Example 3
set result [EQ_is_le 12.0 11.999 0.0001]

result will be 0

Library commands for Post Configurator 9-5


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

EQ_is_lt
Purpose This function checks if value1 is less than (_lt) value 2 within a given tolerance.
Format EQ_is_lt <s> <t> <tol>

Parameters s

Value 1

Value 2

tol

Tolerance within the values will be checked.


If tolerance is not specified, mom_system_tolerance will be used instead.
This argument is optional. Default value is '0'

Return value 1 if value 1 is less than value 2.


0 if value1 is not less than value 2.
Examples Example 1
set result [EQ_is_lt 12.0 12.0 0.0001]

result will be 0
Example 2
set result [EQ_is_lt 11.999 12.0 0.0001]

result will be 1
Example 3
set result [EQ_is_lt 12.0 11.999 0.0001]

result will be 0

9-6 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

EQ_is_zero
Purpose This function checks if a given value is zero within a given tolerance.
Format EQ_is_zero <s> <tol>

Parameters s

Value

tol

Tolerance within the value will be checked.


If tolerance is not specified, mom_system_tolerance will be used instead.
This argument is optional. Default value is '0'

Return value 1 if value is zero.


0 if value1 is not zero.
Examples Example 1
set result [EQ_is_zero 0.0001 0.0001]

result will be 1
Example 2
set result [EQ_is_zero 0.01 0.0001]

result will be 0
Example 3
set result [EQ_is_zero 0 0.0001]

result will be 1

Library commands for Post Configurator 9-7


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

hiset
Purpose This function checks if a variable is set or not.
Format hiset <v1>

Parameters v1

Name of the variable to be checked.

Return value 0 - if the variable is not set (does not exist)


1 - if the variable is set
Examples Example 1
if {[hiset yy]} {puts $list_file "yy=$yy"}

Checks if yy is set and do something with it in that case


Example 2
set result [hiset yy]

result will be 1 if yy is set, else 0

9-8 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

isset
Purpose
Format isset <v1>

Parameters v1

Name of the variable to be checked.

Return value n - if the variable is not set (does not exist)


y - if the variable is set
Examples Example 1
if {[hiset yy] == "y"} {puts $list_file "yy=$yy"}

Checks if yy is set and do something with it in that case


Example 2
set result [hiset yy]

result will be y if yy is set, else n

Library commands for Post Configurator 9-9


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_abort_postrun
Purpose This function can be called to abort the postprocessing.
It has the same effect as MOM_abort but is faster, clears messages
and does a cleanup handling.
Format LIB_SPF_abort_postrun <text> <once>

Parameters text

Message to be displayed when aborting the post processor

once

Reserved argument
This argument is optional. Default value is '0'

Return value None.


Examples Example 1
LIB_SPF_abort_postrun "The post will now be interrupted"

9-10 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_add_warning
Purpose This function adds a warning message to the post process info window.
The name of the operation where the warning occurs is automatically added to
the info.
The configuration object 'CONF_SPF_warning' allows to set how warnings
are being handled.
Format LIB_SPF_add_warning <text> <mode> <function>

Parameters text

Warning to be issued.

mode

Reserved. Do not use.


This argument is optional. Default value is '0'

function

Reserved. Do not use.

Return value None.


Examples Example 1
LIB_SPF_add_warning "Operation with no moves"

Library commands for Post Configurator 9-11


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_array_to_vector
Purpose This function converts an 3 dimensional array into a list. It is the corresponding
function to LIB_SPF_vector_to_array
Format LIB_SPF_array_to_vector <variable> <elements>

Parameters variable

Name of the array which should be converted.

elements

By default the array indexes 0, 1 and 2 are addressed. There is no need to


change that.
This argument is optional. Default value is '0 1 2'

Return value String list.


Examples Example 1
set MSYS_Origin [LIB_SPF_array_to_vector "mom_msys_origin"]

Creates a list from the array mom_sys_origin. Corresponds to:


set MSYS_Origin "$mom_msys_origin(0) $mom_msys_origin(1)
$mom_msys_origin(2)"

9-12 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_ask_address
Purpose This function gives you detailled access to the definition elements of an
address.
In order to use this function you have to activate the property
[CONF_SPF_advanced_settings parse_def_file].
Format LIB_SPF_ask_address <address> <parameter> <supress_error>

Parameters address

Address to be read.

parameter

Address definition elenent to read.


Valid parameters are:
ALL - reads all elements (this is the default)
FORMAT - format to be used for the address
FORCE - modality of the address
LEADER - leader of the address
TRAILER - trailer of the address
ZERO_FORMAT - format to be used when value is zero
..and all other elements that may be defined for a specific address may be
queried.
This argument is optional. Default value is 'ALL'

supress_error

If set, the post processor will not abort in case of missing


[CONF_SPF_advanced_settings parse_def_file] but only return -1
This argument is optional. Default value is '0'

Return value FALSE - if address or element not existing


-1 - def file cannot be parsed (returns only if option supress_error is set)
value - if query was successful
Examples Example to read all elements
set resultlist [LIB_SPF_ask_address "M_spindle"]

resultlist will contain something like: {FORMAT Digit_2} {FORCE off} {LEADER
"M"} {ZERO_FORMAT Zero_int}
Example to read a specific element
set resultvalue [LIB_SPF_ask_address "M_spindle" "LEADER"]

resultvalue like e.g. "M"

Library commands for Post Configurator 9-13


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_ask_block_template
Purpose This function gives you detailled access to the definition elements of a block
template.
In order to use this function you have to activate the property
[CONF_SPF_advanced_settings parse_def_file].
Format LIB_SPF_ask_block_template <block_template> <parameter> <supress_err

Parameters block_template

Block template to be read.

parameter

Address definition elenent to read.


Valid parameters are:
ALL - reads all elements (this is the default)
..or specific address.
This argument is optional. Default value is 'ALL'

supress_error

If set, the post processor will not abort in case of missing


[CONF_SPF_advanced_settings parse_def_file] but only return -1
This argument is optional. Default value is '0'

Return value FALSE - if address or element not existing


-1 - def file cannot be parsed (returns only if option supress_error is set)
value - if query was successful
Examples Example with ALL
set result [LIB_SPF_ask_block_template "linear_move_turbo"]

e.g. result = {G_motion[^sys_linear_code]} {X[^POSX]} {Y[^POSY]}


{Z[^POSZ]}...
Example to read a specific address
set result [LIB_SPF_ask_block_template "linear_move_turbo" "G_mot

e.g. result = {{G_motion} {^sys_linear_code}}

9-14 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_ask_delta_4th_or_5th
Purpose This function returns the delta degrees rotation of the axis_no(4 or 5)
Format LIB_SPF_ask_delta_4th_or_5th <axis_no>

Parameters axis_no

Rotary axis id. Valid values are 4 or 5.

Return value Delta degrees


Examples Example 1
set result [LIB_SPF_ask_delta_4th_or_5th 4]

Library commands for Post Configurator 9-15


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_ask_format
Purpose This function reads the format definition of the given format name out of of the
currently sourced definition files.
In order to use this function you have to activate the property
[CONF_SPF_advanced_settings parse_def_file].
Format LIB_SPF_ask_format <format> <supress_error>

Parameters format

Format which should be checked on it's existence.

supress_error

If set, the post processor will not abort in case of missing


[CONF_SPF_advanced_settings parse_def_file] but only return -1
This argument is optional. Default value is '0'

Return value FALSE - if format is not existing


-1 - def file cannot be parsed (returns only if option supress_error is set)
value - if query was successful
Examples Example 1
set result [LIB_SPF_ask_format "Coordinate"]

e.g. result = "&__5.4_"

9-16 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_ask_smaller_of_4th_5th
Purpose This function returns the shortest delta degrees rotation out of 4th and 5th axis.
Format LIB_SPF_ask_smaller_of_4th_5th <axis_no>

Return value Shortest delta rotation in degrees.


Examples Example 1
set result [LIB_SPF_ask_smaller_of_4th_5th]

Library commands for Post Configurator 9-17


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_ask_type_subtype
Purpose This functions gets the type and subtype of the current operation.
The function is automatically called in MOM_start_of_path and is only
documented here for your reference.
The supported types correspond to the definitions in
..\UGOPEN\uf_object_types.h
Format LIB_SPF_ask_type_subtype <text> <mode> <function>

Return value Three standard variables are being set:


- lib_spf(opertag)
- lib_spf(opertype)
- lib_spf(opersubtype)
Examples Example 1
No example needed. Function is automatically called at the start

9-18 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_atan_polar
Purpose Utility to convert cartesian coordinate to polar
Format LIB_SPF_atan_polar <v1> <v2>

Parameters v1

X value in cartesian coordinate format.

v2

Y value in cartesian coordinate format.

Return value Angle in polar coordinate format.


Examples Example 1
set result [LIB_SPF_atan_polar $mom_pos(0) $mom_pos(1)]

Library commands for Post Configurator 9-19


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_catch_warning_by_type
Purpose This function is evaluated from the post processor when warning messages
issued with LIB_SPF_add_warning
are being output and the configuration object CONF_SPF_warning
catch_warning_by_type is set to 1.
In this case the warning will be omited given that the current operation type is
listed in this
function.
All existing operation types are defined in ..UGOPEN\uf_object_types.h
By default warning messages are omitted for mill,lathe and wedm control
operations.
Here is the definition in uf_object_types.h:
UF_machining_operation_type 100
UF_mach_mill_mc_subtype 1100
UF_mach_lathe_mc_subtype 1200
UF_mach_wedm_mc_subtype 1300
Format LIB_SPF_catch_warning_by_type <text> <mode> <function>

Return value 'CONTINUE' if warning should be omitted


'OK' if warning should be output
Examples Source code of the standard
proc LIB_SPF_catch_warning_by_type {} {
global lib_spf
if {[CONF_SPF_warning catch_warning_by_type]} {
if {$lib_spf(opertype) == 100 && ($lib_spf(opersubtype) == 1100 |
return "CONTINUE"
}
}
return "OK"
}

this standard code will omit warning messages for control operations.

9-20 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_convert_binary_to_decimal
Purpose This function converts numbers in binary format to their corresponcance in
decimal format.
Format LIB_SPF_convert_binary_to_decimal <binary>

Parameters binary

Binary expression to convert.

Return value Converted number.


Examples Example with 11011
set result [LIB_SPF_convert_binary_to_decimal 11011]

Result will be 27.


The conversion is done in the following scheme:
111001 = 1*pow(2,4)+1*pow(2,3)+0*pow(2,2)+1*pow(2,1)+1*pow(2,0) = 27
————————
bit4 bit3 bit2 bit1 bit0
16 8 4 2 1
11011
————————
16 + 8 + 0 + 2 + 1 = 27

Library commands for Post Configurator 9-21


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_convert_decimal_to_binary
Purpose This function converts decimal values to binary values.
Format LIB_SPF_convert_decimal_to_binary <decimal>

Parameters decimal

Decimal value to be converted.

Return value Converted binary value.


Examples Example 1
set result [LIB_SPF_convert_decimal_to_binary 27]
#desc: the result will be 1011

9-22 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_convert_hex_to_string
Purpose This function converts a string to a hexadecimal value.

This function converts an hexadecimal value to a string.


Format LIB_SPF_convert_hex_to_string <hex>

Parameters hex

Hexadecimal value to be converted.

Return value Converted hexadecimal value.

Converted string.
Examples Example 1
set result [LIB_SPF_convert_string_to_hex "Hello, world!"]

result will be 48656c6c6f2c20776f726c6421


Example 1
set result [LIB_SPF_convert_hex_to_string 48656c6c6f2c20776f726c6

result will be "Hello, world!"

Library commands for Post Configurator 9-23


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_convert_point
Purpose This function converts the current position (mom_pos and mom_alt_pos) into
the desired kinematic system.
Internally the mom_pos will be stored in a list mom_result and mom_alt_pos in
a list mom_result1.
The lists (mom_result,mom_result1) are then converted to mom_pos and
mom_alt_pos in the desired kinematic system.
Further the mom_out_angle_pos is calculated with the limits in the defined
configuration, taking into account the
limit and mom_kin_(4)5th_axis_direction variables.
Format LIB_SPF_convert_point <option>

Parameters option

real = use the real kinematic


plane = use the plane kinematic (tabletable and orthogonal)
simultaneous = use the simultaneous kinematic (headhead and real
machine axis)
reload = reload the kinematic and the
mom_pos,mom_alt_pos,mom_out_angle_pos that have been active
before the last convert_point

Return value The converted values are written to mom_pos(0..2) and mom_alt_pos(0..2) as
well as to mom_out_angle_pos(0..1)
Examples Example 1
LIB_SPF_convert_point simultaneous
ECHO mom_pos mom_alt_pos mom_out_angle_pos
LIB_SPF_convert_point reload

This example converts the current position to simultaneous and does a debug
output of the converted values.
After that the values are reset to the original state.

9-24 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_convert_to_md5
Purpose This function converts a string to a md5 value.
Format LIB_SPF_convert_to_md5 <msg>

Parameters msg

String to be converted.

Return value Converted md5 value.


Examples Example 1
set result [LIB_SPF_convert_to_md5 "Hello, world!"]

result will be ed076287532e86365e841e92bfc50d8c

Library commands for Post Configurator 9-25


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_deg_to_rad
Purpose This function converts an angular value in degrees to an angular value in
radians.
Format LIB_SPF_deg_to_rad <angdeg>

Parameters angdeg

Angle in degrees to be converted.

Return value Angle in radians.


Examples Example 1
set result [LIB_SPF_deg_to_rad 180]

9-26 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_eliminate_zero
Purpose This function formats a decimal number into a specified string format and
rounds it to the desired number of decimals.
Format LIB_SPF_eliminate_zero <value> <decimal_places> <splitter>

Parameters value

Value to be formatted.

decimal_places

Number of decimals to be output. If omitted, it will be formatted


automatically following internal rules.
This argument is optional. Default value is '4'

splitter

If set to "." and resulting value = 0, we will get "0." as return value. Else
we get "0".

Return value Formated number as string value.


Examples Example 1
set result [LIB_SPF_eliminate_zero "12.3456789"]

result will be 12.3457


Example 2
set result [LIB_SPF_eliminate_zero "12.3456789" 3]

result will be 12.346


Example 3
set result [LIB_SPF_eliminate_zero "0.0034" 0 .]

result will be 0.

Library commands for Post Configurator 9-27


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_eliminate_zero_inline
Purpose This function does the same task as LIB_SPF_eliminate_zero but applies on
every decimal
expression within a line/string list.
Format LIB_SPF_eliminate_zero_inline <line> <word_seperator> <max_decimal_p

Parameters line

String (list) .

word_seperator

Reserved for internal use.


This argument is optional. Default value is '0'

max_decimal_place

Number of decimals to be output. If omitted, it will be formatted


automatically following internal rules.
This argument is optional. Default value is '3'

iterationen

Reserved for internal use.


This argument is optional. Default value is '25'

Return value Formated number as string value.


Examples Example 1
set result [LIB_SPF_eliminate_zero_inline "CYCL DEF 200 Q200=2. Q

Formats all decimal values within the string:


Before: CYCL DEF 200 Q200=2. Q201=-2.5 Q206=251. Q202=2.5 Q210=0.0
Q203=0.0 Q204=5. Q211=0.0
After: CYCL DEF 200 Q200=2 Q201=-2.5 Q206=251 Q202=2.5 Q210=0
Q203=0 Q204=5 Q211=0

9-28 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_execute_op_tool_param_condition
Purpose This function executes the predefined condition
checks, set in LIB_SPF_op_tool_param_condition and
LIB_SPF_custom_op_tool_param_condition.
The function can be called in any proc. The argument has to be the name
of the calling proc.
Format LIB_SPF_execute_op_tool_param_condition <calling_proc> <position>

Parameters calling_proc

Name of the calling proc.

position

Optionally defines the position to be checked.

Return value
Examples Example 1
proc MOM_before_motion {} {
LIB_SPF_execute_op_tool_param_condition [info level 0]
}

[info level 0] returns the name of the current proc, in this example
"MOM_before_motion"

Library commands for Post Configurator 9-29


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_exists_address
Purpose This function checks whether the given address is defined in one of the
currently sourced definition files.
In order to use this function you have to activate the property
[CONF_SPF_advanced_settings parse_def_file].
Format LIB_SPF_exists_address <address> <supress_error>

Parameters address

Address which should be checked on it's existence.

supress_error

If set, the post processor will not abort in case of missing


[CONF_SPF_advanced_settings parse_def_file] but only return -1
This argument is optional. Default value is '0'

Return value 0 - address is not defined.


1 - address is defined.
-1 - def file cannot be parsed (returns only if option supress_error is set)
Examples Example 1
set result [LIB_SPF_exists_address "M_spindle"]

9-30 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_exists_block_template
Purpose This function checks if the given block template name is defined in one of the
currently sourced definition files.
In order to use this function you have to activate the property
[CONF_SPF_advanced_settings parse_def_file].
Format LIB_SPF_exists_block_template <block_template> <supress_error>

Parameters block_template

Block template which should be checked on it's existence.

supress_error

If set, the post processor will not abort in case of missing


[CONF_SPF_advanced_settings parse_def_file] but only return -1
This argument is optional. Default value is '0'

Return value 0 - block template is not defined.


1 - block template is defined.
-1 - def file cannot be parsed (returns only if option supress_error is set)
Examples Example 1
LIB_SPF_exists_block_template "circular_move"]

Library commands for Post Configurator 9-31


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_exists_format
Purpose This function checks if the given format name is defined in one of the currently
sourced definition files.
In order to use this function you have to activate the property
[CONF_SPF_advanced_settings parse_def_file].
Format LIB_SPF_exists_format <format> <supress_error>

Parameters format

Format which should be checked on it's existence.

supress_error

If set, the post processor will not abort in case of missing


[CONF_SPF_advanced_settings parse_def_file] but only return -1
This argument is optional. Default value is '0'

Return value 0 - format is not defined.


1 - format is defined.
-1 - def file cannot be parsed (returns only if option supress_error is set)
Examples Example 1
set result [LIB_SPF_exists_format "Coordinate"]

9-32 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_extract_udecode
Purpose This function returns the option number of an ude, provided that the options
start with
a number (an id) and are followed by - or _
This helps you creating language independant UDE's as we only consider the
id and not the
name after the - or _
Format LIB_SPF_extract_udecode <ude> <name>

Parameters ude

Variable of an UDE to be analyzed.

name

Optionally you may specify a variable name on which the variable value
after the language code will be returned

Return value Returns the the option number. If no option number exists, returns the whole
string instead.
Examples Example 1
set ude "99-Test"
set result [LIB_SPF_extract_udecode $ude name]

the result will be 99 and the value of the variable $name will be "Test"

Library commands for Post Configurator 9-33


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_get_partnname
Purpose This function returns the partname.
Format LIB_SPF_get_partnname <calling_proc> <position>

Return value
Examples Example 1
set result [LIB_SPF_get_partnname]

9-34 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_get_pretreatment
Purpose This function accesses variables that have been collected in the pretreatment
postprocessor.
If a desired variable does not exist, an empty string is returned.

Note: this function can only access informations that occur after the first
MOM_start_of_path.
Use LIB_PT_get_header_var instead to access variables that preceed the first
MOM_start_of_path.
This is typically the case with variables coming from an UDE header.

In order to be able to access specific variables, you have to tell the


pretreatment postprocessor
which variables should be collected. This is acheived with the procedure
LIB_SPF_pretreatment_add_var
(see there for more infos of how to use it).
Format LIB_SPF_get_pretreatment <variable> <sequence> <path_name>
Parameters variable

Name of the variable that you want to read.


The following variables are always accessible:
axis_mode / mom_kin_is_turbo_output / mom_operation_type
/ mom_path_name / mom_tool_name / mom_tool_number /
mom_tool_description /
tag / type / subtype / number / mom_toolpath_cutting_time /
mom_tool_change_type / mom_machine_mode /
limit,4th,max / limit,4th,min / limit,5th,max / limit,5th,min /
limit,x,max / limit,x,min / limit,y,max / limit,y,min / limit,z,max / limit,z,min /
csys_is_default / op_with_no_move
Variable lists (if want to get one of the following lists, you have to omit
sequence and path_name)
operation_list / tag_list / tool_name_list / tool_number_list
All other variables need to be made known with
LIB_SPF_pretreatment_add_var

sequence

Operation sequence that you want to read. Default = 0 means that the
value of the current operation is read.
Sequence options:
last = read value in the very last operation
first = read value in the very first operation
next = read value in the next operation
+/- x = read x operations before or after the current operation
This argument is optional. Default value is '0'

path_name

Optional. Instead of reading a specific sequence you may ask the value in
a given path_name. In this case set sequence to 0

Library commands for Post Configurator 9-35


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

Return value
Examples Example 1
set axis_mode [LIB_SPF_get_pretreatment axis_mode]

9-36 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_get_pretreatment_eventbased
Purpose This function accesses variables that have been collected in the pretreatment
postprocessor.
If a desired variable does not exist, an empty string is returned.
It is mostly the same function as LIB_SPF_get_pretreatment, enhanced with
the option to only
consider variables of an specified event (see argument description 'event').

Note: this function can only access informations that occur after the first
MOM_start_of_path.
Use LIB_PT_get_header_var instead to access variables that preceed the first
MOM_start_of_path.
This is typically the case with variables coming from an UDE header.

In order to be able to access specific variables, you have to tell the


pretreatment postprocessor
which variables should be collected. This is acheived with the procedure
LIB_SPF_pretreatment_add_var
(see there for more infos of how to use it).

Format LIB_SPF_get_pretreatment_eventbased <event> <variable> <sequence> <p

Parameters event

Event out of which the specific variable should be read.


Sometimes the same variable name is used by different procs (often the
case with command_status)
Here we tell the proc to only consider the variable set in a specific Event.

variable

Name of the variable that you want to read

sequence

Operation sequence that you want to read. Default = 0 means that the
value of the current operation is read.
Sequence options:
last = read value in the very last operation
first = read value in the very first operation
next = read value in the next operation
+/- x = read x operations before or after the current operation
This argument is optional. Default value is '0'

path_name

Optional. Instead of reading a specific sequence you may ask the value in
a given path_name. In this case set sequence to 0

Return value value of the requested variable or empty string if value is not present.

Library commands for Post Configurator 9-37


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

Examples get command_status of specific UDE for next operation


set command_status [LIB_SPF_get_pretreatment_eventbased MOM_custo

gets the command_status of the UDE 'customer_ude' of the next operation.


Important: in order to access the variable you have to tell the pretreatment
postprocessor to collect
set axis_mode [LIB_SPF_get_pretreatment_eventbased MOM_insert
mom_Instruction]
e.g. "LIB_SPF_pretreatment_add_var MOM_insert mom_Instruction" need to
be called first to get an result

9-38 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_is_divisible
Purpose This function checks if a given input value can be divided by 2 (this is the
default divider).
The check is true if the divided resulting value is an integer value.
Optionally it is possible to check with another divisor than 2.
Format LIB_SPF_is_divisible <value> <divider>

Parameters value

Number to be checked.

divider

Divider which should be applied.


This argument is optional. Default value is '2'

Return value 1 if the division is possible without restover


0 if the division leaves an restover
Examples Example 1
set result [LIB_SPF_is_divisible "20"]

result will be 1
Example 2
set result [LIB_SPF_is_divisible "21"]

result will be 0
Example 3 with optional divider 3
set result [LIB_SPF_is_divisible "9" "3"]

result will be 1

Library commands for Post Configurator 9-39


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_is_empty
Purpose This function checks if a given string is empty (blanks are trimmed out before
the check).
Format LIB_SPF_is_empty <value>

Parameters value

String to be checked.

Return value 0 if string is not empty


1 if string is empty
Examples Example 1
set string ""
set result [LIB_SPF_is_empty $string]

result will be 1
Example 2
set string " "
set result [LIB_SPF_is_empty $string]

result will be 1
Example 3
set string "any text"
set result [LIB_SPF_is_empty $string]

result will be 0

9-40 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_is_floating
Purpose This function checks whether a value is a floating number or not.
This function also indicates if a value is noted with decimals but holds an
integer value.
Format LIB_SPF_is_floating <value>

Parameters value

value to be checked.

Return value 0 if it is not a floating number (e.g. "1" or "text")


1 if it is a floating number (e.g. "1.234")
2 if it is an integer value but followed by decimals with zero (e.g. "1.000")
Examples Example with a floating number
set result [LIB_SPF_is_floating "-1.123"]

result will be 1
Example with an integer followed by decimals
set result [LIB_SPF_is_floating "2.000"]

result will be 1
Example with an integer
set value "-3"
set result [LIB_SPF_is_floating "-3"]

result will be 0

Library commands for Post Configurator 9-41


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_is_integer
Purpose This function detects if a given string represents an integer value or not.
By default the check considers the valid data type format. Optionally it is
possible to only consider the value no matter of the data type.
Format LIB_SPF_is_integer <value> <mode>

Parameters value

value to be checked.

mode

check_data_type or check_value
This argument is optional. Default value is 'check_data_type'

Return value 0 if it is not an integer


1 if it is an integer
Examples Example with an integer
set string "12"
result [LIB_SPF_is_integer $string]

result will be 1
Example with an integer value followed by dot (default mode
"check_data_type")
set string "12."
result [LIB_SPF_is_integer $string]

result will be 0
Example with an integer value followed by dot (optional mode
"check_value")
set string "12."
result [LIB_SPF_is_integer $string "check_value"]

result will be 1

9-42 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_is_matrix_equal
Purpose This function compares two matrixes and examines if they are equal within
a specified tolerance.
Format LIB_SPF_is_matrix_equal <Value1> <Value2> <Tolerance> <Elements>

Parameters Value1

First matrix as string list

Value2

Second matrix as string list

Tolerance

Tolerance to detect equality within


This argument is optional. Default value is '0.00001'

Elements

Dimension of matrix -1
This argument is optional. Default value is '8'

Return value 1 if matrixes are equal


0 if not
Examples Example 1
Example 2
set Value1 "-0.9 0.0 0.0 -0.9 0.0 0.0 -0.9 0.0 0.0 -0.9 0.0 0.0"
set Value2 "1.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0"
set Result [LIB_SPF_is_matrix_equal $Value1 $Value2]
set Value1 "0.99999 -0.00001 0.0 1.0 0.0 0.0 1.0 0.0 0.0"
set Value2 "1.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0"
set Result [LIB_SPF_is_matrix_equal $Value1 $Value2]

Result will be 0
Result will be 1

Library commands for Post Configurator 9-43


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_is_no_decimal
Purpose This function verifies that a given string contains no numbers.
Format LIB_SPF_is_no_decimal <value>

Parameters value

Value to be checked.

Return value 0 if it contains a number


1 if it does not contain any numbers
Examples Example 1
set result [LIB_SPF_is_no_decimal "check this string"]

result will be 1
Example 2
set result [LIB_SPF_is_no_decimal "check me 123"]

result will be 0
Example 3
set result [LIB_SPF_is_no_decimal "1.234"]

result will be 0

9-44 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_is_number
Purpose This function checks if a given string represents a number in a valid TCL
format.
Note: exponential notation is also considered as a valid number if checked
mathematically (default).
Optionally you may check with the argument "character" wich only validates
numbers in normal decimal notation.
Format LIB_SPF_is_number <value> <compared>

Parameters value

value to be checked.

compared

mathematically (default) = check with format


character = check with regexp
This argument is optional. Default value is 'mathematically'

Return value 0 if it is a number


1 if it is not
Examples Example with a floating value
set result [LIB_SPF_is_number "1.234"]

result will be 1
Example with a floating value in exponential notation (default mode
"mathematically")
set result [LIB_SPF_is_number "1.56819e-015"]

result will be 1
Example with a floating value in exponential notation (optional mode
"character")
set result [LIB_SPF_is_number "1.56819e-015"]

result will be 0

Library commands for Post Configurator 9-45


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_is_part_of_string
Purpose This function checks if one string is a part of another string.
The check is case insensitive, but can optionally be set to be case sensitive.
Format LIB_SPF_is_part_of_string <string> <part> <case>

Parameters string

String to be searched in.

part

String part to be searched for in the other string.

case

If set to 1, the check will be case sensitive. If not set, the check will be
case insensitive.
This argument is optional. Default value is '0'

Return value
Examples Example 1
set result [LIB_SPF_is_part_of_string "Test for a string" "string

result will be 1
Example 1
set result [LIB_SPF_is_part_of_string "Test for a string" "STRING

result will be 1
Example 1
set result [LIB_SPF_is_part_of_string "Test for a string" "STRING

result will be 0

9-46 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_is_vector
Purpose This function checks whether a value is a vector or point or another value.
Format LIB_SPF_is_vector <value>

Parameters value

value to be checked.

Return value 1 if it is a vector or point


0 if it is not a vector or point
Examples Example with a vector
set value "0 0 1"
set result [LIB_SPF_is_vector $value]

result will be 1
Example with a point
set value "123.222 555.666 -111.999"
set result [LIB_SPF_is_vector $value]

result will be 1
Example with a non vector/non point
set value "1.23"
set result [LIB_SPF_is_vector $value]

result will be 0

Library commands for Post Configurator 9-47


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_list_non_common_elements
Purpose This function returns a list of elements that are not commen in 2 given lists
Format LIB_SPF_list_non_common_elements <list1> <list2>

Parameters list1

first list.

list2

second list.

Return value list of non common list elements


Examples Example 1
set result [LIB_SPF_list_non_common_elements "a b c d" "a b d"]

result will be: c


Example 2
set result [LIB_SPF_list_non_common_elements "a b c d" "a b d 1

result will be: "c 1 2 3"

9-48 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_list_reverse
Purpose This function reverses the order of a list.
Format LIB_SPF_list_reverse <list>

Parameters list

String list to be reversed.

Return value Reversed string list.


Examples Example 1
set result [LIB_SPF_list_reverse [list "first element" "second el

result will be: 5 4 3 2 1 "some other text" "second element" "first element"
Example 2
set result [LIB_SPF_list_reverse [list "" "" "" 1 2 3 4 5 "" "" 6

result will be: {} 7 6 {} {} 5 4 3 2 1 {} {} {}


Please note: empty elements will be conserved in the list.

Library commands for Post Configurator 9-49


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_list_to_table
Purpose Formats a string list into a table form. Every column is aligned to the longest
element of
the respective column.
Format LIB_SPF_list_to_table <in> <padding> <firstelement> <leader> <as_lis
Parameters in

String list to be formatted.

padding

Padding between each column.


This argument is optional. Default value is '0'

firstelement

Number of first line to be considered for the alignement. Corresponds to


the index of the string list
This argument is optional. Default value is '0'

leader

Character(s) to be put at the beginning of every line

as_list

0: return a string with line breaks


1: return a string list
This argument is optional. Default value is '0'

Return value Formatted string with line breaks by default. If argument 'as_list' set to 1,
returns a string list instead.
Examples Coordinate list
set result [LIB_SPF_list_to_table [list "X1" "X10 Y1" "X100 Y10"

result will be following string:


X1
X10 Y1
X100 Y10
X1000 Y10 Z100
Operation list
foreach e [LIB_SPF_get_pretreatment operation_list] {
lappend oplist "( Operation $e )"
}
set result [LIB_SPF_list_to_table $oplist 2 0 \; 1]
foreach e $result {
MOM_output_literal $e
}

result will be the output of an operation list into the nc-code.


e.g.:

9-50 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

N100 ;( Operation PLANAR_PROFILE )


N110 ;( Operation PLANAR_PROFILE_COPY )
N120 ;( Operation CONTUR_PROFILE )

Library commands for Post Configurator 9-51


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_list_trim
Purpose This function trims empty elements at the beginning and the end of a list.
Format LIB_SPF_list_trim <list>

Parameters list

String list to be trimmed on both sides.

Return value Trimmed string list.


Examples Example 1
set result [LIB_SPF_list_trim [list "" "" "" 1 2 3 4 5 "" "" 6 7

result will be: 1 2 3 4 5 {} {} 6 7


Empty elements at both sides of the list will be trimmed.

9-52 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_list_trim_elements
Purpose This function trims each element within a list.
Format LIB_SPF_list_trim_elements <list>

Parameters list

String list to be trimmed on both sides.

Return value Trimmed string list.


Examples Example 1
set result [LIB_SPF_list_trim_elements [list "" "" "" " 1 " 2 "3

result will be: {} {} {} 1 2 3 4 5 {} {} 6 7 {}


All elements of the list will be trimmed on both sides.
Note: empty elements will be conserved.

Library commands for Post Configurator 9-53


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_list_trim_left
Purpose This function trims empty elements at the beginning of a list.
Format LIB_SPF_list_trim_left <list>

Parameters list

String list to be left trimmed.

Return value Trimmed string list.


Examples Example 1
set result [LIB_SPF_list_trim_left [list "" "" "" 1 2 3 4 5 "" ""

result will be: 1 2 3 4 5 {} {} 6 7 {}


Only empty elements at the beginning of the list will be trimmed.

9-54 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_list_trim_right
Purpose This function trims empty elements at the end of a list.
Format LIB_SPF_list_trim_right <list>

Parameters list

String list to be right trimmed.

Return value Trimmed string list.


Examples Example 1
set result [LIB_SPF_list_trim_right [list "" "" "" 1 2 3 4 5 "" "

result will be: {} {} {} 1 2 3 4 5 {} {} 6 7


Only empty elements at the end of the list will be trimmed.

Library commands for Post Configurator 9-55


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_matrix_to_list
Purpose This function converts an 9 dimensional matrix into a list.
Format LIB_SPF_matrix_to_list <variable> <elements>

Parameters variable

Name of the matrix which should be converted.

elements

By default a matrix has the elements 0-8. There is no need to change that.
This argument is optional. Default value is '8'

Return value String list.


Examples Example 1
set CSYS_matrix [LIB_SPF_matrix_to_list "mom_csys_matrix" "11"]

Creates a list from the 12 dimensional matrix mom_csys_matrix.

9-56 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_mcs_vector
Purpose This function transforms a vector from machine coordinate to work coordinate
system.
Format LIB_SPF_mcs_vector <input_vector> <output_vector>

Parameters input_vector

Input vector in machine coordinate system.

output_vector

Variable name where the transformed vector will be stored.

Return value
Examples Example 1
LIB_SPF_mcs_vector vector1 vector2

Library commands for Post Configurator 9-57


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_modulo_sign
Purpose Used to detect sign rotary motion with modulo axis
Format LIB_SPF_modulo_sign <first> <second> <max_value>

Parameters first

First axis position.

second

Second axis position.

max_value

Maximum allowed value for the rotary axis.


This argument is optional. Default value is '359.9999'

Return value 1 - motion CLW


-1 - motion CCLW
Examples Example 1
set result [LIB_SPF_modulo_sign $mom_prev_out_angle_pos(0) $mom_o

9-58 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_pretreatment_add_var
Purpose Defines an additional variable which should be stored during pretreatment.
You should call this function inside a proc with the name
'LIB_SPF_pt_additional_variables_xxx'
'xxx' can be any name, e.g. mycustompost ->
LIB_SPF_pt_additional_variables_mycustompost.
Format LIB_SPF_pretreatment_add_var <proc_name> <var_name> <eventnumber>

Parameters proc_name

name of proc from which the var value should be stored

var_name

name of the variable to store

eventnumber

0 = operation name and variable name(,array if any)


(Query about LIB_SPF_get_pretreatment)
1 = operation name,event number and variablename(,array if any)
(Query by variablehandling, see also
Documentation_Enhance_Pretreatment)
2 = listname(,array if any)
(Query about LIB_SPF_get_pretreatment 'Listhandling')
This argument is optional. Default value is '0'

Return value
Examples Example 1
LIB_SPF_pretreatment_add_var MOM_start_of_path mom_tool_diameter

Add this command to LIB_SPF_pt_additional_variables_xx to be able to


access mom_tool_diameter via LIB_SPF_get_pretreatment
Example with calling proc
proc LIB_SPF_pt_additional_variables_mycustompost {} {
LIB_SPF_pretreatment_add_var MOM_start_of_path mom_tool_diameter
LIB_SPF_pretreatment_add_var MOM_msys mom_msys_matrix 2
}

From now on mom_tool_diameter and mom_msys_matrix can be accessed


via LIB_SPF_get_pretreatment

Library commands for Post Configurator 9-59


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_pt_exists
Purpose Checks whether a pretreatment variable exists or not
Format LIB_SPF_pt_exists <variable> <sequence> <path_name>

Parameters variable

name of the pretreatment variable wich should be tested

sequence

sequence in which the variable should be tested


see LIB_SPF_get_pretreatment
This argument is optional. Default value is '0'

path_name

see LIB_SPF_get_pretreatment

Return value 1 if variable is existing and 0 if it is not existing


Examples Example 1
if {[LIB_SPF_pt_exists mom_path_name 1]} {

MOM_output_literal "next oper = [LIB_SPF_get_pretreatment


mom_path_name 1]"
} else {
MOM_output_literal "no next oper"
}

9-60 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_pt_exists_not_empty
Purpose Checks whether a pretreatment variable exists and is not empty
Format LIB_SPF_pt_exists_not_empty <variable> <sequence> <path_name>

Parameters variable

name of the pretreatment variable wich should be tested

sequence

sequence in which the variable should be tested


see LIB_SPF_get_pretreatment
This argument is optional. Default value is '0'

path_name

see LIB_SPF_get_pretreatment

Return value 1 if variable is existing and not empty


0 if it is not existing or empty
Examples Example 1
if {[LIB_SPF_pt_exists_not_empty "mom_out_angle_pos,0" 1]} {

set nxt_out_angle_pos(0) [LIB_SPF_get_pretreatment


"mom_out_angle_pos,0" 1]
set nxt_out_angle_pos(1) [LIB_SPF_get_pretreatment
"mom_out_angle_pos,1" 1]
} else {
set nxt_out_angle_pos(0) 0.0
set nxt_out_angle_pos(1) 0.0
}

Library commands for Post Configurator 9-61


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_rad_to_deg
Purpose This function converts an angular value in radians to an angular value in
degrees.
Format LIB_SPF_rad_to_deg <angrad>

Parameters angrad

Angle in radians to be converted.

Return value Angle in degrees.


Examples Example 1
set result [LIB_SPF_rad_to_deg 0.5]

9-62 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_read_oper_attribute
Purpose This function reads operation attribute data from the current operation.
The function has error handling.
Format LIB_SPF_read_oper_attribute <attribute> <default> <ind> <clear>

Parameters attribute

Attribute to be read from tool database

default

This default value will be reurned if reading attribute fails

ind

Indicator whether a warning should be issued if reading of the attribute fails


(1 issue warning, 0 no warning)
This argument is optional. Default value is '0'

clear

Unset the variable if it exists.


This argument is optional. Default value is '0'

Return value The read value will be returned.


If it could not be read, then the default value will be returned.
Examples Example 1
set result [LIB_SPF_read_oper_attribute ATTRIBUTE "The ATTRIBUTE

Library commands for Post Configurator 9-63


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_read_part_attribute
Purpose This function reads part attribute data from the active part.
The function has error handling.
Format LIB_SPF_read_part_attribute <attribute> <default> <ind> <clear>

Parameters attribute

Attribute to be read from tool database

default

This default value will be reurned if reading attribute fails

ind

Indicator whether a warning should be issued if reading of the attribute fails


(1 issue warning, 0 no warning)
This argument is optional. Default value is '0'

clear

Unset the variable if it exists.


This argument is optional. Default value is '0'

Return value The read value will be returned.


If it could not be read, then the default value will be returned.
Examples Example 1
set result [LIB_SPF_read_part_attribute ATTRIBUTE "The ATTRIBUTE

9-64 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_read_programview_attribute
Purpose This function reads programview attribute data.
The function has error handling.
Format LIB_SPF_read_programview_attribute <attribute> <default> <ind> <clea

Parameters attribute

Attribute to be read from tool database

default

This default value will be reurned if reading attribute fails

ind

Indicator whether a warning should be issued if reading of the attribute fails


(1 issue warning, 0 no warning)
This argument is optional. Default value is '0'

clear

Unset the variable if it exists.


This argument is optional. Default value is '0'

Return value The read value will be returned.


If it could not be read, then the default value will be returned.
Examples Example 1
set result [LIB_SPF_read_programview_attribute ATTRIBUTE "The ATT

Library commands for Post Configurator 9-65


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_read_tool_attribute
Purpose This function reads tool attribute data from the active tool library.
Internally the standard MOM-command MOM_ask_library_attributes is used,
but enriched with
error handling.
Format LIB_SPF_read_tool_attribute <attribute> <default> <ind> <cutter_libr

Parameters attribute

Attribute to be read from tool database

default

This default value will be reurned if reading attribute fails

ind

Indicator whether a warning should be issued if reading of the attribute fails


(1 issue warning, 0 no warning)
This argument is optional. Default value is '0'

cutter_libref

No need to change.
This argument is optional. Default value is '0'

Return value The read value will be returned.


If it could not be read, then the default value will be returned.
Examples Example 1
set result [LIB_SPF_read_tool_attribute ATTRIBUTE "The ATTRIBUTE

9-66 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_reset_motions_to_zero
Purpose This command reset the values of the axis to zero. This is useful to calculate
the kinematic
values of the next operation based from zero.
Format LIB_SPF_reset_motions_to_zero <option>

Parameters option

Valid options are:


trans - reset translation values
rot - reset rotary values
all - resrt all values
This argument is optional. Default value is 'default'

Return value Nothing.


Examples Example 1
LIB_SPF_reset_motions_to_zero "rot"

Library commands for Post Configurator 9-67


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_restore_mom_vars
Purpose This function is the correspondance to LIB_SPF_store_mom_vars. It restores
the backup state
created with LIB_SPF_store_mom_vars.
For more information see there.
The previous execution of LIB_SPF_store_mom_vars is necessary in order to
restore the variables.
Format LIB_SPF_restore_mom_vars <variable> <sequence> <path_name>

Return value None.


Examples Example 1
LIB_SPF_restore_mom_vars

9-68 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_round
Purpose This function returns the rounded value of a given value.
The rounding precision is based on the given precision.
Format LIB_SPF_round <value> <precision>

Parameters value

Value to be rounded

precision

Precision to be used for rounding

Return value Rounded value.


Examples Example 1
set result [LIB_SPF_round 1.254512 0.001]

result will be 1.255


Example 2
set result [LIB_SPF_round 1.254512 0.002]

result will be 1.254


Example 3
set result [LIB_SPF_round 1.274512 0.05]

result will be 1.25


Example 4
set result [LIB_SPF_round 1.275512 0.05]

result will be 1.3

Library commands for Post Configurator 9-69


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_set_op_tool_param_condition
Purpose Utility to check the state of global variables at specific position in the postrun
This can be used e.g. to check if mom_tool_number != 0 or if mom_spindle_rpm
> 0 or ...

The Function can be called in 2 ways:

1. To define a new check condition

LIB_SPF_set_op_tool_param_condition param condition exception action msg


frequency calling_proc

param: global variable to be checked


condition: condition to check param against
exception: logical expression which defines an exception for the previous
defined condition
(if logical expresion evaluates to 0 "condition" will be skipped)
action: what should happen if "condition" evaluates to 1
valid options:
ERROR : This will call LIB_GE_error_message with argument "msg" as
argument of LIB_GE_error_message
ABORT : This will call LIB_GE_abort_message with argument "msg" as
argument of LIB_GE_abort_message
all other values: the value of "action" will be treaten as a tcl command.
argument "msg" will be passed as argument to that command
msg: this will be used as argument to "action"
frequency: how often this test should happen
valid options:
ONCE_PER_OP: once for each operation
ONCE_PER_TOOL: once for each tool
other values : end up in default case –> no restriction for the check
(e.g. if the check is done in MOM_before_motion it will happen for each motion)
calling_proc: in which proc of the postprocessor this check should be executed
(the entry points have to be predefined in the postprocessor procedures. the
valid entries are listed in lib_spf_valid_param_check_entires,
see LIB_SPF_op_tool_param_condition)

2. To disable a predefined check

LIB_SPF_set_op_tool_param_condition param calling_proc action

param: global variable to be checked


calling_proc: in which proc of the postprocessor this check should be executed
(the entry points have to be predefined in the postprocessor procedures. the
valid entries are listed in lib_spf_valid_param_check_entires,
see LIB_SPF_op_tool_param_condition)
action: the only valid option is "remove". This will disable the defined check
Format LIB_SPF_set_op_tool_param_condition <param> <args>

9-70 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

Parameters param

global variable to be checked

args

list of arguments. See description above.

Return value None.


Examples Define a new check condition.
LIB_SPF_set_op_tool_param_condition mom_tool_number {<1} {$mom_to

this will generate a check like this:

if {![info exists
lib_spf_op_tool_param_check_marker(mom_tool_number,MOM_before_motion,$::mom_to
{
if {[expr ($::mom_tool_number<1) && !(\$::mom_tool_name ==
\@xmldoc_example_descr@quot;DUMMY\@xmldoc_example_descr@quot;)]}
{
LIB_GE_error_message "THIS IS THE
MESSAGE $::mom_tool_name" "LINE2" ; set
lib_spf_op_tool_param_check_marker(mom_tool_number,MOM_before_motion,$::mom_to
1
}
}
Remove an existing check condition.
LIB_SPF_set_op_tool_param_condition mom_tool_number MOM_before_mo

this will disable the check defined in Example 1

Library commands for Post Configurator 9-71


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

LIB_SPF_store_mom_vars
Purpose This function creates a backup of all current mom_* variables in memory in
order to be able
to restore them later on with LIB_SPF_restore_mom_vars.
The reason fot this functions is that some actions, like e.g. the function
'MOM_cycle_objects'
loses some mom_variables due to the parallel postrun.
Format LIB_SPF_store_mom_vars <variable> <sequence> <path_name>

Return value None.


Examples Example 1
LIB_SPF_store_mom_vars

9-72 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

LIB_SPF_vector_to_array
Purpose This function converts a string list into an 3 dimensional array. It is the
corresponding
function to LIB_SPF_array_to_vector.
Format LIB_SPF_vector_to_array <delist> <variable> <elements>

Parameters delist

Defined string list which should be converted.

variable

Name of the array which should be created.

elements

By default the array indexes 0, 1 and 2 are addressed. There is no need to


change that.
This argument is optional. Default value is '0 1 2'

Return value None. The array is set directly.


Examples Example 1
LIB_SPF_vector_to_array "$MSYS_Origin" "mom_msys_origin"

Creates the array mom_sys_origin and fills it with the values from
MSYS_Origin.
This corresponds to:
set mom_msys_origin(0) "[lindex $MSYS_Origin 0]"
set mom_msys_origin(1) "[lindex $MSYS_Origin 1]"
set mom_msys_origin(2) "[lindex $MSYS_Origin 2]"

Library commands for Post Configurator 9-73


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

MTX3_add
Purpose This function performs a matrix addition.
MTX3_add(m,n,r) r = (m + n) Matrix addition
Format MTX3_add <m> <n> <r>

Parameters m

Variable that holds the first matrix.

Variable that holds the second matrix.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'r'.
Examples Example 1
MTX3_add matrix1 matrix2 result

9-74 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

MTX3_init_x_y_z
Purpose This function initializes a matrix from given x, y and z vectors.
MTX3_init_x_y_z (u, v, w, r) r = (u, v, w) Initialize a matrix from
given x, y and z vectors
Format MTX3_init_x_y_z <u> <v> <w> <r>

Parameters u

Variable that holds the vector 1.

Variable that holds the vector 2.

Variable that holds the vector 3.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'r'.
Examples Example 1
MTX3_init_x_y_z vector1 vector2 vector3 result

result will be the a matrix created from vector1, vextor2 and vector3.

Library commands for Post Configurator 9-75


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

MTX3_is_equal
Purpose This function determines if two matrices are equal within
mom_system_tolerance.
MTX3_is_equal(m,n,a) (m == n) Determine if two matrices
are equal.
Format MTX3_is_equal <m> <n> <count>

Parameters m

Variable that holds the first matrix.

Variable that holds the second matrix.

count

Dimension of the matrices.


This argument is optional. Default value is '9'

Return value 0 - if the matrices are not equal.


1 - if the matrices are equal.
Examples Example 1
set result [MTX3_is_equal matrix1 matrix2]

9-76 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

MTX3_multiply
Purpose This function multiplies two matrices.
MTX3_multiply(m, n, r) r = ( m X n ) Matrix multiplication
Format MTX3_multiply <m> <n> <r>

Parameters m

Variable that holds the first matrix.


v
Variable that holds the second matrix.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'r'.
Examples Example 1
MTX3_multiply matrix1 matrix2 result

Library commands for Post Configurator 9-77


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

MTX3_scale
Purpose This function scales a matrix with factor s.
MTX3_scale(s,r) r = (s*(u)) Scale a matrix by s
Format MTX3_scale <s> <r>

Parameters s

Scale factor.

Name of the matrix to be transposed.

Return value The matrix defined with argument 'r' will be scaled and modified directly.
Examples Example 1
MTX3_scale scale result

9-78 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

MTX3_sub
Purpose This function substracts one matrix from another matrix.
MTX3_sub(m,n,r) r = (m - n) Matrix subtraction
Format MTX3_sub <m> <n> <r>

Parameters m

Base matrix.

Matrix to be substracted.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'r'.
Examples Example 1
MTX3_sub matrix1 matrix2 result

Library commands for Post Configurator 9-79


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

MTX3_transpose
Purpose This function transposes a matrix.
MTX3_transpose(m, r) r = trns(m) Transpose of matrix
Format MTX3_transpose <m> <r>

Parameters m

Variable that holds the first matrix.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'r'.
Examples Example 1
MTX3_transpose matrix result

9-80 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

MTX3_vec_multiply
Purpose This function performs a vector / matrix multiplication.
MTX3_vec_multiply(u, m, w) w = (u X m) Vector/matrix multiplication
Format MTX3_vec_multiply <u> <m> <w>

Parameters u

Variable that holds the vector.

Variable that holds the matrix.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
MTX3_vec_multiply vector1 matrix2 result

Library commands for Post Configurator 9-81


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

MTX3_x
Purpose This function returns the first column vector (X-vector) of a matrix.
MTX3_x(m, w) w = (1st column) First column vector of matrix
Format MTX3_x <m> <w>

Parameters m

Variable that holds the matrix.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
MTX3_x matrix result

9-82 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

MTX3_y
Purpose This function returns the second column vector (Y-vector) of a matrix.
MTX3_y(m, w) w = (2nd column) Second column vector of matrix
Format MTX3_y <m> <w>

Parameters m

Variable that holds the matrix.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
MTX3_y matrix result

Library commands for Post Configurator 9-83


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

MTX3_z
Purpose This function returns the third column vector (Z-vector) of a matrix.
MTX3_z(m, w) w = (3rd column) Third column vector of matrix
Format MTX3_z <m> <w>

Parameters m

Variable that holds the matrix.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
MTX3_z matrix result

9-84 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

OUTPUT_adr
Purpose This function provides a way to check nc code addresses before writing the to
the nc code.
It gives you the power to do a preprocess modality check.
The function checks if the current value of an address, defined in the corrent
post processors .def-file,
is equal to a specified value.
You may even check multiple addresses on specified values at one time. If at
least one address value
differs from the check value, the function will return 1 which means that the
addresses have to be
output.
Format OUTPUT_adr <args>

Parameters args

define at least one pair of arguments:


address_name and value_to_check

Return value 1 - if addresses are not equal to the checked values and thus need to be output.
0 - if no output required
Examples Example 1
if {[OUTPUT_adr fourth_axis $mom_out_angle_pos(0) fifth_axis $mom

Library commands for Post Configurator 9-85


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_add
Purpose This function performs a vector addition.
VEC3_add(u,v,w) w = u + v Vector addition
Format VEC3_add <u> <v> <w>

Parameters u

Vector 1.

Vector 2.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
array set vector2 "0 10.0 1 0.0 2 0.0"
VEC3_add mom_pos vector2 result

result will be the current mom_pos + 10 in X direction.

9-86 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_angle_3points
Purpose This function calculates the angle between three points.
Format VEC3_angle_3points <_u> <_v> <_w>

Parameters _u

Point 1

_v

Intermediate point

_w

Point 2

Return value Resulting angle in radians.


Examples Example 1
set result [VEC3_angle_3points p0 p p1]

result will be the angle between p0-p-p1 in radians.


Example 2
VEC3_init_s 0 10 0 l1
VEC3_init_s 0 0 0 intermediate
VEC3_init_s 10 0 0 l2
set result [expr [VEC3_angle_3points l1 intermediate l2] * $RAD2D

result will be 90.0

Library commands for Post Configurator 9-87


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_angle_between
Purpose This function calculates the angle between two vectors. The input vectors do
not need
to be unitized.
Format VEC3_angle_between <vec1> <vec2> <return_unit>

Parameters vec1

Vector 1

vec2

Vector 2

return_unit

deg - return in degrees


rad - return in radians
This argument is optional. Default value is 'deg'

Return value resulting angle.


Examples Example 2
set result [VEC3_angle_between vector1 vector2 deg]

result will be the angle in degrees.


Example 2
VEC3_init_s 10 0 0 l1
VEC3_init_s 0 10 0 l2
set result [VEC3_angle_between l1 l2]

result will be 90.0

9-88 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_cross
Purpose This function calculates the vector cross product.
VEC3_cross(u,v,w) w = ( u X v ) Vector cross product
Format VEC3_cross <u> <v> <w>

Parameters u

Vector 1.

Vector 2.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
array set vector1 "0 10.0 1 20.0 2 0.0"
array set vector2 "0 -10.0 1 -20.0 2 0.0"
VEC3_cross vector1 vector2 result

result will be the cross product between vector1 and vector2.

Library commands for Post Configurator 9-89


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_dist_point_line
Purpose This function calculates the shortest distance between a given point and a line.
It is the distance from the point perpendicular to the line.
Format VEC3_dist_point_line <_u> <_v> <_w>

Parameters _u

Point in space

_v

Point 1 on the line (could be the startpoint, but not necessary)

_w

Point 2 on the line (could be the endpoint, but not necessary)

Return value Distance from the point perpendicular to the line.


Examples Example 1
set result [VEC3_dist_point_line point linestart lineend]

result will be the distance from the point perpendicular to the line.

9-90 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_dot
Purpose This function calculates the vector dot product of normalized input vectors.
VEC3_dot(u,v) (u dot v) Vector dot product (u & v normalized)
Format VEC3_dot <u> <v>

Parameters u

Normalized vector 1.

Normalized vector 2.

Return value Resulting dot product.


Examples Example 1
array set vector1 "0 1.0 1 0.0 2 0.0"
array set vector2 "0 0.0 1 1.0 2 0.0"
set result [VEC3_dot vector1 vector2]

result will be the dot product between vector1 and vector2.

Library commands for Post Configurator 9-91


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_dot_A
Purpose This function calculates the vector dot product. Input vectors don't need to be
normalized.
VEC3_dot_A(u,v) (u dot v) Vector dot product (u & v not necessarily
normalized)
Format VEC3_dot_A <u> <v>

Parameters u

Vector 1.

Vector 2.

Return value Resulting dot product.


Examples Example 1
array set vector1 "0 10.0 1 20.0 2 0.0"
array set vector2 "0 -10.0 1 -20.0 2 0.0"
set result [VEC3_dot_A vector1 vector2]

result will be the dot product between vector1 and vector2.

9-92 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_init
Purpose This function initialize a vector from a coordinate value. This is useful to create
a vector
from given variables.
VEC3_init(x,y,z,w) w = (x, y, z) Initialize a vector from
coordinates (passed as variables)
Format VEC3_init <x> <y> <z> <w>

Parameters x

Variable that holds the X-value.

Variable that holds the Y-value.

Variable that holds the Z-value.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
VEC3_init x y z result

result will be the a vector created from x, y, z.

Library commands for Post Configurator 9-93


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_init_s
Purpose This function initialize a vector from scalar values. This is useful to create a
vector
directly from given values.
VEC3_init_s(x,y,z,w) w = (x, y, z) Initialize a vector from
coordinates (passed as scalars)
Format VEC3_init_s <x> <y> <z> <w>

Parameters x

Variable that holds the X-scalar.

Variable that holds the Y-scalar.

Variable that holds the Z-scalar.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
VEC3_init_s 1 1 0 result

result will be the a vector created from the passed scalar.


Example 2
VEC3_init_s x y z result

result will be the a vector created from x, y, z.

9-94 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_is_equal
Purpose This function checks if two given vectors are equal within a given tolerance.
VEC3_is_equal(u,v,tol) (||(u-v)|| < tol) Are vectors equal?
Format VEC3_is_equal <u> <v> <tol>

Parameters u

Vector 1

Vector 2

tol

Tolerance within the equality will be detected.


If tolerance is not specified, mom_system_tolerance will be used instead.
This argument is optional. Default value is '0'

Return value 1 if vectors are equal.


0 if vectors are not equal.
Examples Example 1
set result [VEC3_is_equal mom_pos mom_prev_pos]

result will be 1 if both vectors are equal

Library commands for Post Configurator 9-95


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_is_parallel
Purpose This function checks if two vectors are parallel or not.
Format VEC3_is_parallel <u> <v>

Parameters u

Vector 1

Vector 2

Return value 1 - if vectors are parallel


0 - if vectors are not parallel
Examples Example 1
set result [VEC3_cross vector1 vector2]

9-96 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_is_zero
Purpose This function checks if a given vector is zero.
VEC3_is_zero(u,tol) (|| u || < tol) Is vector zero?
Format VEC3_is_zero <u>

Parameters u

Vector

Return value 1 if vector is zero.


0 if vector is not zero.
Examples Example 1
set result [VEC3_is_zero mom_pos]

result will be 1 if vector is zero.

Library commands for Post Configurator 9-97


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_mag
Purpose VEC3_mag(u) ( || u || ) Vector magnitude
Format VEC3_mag <u>

Parameters u

Vector

Return value Vector magnitude.


Examples Example 1
set result [VEC3_mag mom_pos]

result will be the magnitude of mom_pos.

9-98 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_negate
Purpose This function negates a given vector.
VEC3_negate(u,w) w = (-u) Vector negate
Format VEC3_negate <u> <w>

Parameters u

Vector to negate.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
VEC3_negate vector1 result

result will be the negated vector of vector1.

Library commands for Post Configurator 9-99


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_rotate_arbitary_axis
Purpose This function rotates a vector around an arbitary axis.
Format VEC3_rotate_arbitary_axis <axis> <angle> <input_vector> <output_vect

Parameters axis

Vector defining the rotation axis (will be unitized in proc)

angle

Rotation angle in radians

input_vector

Vector to rotate

output_vector

Rotated vector (result)

Return value The result will be stored in the variable that has been defined with argument
'output_vector'.
Examples Example 1
set rot_vec(0) 1 ; set rot_vec(1) 1 ;set rot_vec(2) 0
set ang [expr 65. * $DEG2RAD]
set point(0) 123.1 ; set point(1) 1.98 ; set point(2) 44.9
VEC3_rotate_arbitary_axis rot_vec $ang point new_point

new_point is the the result when rotating point 65 degrees around rot_vec

9-100 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_scale
Purpose This function scales a vector by a given scale.
VEC3_scale(s,u,w) w = (s*u) Vector scale
Format VEC3_scale <s> <u> <w>

Parameters s

Variable with the scale.

Vector to be scaled.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
VEC3_scale scale vector1 result

result will be the scaled vector of vector1.


Example 2
set factor 2
VEC3_scale factor mom_pos result

Result contains mom_pos, scaled by factor 2.

Library commands for Post Configurator 9-101


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VEC3_sub
Purpose This function substracts one vector from another vector.
VEC3_sub(u,v,w) w = u - v Vector subtraction
Format VEC3_sub <u> <v> <w>

Parameters u

Base vector.

Vector to be substracted.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
Examples Example 1
VEC3_sub vector1 vector2 result

result vector1 - vector2.

9-102 Library commands for Post Configurator


LIB_STANDARD_POST_FUNC

VEC3_unitize
Purpose This function results the unit vector (or normalized vector) of an given vector in
space.
VEC3_unitize(u,w) *len = || u || Vector unitization
Format VEC3_unitize <u> <w>

Parameters u

Vector in space.

Variable name where the result will be stored.

Return value The result will be stored in the variable that has been defined with argument 'w'.
The function itself returns the length of the given input vector.
Examples Example 1
set len [VEC3_unitize vector1 result]

The variable result will be the unit vector of vector1. The varible len will be
the length of vector1.

Library commands for Post Configurator 9-103


Chapter
Chapter 9: 9: LIB_STANDARD_POST_FUNC
LIB_STANDARD_POST_FUNC

VMOV
Purpose This function copies a vector or matrix to an other one.
Format VMOV <n> <p1> <p2>

Parameters n

Dimensions to copy. For vectors there are 3, for matrices 9 elements.

p1

Variable name of vector or matrix to copy.

p2

Variable name of target vector/matrix.

Return value The result will be stored in the variable that has been defined with argument
'p2'.
Examples Copy vector
VMOV 3 mom_pos memo_pos

This copies mom_pos(0), mom_pos(1), mom_pos(2) to memo_pos(0..2)


Copy matrix
VMOV 9 matrix1 matrix2

This copies motrix1 to matrix2

9-104 Library commands for Post Configurator


Siemens Industry Software

Headquarters
Europe
Granite Park One
Stephenson House
5800 Granite Parkway
Sir William Siemens Square
Suite 600
Frimley, Camberley
Plano, TX 75024
Surrey, GU16 8QD
USA
+44 (0) 1276 413200
+1 972 987 3000

Asia-Pacific
Americas
Suites 4301-4302, 43/F
Granite Park One
AIA Kowloon Tower, Landmark East
5800 Granite Parkway
100 How Ming Street
Suite 600
Kwun Tong, Kowloon
Plano, TX 75024
Hong Kong
USA
+852 2230 3308
+1 314 264 8499

About Siemens PLM Software

© 2016 Siemens Product Lifecycle Management


Siemens PLM Software, a business unit of the Siemens
Software Inc. Siemens and the Siemens logo are
Industry Automation Division, is a leading global provider
registered trademarks of Siemens AG. D-Cubed,
of product lifecycle management (PLM) software and
Femap, Geolus, GO PLM, I-deas, Insight, JT, NX,
services with 7 million licensed seats and 71,000 customers
Parasolid, Solid Edge, Teamcenter, Tecnomatix and
worldwide. Headquartered in Plano, Texas, Siemens
Velocity Series are trademarks or registered trademarks
PLM Software works collaboratively with companies
of Siemens Product Lifecycle Management Software
to deliver open solutions that help them turn more
Inc. or its subsidiaries in the United States and in other
ideas into successful products. For more information
countries. All other trademarks, registered trademarks
on Siemens PLM Software products and services, visit
or service marks belong to their respective holders.
www.siemens.com/plm.

You might also like