By changing the SWITCHES, SETTINGS, and DEFAULTS, most of the customizing can be done. There may be some extra added things that need to be done to get it to completion. This is extra customization and can be covered in a class or with extra guidance.
The switches are either set to one or zero.
They signify a certain state or action.
Use_tdata: Used to specify how tool number is determined.
= 0: Start at tool #1 and increment at each tool change.
= 1: Pull the "CNC tool-pocket number:" field from the tool entity in the database.
Do_nxt: Specifies that the next tool is pre-staged.
= 0: No pre-staging of the next tool.
= 1: Output the next_tool number to use for pre-staging.
NOTE: If Use_tdata and Do_nxt are both 1 then, the "CNC tool-pocket number:" field of the next tool in the tasks list is used as the next tool number.
One_pkt: Determines if a path group with one path is to be cut as a single contour or as a path group.
= 0: Call out the MACRO for cutting a path group.
= 1: Call out the MACRO for cutting a contour.
Do_safe: Call a safe start MACRO for canned cycles. A safe start is usually done in a MACRO canned cycle. The most common reason to use a MACRO for a canned cycle is so that a pre-position move can be done before the length offset is applied. This is unnecessary with AMO execute scripts.
= 0: Output canned cycle call only.
= 1: Output safe_start MACRO call with a repeats value using the variable Tool_ch.
There is a section for setting string variables. These variables are defined by COM statements. This way the variable values are known throughout the execute script.
NOTE: Extra variables can be defined in the COM statements but ALL the COM statements with that label must have the new definition added.
Lencomp$: Insert the string representing the calculation to set the TurboPost variable Length_comp.
This will be output at every tool change.
Lencomp$= "Tool_num" in the execute script will be;
ASSIGN: Length_comp= Tool_num; in the command_file.
Diacomp$: Same as length comp except it is output only for Milling.
Diacomp$= "Tool_num+30" in the execute script is;
ASSIGN: Dia_comp= Tool_num+30; in the command_file.
There is a section for setting numeric variables.
These variables are defined by COM statements.
This way the variable values are known throughout the execute script.
The defaults can be set for both Inch and Metric.
(See SETTINGS: from an explanation of COM's)
Zfeed: Set the default for the Milling Zfeed rate.
Ret_3d: The default value of Retract_z to be output for 3D.
The following is some advice on what to change in the execute script.
AMO is a custom product therefore, each users need is different.
POST NAME - There is a line which contains the function RecordPostName.
This line needs to have the name of the TurboPost for which this AMO script is written. DO NOT change the /weber/post_formats to /usr/weber/post_formats this part is fine.
MACROS - If AMO is outputting a MACRO name different from the one that this TurboPost uses then, change the name it outputs.
SAMPLE : Find the line by looking for the word MACRO or looking for the MACRO name that is being output. You can change the output to the command_file when you find a line such as the following:
Stat= OutputCmdBuff("MACRO: s_up",0)
OutputCmdBuff(<String>,Clear) Command: This command is the one which puts <String> out to the command_buffer file which then is placed in the command_file. The Clear field is 1 or 0.
USAGE: 1 clears the command_buffer file and 0 concatenates the string to the end of the file.
WHEN THIS LINE CONTAINS A 1, that line MUST BE the first line in that cycle.
Any lines that go above this line must have the Clear set to 1 and the line that had it must change to a 0.
Any line with New_cb must be treated as if it were a 1.
Except, New_cb is substituted for 1.
Example:
This is the first output for a tool change:
Stat=OutputCmdBuff("ASSIGN: Tool_desc= """&Data_id$&""";",1)
If the Prog_desc HAD TO (otherwise put it after this line) come before the Tool_desc then they would look like this:
Stat=OutputCmdBuff("ASSIGN: Prog_desc= PROGRAM;",1)
Stat=OutputCmdBuff("ASSIGN: Tool_desc= """&Data_id$&""";",0)
Another Example would be if the first line were conditional:
IF Do_safe THEN
E1=GroupElement(Group,1)
Hnum=HoleNumber(E1)
Stat=OutputCmdBuff("ASSIGN: Start_hole= 1;",New_cb)
Stat=OutputCmdBuff("MACRO: safe_start",0)
New_cb= 0
END IF
Stat= OutputCmdBuff("ASSIGN: Group_name= HOLE GROUP;",New_cb)
Stat= OutputCmdBuff("ASSIGN: Groupon",0)
In this case New_cb is used twice.
Since there is no guarantee that the Start_hole line will be executed.
So if Do_safe is TRUE then the buffer is cleared and the Start_hole line is output.
Also, New_cb is blanked out so that the Group_name line doesn't clear out the buffer and lose the line that was just put in there.
If Do_safe is FALSE then the Start_hole line is not executed and New_cb retains its value for the Group_name line.
Since the Group_name line is unconditional, all other lines after that (Groupon) will have 0 in the Clear field.
CANNED CYCLES - In the SUB Drilling you will find the canned cycle definitions. The SELECT statement can be broken into cases for specific tools. Each CASE has a defintion for what to do for that tool. Any variables such as Peck for example should be set in the CASE statement with that individual cycle.