III .RESULTADOS
3.5 Contratación de hipótesis
3.5.1 Hipótesis general
3.5.2.5 Hipótesis especifica 5
In short, the 5 types of File commands give you control over both multiple output streams (or files) and multiple output styles that can either be routed into individual (or multiple) output files, or reorganized (in any order) into a single file. (If you didn't understand that, it's OK - it can be complicated. We'll explain below...)
What the File commands can do for you
The File commands lets you route any or all selected lines of output data (generated by the sequence lines) into one or more separate output files simultaneously. Then, you can either leave the output distributed among the individual files. or, if you like, you can merge some or all of the files back together into a single (or even more than one) final output file.
This not only gives you a high degree of control over how the final output file(s) are handled, but also over how the CL data gets processed; you can process the same section of CL data in several different ways, and then have the resulting output appear in multiple (different) locations within the same final program file (or in separate files).
For example, it enables you to do these types of things (in addition to many more)...
- Post the same CL data in several ways, then either
- 'channel' the output of the different kinds of processing into different files, or - 'join' the separate files into a single finished NC program.
Example: to create a 'tool list' at the top of your programs.
- 'Break' the code into 2 or more files.
(e.g. due to machine 'line number' limitations.) - 'Sort' the post's output into several separate files
Example: every operation (or the motion for each tool) can be output to its own file.
- Post programs for multiple machines simultaneously.
- Create multiple output files for machines that require more than one file to perform a machining job.
You can temporarily use up to 100 individual output files simultaneously in addition to the 'main' file. (You can actually create more than 100 files, but you can read or write only 100 of them simultaneously.)
The main file is the 'usual' final program file that the post creates when you don't use any File commands (usually named the same as the incoming CL file, but with the .NCC extension).
How to use the File commands
Per the usage examples in the table below, the word File is always followed by 2 parameters:
- the 1st parameter is one of the six 'options' (Alias, Empty, Off, On, Insert or Edit), and then - a file number.
The file number can be...
- a number from 1 to 100 (inclusive) or
- a [variable] or an equation that evaluates to an integer from 1 to 100 (inclusive), or - it can be the word 'Main'. (This lets you control the 'main' output file.)
At this point, since you can only specify file by its number (not its 'name'), you may be wondering how to create a file with a specific name... that's what the File Alias option is for. Read about it (and all of the other options) in the table below.
Notes re the table below:
1. The File command options are listed in the order that they are most likely to be used.
2. Remember - in the examples here, the 1 can instead be a [variable] or equation or the word Main .
Option Usage examples Purpose
Alias * File Alias 1 'This file.txt' ...or...
File Alias [Val19] 'This.txt' ...or...
File Alias [Tool]+5 {CLName} '.cmd' ...or...?
Use this only if you want to indicate a specific file name that you want to use as an 'alias' of the file number indicated. That is all that this command does. (It does not 'empty' the file or turn it on or off.)
From then on, simply use the file number (in this case, 1 ) for any Empty, On, Off, Edit or Insert operations; the post automatically keeps track of the actual file name. (This prevents you from having to have the file name text in multiple locations in your template [which could lead to lots of confusion in the case of file names that are based on variables!].) Note: If you just want to use a 'temporary' file (and you don't care what its name is), then do NOT use the File Alias command.
Because the Alias option does nothing but substitute a name for the file number, you will almost always follow every File Alias _ command with a matching...
- File Empty _ command (to create a new, empty file) or a
- File Insert _ command (to read the contents of a certain file into the other files that are 'on' [see 'File On' below]).
---The first example on the left will cause any subsequent operations on file 1 to actually operate on the file called This file.txt instead of the ..\Temp\1 file.
As you can see from the other examples on the left, the file name can be a 'hard-coded file name' or a {text variable} or any combination of 'hard-coded text', {text variables} and even [Numeric variables].
Numeric variables (such as [Tool] or [RotAngle]) will be formatted to output the 'simplest' text that represents the number – no leading or trailing zeroes, no trailing decimal points – regardless of any number formatting used elsewhere in the template. ( Examples:
0 or 1 or 180 or .5 )
Note: If you don't specify a folder, the file will be created in the same folder as your main output file.
Note: Don't use the Alias option more than once per file number (because this will 'overwrite' the file) – unless you first use the Insert option to 'copy' its contents into another file(s).
Empty * File Empty 1 ...or...
File Empty [Tool] ...or...
File Alias [Val3]+1 ...or...?
Empty creates a file that is initially empty; use Empty when you just need to use a 'temporary' file and you don't care what its name is. For example, when you just need to store some output that will be 'inserted' back into the main (or other) file later.
Note: Since the Empty option only uses a number (it doesn't let you specify a file name), it will create a file called (in this case) 1 (with no extension - in the ..\Temp folder underneath the folder that PostHaste.exe is in).
NOTE: You MUST use Empty when you want to start with a 'fresh' (empty) file. If you do NOT use Empty (i.e. if File ON 1 is executed before File Empty 1), then you will be appending information to the (existing) .. \Temp\1 file!
Option Usage examples Purpose
Use the ON option when you want to start (or resume) outputting data to a specific file number. Any sequence lines executed after a File On _ command is executed will be output to the file number specified (as well as any other files that are also in the 'on' state) until the post executes a corresponding File Off _ command. (The file will also be turned off if a 'File On... ONLY' command is processed for any other file number [see “the ONLY option”
below].
Note: The 'Main' file is ON by default when the post starts processing, so if you don't want it on to start with, then you must turn if off with a File Off Main command in your StartCode sequence. (Or, you can use a 'File On... ONLY' command to turn on 'only' some other file – thus turning off the main file.)
The “ONLY” option:
You should make it a habit to use the ONLY option whenever applicable in your FILE ON commands. Adding 'ONLY' to the end of the line turns off all other files, leaving 'only' the specified file in the 'on' state. (This eliminates the need for most FILE OFF commands, which makes your template much cleaner looking and easier to understand.) In other words, use the ONLY option when you only want 1 file on at a time.
(Obviously, if you need more that one file on at a time, you would NOT use ONLY.) Off File Off 1 ...or...
File Off Main ...or...
File Off [Val12]+[Sub] ...
This is the opposite of the ON option: use the OFF option when you want to stop including the upcoming code in a certain file (or files). This condition also persists until a File ON _ command is processed for the same file number.
Insert File Insert 1 ...or...
File Insert [Val4]
Use this to copy the contents of any file into any other file(s) that are ON. See the EndCode sequence in the 'tool list' example below (section 5.3.4.1) for a good example of how this is done.
NOTE: If you don't turn OFF a file before you 'insert' it into another, the post will automatically turn it off first – to prevent it from attempting to 'insert into itself'. (After the INSERT operation, the file will be left in the OFF condition.)
Edit File Edit 1 ...or...
File Edit [Tool] This option causes the post to 'execute' the file – which in most cases should result in it being opened by an editor (such as WordPad, NotePad or Microsoft Word, etc.) Depending on how you have your system's Windows' File associations set up, this could cause a file to be opened in any application you choose ( - a communications package, for instance, to send a NC program to one of your machines). To set up Windows' File associations, use Windows Explorer and go to the Folder Options choice in the View menu.
(in Windows 2000 and XP, the Folder Options choice is in the Tools menu.)
---You may have multiple File Edit _ commands in your post, and you can even 'edit' the same file number more than once – but only if you use File Alias commands executed somewhere between the File Edit commands so that the file number is 'reassigned' to different file names - so that you are not trying to 'edit' the same physical file more than once.
NOTES:
1. This command will NOT execute the file unless PostHaste's AutoOpen feature is enabled. (See the 'AutoOpen?' switch in the PostHaste.CFG file [Appendix A of the Getting Started manual].)
2. Since the AutoOpen feature automatically opens the 'main' file, you will never need to use the command File Edit Main
* Important notes re the Alias and Empty commands...
1. The Alias and Empty commands do NOT turn a file on.
- Alias does nothing more than associate a file name with a file number, and - Empty simply empties a file and get it ready for use later in the process.
(You must specifically give a File On _ command to start outputting to any file.)
2. The Empty and Alias commands cannot be used with 'Main' file. The post automatically creates an empty 'main' (final program) file (just as it always does when you are not using File commands).
5.3.4.1 'File' usage example: Creating a 'tool list' at the top of the program.
This example template excerpt in the chart below uses 'temporary' files to process 2 parts of the output, then merges them (in EndCode) back into the main output file - to output a final file that starts with a 'tool list' (consisting of the 'operation comments' that are in the CL data) like this:
%
Note: For brevity, the example below doesn't show the entire template - only the applicable sequences.
... Comments op comments, then
File off 1 turn off the 'tool list' file. Comments op comments, then
File off 1 turn off the 'tool list' file.
File On Main Only << Finally, turn on the main (_.NCC) file, (Note that this turns OFF the 'bulk' file [#2]).
File Insert 1 then append the Tool list, and
Note: The example above is an excerpt from the Tool List.pm3 file that is included in the standard post format library.