The Program Group
name in an NX CAM
program is entered as the four digit program number followed by the program name. How can this number and name be extracted when generating output in a Post Builder
The string range
command is used to grab the specified digits of the variable. The first four digits are read starting at digit 0 and ending at digit 3. A spacer character is added to separate the two and is ignored. Digit 5 through the last digit is read. The end
word is used to indicate the last digit.
The NC output will look something like the following when complete. Notice that an O
is output before the program number and the program name is enclosed in control characters.%
N0010 G40 G17 G90 G71
N0020 G91 G28 Z0.0
Below is the TCL
code used to generate the output. A Custom Command
with this code is placed in the Start of Program
set co "$mom_sys_control_out"
set ci "$mom_sys_control_in"
#DIGIT 1 TO 4
set out1 "O[string range $mom_parent_group_name 0 3]"
#DIGIT 6 TO END
set out2 "$co[string range $mom_parent_group_name 5 end]$ci"
Notes and References
OS Version: n/a