This is written by Peter Smid
How Large Is Large?
Publish Date - 04/01/2005
Source: Shop Talk Magazine
Column: CNC Equipment for Turning & Machining
By Peter Smid
No, this column is not about filing cabinets or paper folders, but computer files. CNC programs are not all created equal…equal in size, that is. Depending on the simplicity—or complexity—of the program, its size will vary greatly. The ever important question CNC operators have is whether the program file fits into the control memory or not. Let's work with an example of an actual CNC file sample stored in the mandatory plain ASCII text format (no formatting).
When this sample file is stored on the computer, Windows Explorer shows the icon indicating 2KB (2,000 bytes) as the file size. When the mouse moves over it, the detail box shows the file as 1.86 KB (1,860 bytes) in size. Now, I open the same file in Cimco Edit (a popular CNC file editor) and it shows me the file size as 1,809 bytes—
different, but acceptable. Looking at the CNC display at the machine, I am informed that I have so many meters (could be feet) remaining for additional file storage. Meters? Feet? Of what?
Tape Length
If you have worked with computerized machines for more than 10-15 years, you already know the answer. For those who started recently, the answer is “of tape length”. Yes, tape. So many feet or meters of punched tape. Many control systems use this system of storage capacity, even if it is not very helpful anymore, as the punched tape is just about history. When punched tape ruled in the old NC days, the tape was physically measurable (so many feet of tape contained the program) and meters were not commonly used in those days. NC tape was manufactured according to very high ANSI standards, and one of those standards was the distance between rows of holes located across the tape. Each row represents a single character of the program. The distance was arbitrarily determined to be 0.1000 of an inch, and every tape reader was made to match this standard. Once you know this magic number of 0.1, it is not difficult to establish that there will be 120 characters per foot of tape length (12/0.1=120). With the aid of some additional math wizardry, the length in feet can be converted to meters. There are 3.281 feet to one meter or 0.305 meters in one foot. No problem, right?
Well, a small problem comes along when the computer file size is considered. It is not unusual to find differences in file sizes reported by the editor, depending on which editor you use. There are two reasons: one is that there is always some overhead built into the file; and the second reason is that one byte is not always equal to one character. In computer terms, 1,000 characters are really 1,024 bytes. Quality CNC oriented file editors take this fact into effect and are always preferable to generic text editors (in addition to many other attractive CNC oriented features they offer).
Bytes & Storage
In order to sort this maze, we must turn to some simple math and use it for practical conversions of one unit to another. For the sample file size, Windows reported 1,860 bytes. This is a usable figure and available to all Windows users. As the main purpose of this exercise is to find out whether a particular program file size in bytes will fit the available storage of the control system, we only need three calculations:
Available CNC memory capacity in feet: File size / 120
Example: 1860 / 120 = 15.5 ft
Available CNC memory capacity in meters: File size x 0.00245
Example: 1860 x 0.00254 = 4.72 m
Available CNC memory capacity in characters: Nothing to do
In all three cases, as long as the file size is smaller than the available storage capacity, the program should fit in the CNC memory. However, a word of caution is necessary. Due to the different ways different software calculates the file size, use these conversions only as reasonable, not as precise.
Drip Feed Method
This column would not be complete without addressing the issue of what to do if the file does not fit the control memory. In this case, there are several options. Removing block numbers, leading zeros, comments, etc., from the program will make the file size smaller, but it can be a lot of work and still does not guarantee the file will fit. Splitting a long file into several smaller files is also possible, but not recommended, particularly for production work. The best way is to use DNC software that has a feature called "drip feed". Drip-feeding is a method of transferring the CNC program, via a cable, from an external computer to the CNC system in continuous blocks of data. The control buffer (i.e., temporary memory) will store a portion of the program, executes the toolpath, and clears the buffer so another block of data can be loaded and processed. Guess which mode of machine operation you have to choose? Yes, the tape mode (external mode), NOT the memory mode. It is ironical that many controls that cannot even accept a tape input still refer to punched tape terminology. Sorry, I have no answer to that.