ANEXO I: Autorización de publicación
1. TITULO: Percepción de imagen y uso de marketing de la empresa Mega We Care –Santiago de Surco, 2017
PostHaste can output NC program subroutines or subprograms (we will refer to these as 'subs'...) for either of two reasons:
1. To automatically create subs to achieve 'multiple-part programs'
(where each tool's motion is put into a separate sub, and then the 'main' program consists of tool changes and sub calls), or
2. If your incoming CL data includes subs, and you simply want the post to output them accordingly.
7.6.1 Basic Fanuc setup example
In either of the above cases, setting up your template to output subprograms or subroutines (commonly referred to as “subs”) is usually quite simple. (We also give you ways to handle quite a few variations from the 'basic' setup shown in this example.) However, before getting into all of the details, here is an example showing what you would add to a typical Fanuc post template to add sub support.
Just add the SubCall, SubStart and SubEnd sequences (and make sure the letters you need are formatted in the 'letter format' section of your template):
SubCall Describes the code used to call subs from the 'main' program.
G0 G[Work] X[H] Y[V]
Z[D]
M98 P[Sub]
end
SubStart The code that appears at the top of each sub.
O[Sub]
G0 X[H] Y[V]
End
SubEnd The code at the end of each sub.
M99 End
Between Code 'between' the last sub and the start of the 'main program' portion of the file.
O[Program#] (See note below) End
... that's all you have to do! PostHaste will apply these sequences whenever they are needed in the code to output your subs properly.
Note: By default, PostHaste will output the subs before the main portion of the program. If you want the subs to be output after the main portion, use the Subs1st? switch (discussed below).
7.6.2 Automatic multiple part programs
This is an exceptionally useful feature of PostHaste, as many CAM systems do not do a good job of producing compact NC programs for 'multiple part' setups... PostHaste will do it for you.
If your template contains the above sequences, PostHaste will automatically generate a multiple part program if there are no subs found in the CL file.
When PostHaste creates a multiple part program, it creates a sub for each tool's motion. Therefore if your job uses 9 tools, there will be 9 subs generated. (If any tool is repeated later in the job, another sub will be made for that section of the program as well.) PostHaste then produces a 'main' program that (after each tool change) calls the tool's corresponding sub at each work offset. The number of work offsets will match the number of parts. This is an important point, because you are limited to the number of parts by the number of work offsets that are available on the machine.
When a multiple part program is being generated, the post will ask you the following questions:
• “How many parts are there?”
Remember - you are limited by the number of available work offsets.
• “What is the first work offset number?”
Work offsets will 'increment up by one' for each part. If you indicate 54 as your first offset, the first part will be G54, the second part will be G55, and so on. (You may use G55 or G56 [etc.] as the 'first' offset if you like - but just remember that by doing so, you are reducing the total number of parts you can cut because of the 'upper limit' of you available work offsets.)
• “Do you want to 'reverse' the order of the offsets for each tool?”
On setups where several parts are spread out over the length of a machine table, there is less rapid motion required if you 'reverse' the order of the offsets. For example, the first tool would work in the order from G54 to G59 (e.g. 'left to right'), then the second tool would start with G59 and work back to G54 (working from right to left). This feature eliminates the 'long' rapid moves from one end of the table to the other after each tool change, and thus reduces the overall cycle time on the job. (The time savings are especially noticeable on jobs with 'low cutting time per tool' and a relatively large number of tools.)
7.6.2.1 Sub numbering
For multiple part programs, the [Sub] number (the 'O' number at the start of the subs) is automatically incremented (starting at 1) each time a new sub is output. It is usually a good idea to 'add' the sub numbers to the [Program#] variable so that the subs will follow directly after your main program in the machine's 'directory' page. In other words, if your 'main' program number ([Program#]) is 2000, you would want the first sub to be 2001, the second 2002, etc. To do this, simply add the [Program#] to the [Sub] in your SubStart and SubCall sequences as shown here:
SubCall Describes the code used to call subs from the 'main' program.
G0 G[Work] X[H] Y[V]
M98 P[Sub]+[Program#]
end
SubStart The code that appears at the top of each sub.
O[Sub]+[Program#]
G0 X[H] Y[V]
End
7.6.3 Sequences, variables and switches used for subs
The output of all code related to subs is controlled in the template by using the items in the table below.
This table describes them briefly, and details follow in the next sections.
Items: Type: Notes / Description: Mandatory (for subs to be output properly)?
SubStart Sequence Code output at the start of each sub. Yes SubEnd Sequence Code output at the end of each sub. Yes SubCall Sequence Code required to call a sub. Yes Between Sequence Describes any code that needs to be output
between the 'main' portion of the program and the subs.
No. (Only used for machines that require some special code to separate the 'main' portion of the program file from the 'subs' portion.)
[Sub] Variable Outputs the “O” number of the sub. Either [Sub] or [SubLine] must be used.
[SubLine] Variable Outputs the number of the N word (line number) of the sub. See section 7.6.3.3 for details.
Either [Sub] or [SubLine] must be used.
[Times] Variable Usually the L number on the M98 (sub call) line in Fanuc programs. See section 7.6.3.3 for details
Not needed if you are only using subs for multi-part formats. This is needed if the CL data ever indicates that a sub is to be repeated.
RenumSubs? Switch See explanation below in section 7.6.3.4 No (N is the default condition) SpliceSubs? Switch Set this switch to 'N' if you want the subs to be
output in a separate file (or files) from the main program. See section 0 for details
No (Y is the default condition)
Subs1st? Switch See explanation below in section 7.6.3.4 No (N is the default condition)
7.6.3.1 SubCall sequence
The SubCall sequence shows how the subs will be called from the “Main” portion of the NC program. (See the 'basic' example in section 7.6.1 above.)
SubCall Describes the code used to call subs from the 'main' program.
G0 G[Work] X[H] Y[V]
M98 P[Sub]+[Program#]
end
7.6.3.2 SubStart, SubEnd, and Between sequences
The SubStart and SubEnd sequences are used to describe how the subs start and end, respectively - as shown in the example above.
The Between sequence is used to describe any special code that should go between the subs and the main program code (Use the Subs1st? switch [see below] to direct PostHASTE to put the subs either before or after the “main” portion of the program).
Example:
These sequences and switches (in addition to the SubCall, SubStart and SubEnd sequences in the example above) are used for some Fadal formats...
Subs1st? Y
Between M17 M30 End
...because some Fadal machines require that the subroutines come before the main program and that there is a M30 between the 'subs' and the 'main'.
7.6.3.3 [Sub], [SubLine] and [Times] (sub variables)
The following variables give you control of formatting of NC programs using routines & Sub-programs:
The variables: What they do:
[Sub] This is the value of the sub number, and can be used in the SubStart and SubCall sequences as in the above examples.
[SubLine] This is used in the SubCall sequence in place of [Sub] to call a sub by its “line” (sequence) or “N” number (as opposed to using the sub number itself).
[Times] This is used to designate the number of times a sub repeats. This should only be used in the SubCall sequence as shown above.
Here's an example of how you would use the [SubLine] and [Times] variables in your SubCall sequence:
SubCall
M98 P[SubLine] L[Times]
end
7.6.3.4 Switches used to control subs
Here are more details on the formatting switches have been added to help you control other actions that are significant when using subs:
Formatting switches: What they do:
RenumSubs? Y Use this line to indicate that you want the sequence (N) numbers to be reset at the beginning of each sub and at the start of the “main” program section. You may also use an N to prevent this action.
Notes:
1. If this line is not used, then the default condition is not to restart the numbers (as if you used the N option).
2. Do NOT attempt to use the Y option if you are using the [SubLine] variable (discussed above).
Subs1st? N Use this line to indicate that you want the subs to be placed after the main portion of the program - change the N to Y to output the subs before the main program.
NOTE: If this line is not used, then the default condition is to place the subs before the main portion of the program (as if you had used the Y option).
SpliceSubs? N See below...
SpliceSubs? switch
This switch can be used to tell the post to NOT include any subroutines in the main NC program file.
Typically, when subroutines are used, PostHaste includes them in the main output (.NCC) file. To do so, it first writes the NC code contained in each sub into a temporary file - one for each sub - then when all of the code (for subs and the 'main' program) has been generated, PostHaste automatically 'splices' all of those temporary files together to form the final output file. If you do NOT want the subs to be 'spliced' together with the main program, use this switch setting to prevent it:
SpliceSubs? N
The most common reason you would use this is if you want each sub (or all subs) to be output to it's own separate file (instead of into the main file). In order to do this, you would need to use File commands to control the output of the various 'subs' and 'main' portions of your code into the files of your choice. Here is an example of one way you could do this:
SpliceSubs? N Do NOT splice the subs into the main file because each sub is put into in separate file (example: MyPart-SUB2.DAT ).
SubCall
File on Main only
M98 'P' {CLName} '-SUB' [Sub] << ...each sub is called by the FILE NAME of the sub (less the '.DAT').
end SubStart
File alias 1 {CLName} '-SUB' [Sub] '.DAT' << Each sub file name based on the CL name and sub #.
File empty 1
File on 1 only << (Each sub is written into the file named above on the File alias line.) end
SubEnd M99
File on Main only << After each sub is completely written, make sure that you go back to writing to the main file.
end
NOTE: Be careful using this switch! If you tell the post...
SpliceSubs? N
...without properly routing the subs into the files you want (by using the File commands as demonstrated in the above example), then your subroutines will simply not exist in the final NC program!
For more information on subroutines (including automatic generation of multiple-part programs) see section 7.6.
For more information on use of the File commands, see section 5.3.4.