System and method for computing domestic and international postage4286325Abstract A postage value computing system includes both apparatus and a method for determining the postage of an article to be mailed for various domestic and international classes of postal service. Postal information such as carrier type, class and destination data are introduced into the system and used to access a memory which stores common structured rate data. Major rate structures are defined by weight headers which specify the upper and lower limits of weight ranges and the weight increments within those ranges. To minimize memory requirements, foreign countries are grouped as a function of such common structured rate data including permissible weight limits. Memory space is conserved through the utilization of a common postage computation routine including various equation subroutines for generating requisite postage values in accordance with the retrieved postage rate data. Claims Having thus described the invention, there is claimed as new and desired to be secured by Letters Patent: Description RELATED APPLICATION
______________________________________
Input Motor Output
______________________________________
A B
0 0 Decrease Bank Setting
0 1 Illegal Code-Not Used
1 0 No Change in Bank Setting
1 1 Increase Bank Setting
______________________________________
A similar SPDT switch 250 connected to output L9 from processor 222 is used to provide a print-enabling TRIP signal to a selected one of the printing devices once the necessary conditions have been found to exist. Another SPDT switch 252 has its "input" connected to a five volt source and its output terminals connected to the PPD1 and PPD2 power supply terminals shown at the top left corner of FIG. 7a. All of the above-described SPDT switches are ganged for synchronous operation under the control of a solenoid 254 having its lower terminal connected to a positive voltage source 223 and its upper terminal connected through an inverter 221 to line L10 from postage printing device processor 222. When the solenoid 254 is de-energized by driving the output of inverter 221 to the level of the voltage from source 223, the blade of each of the switches remains in its upper position. In the upper position, drive motors for printing device PPD1 are connected to the motor driver circuits 224, 226 and 228 and 230 while the five volt source is connected through switch 252 to provide power for the sensor circuits 194, 196, 198 and 200 for device PPD1. Conversely, when the solenoid 254 is energized, the SPDT switches are set to their lower positions wherein the setting motors for printing device PPD2 are connected to switch 252. The postage printing subsystem processor 222 interfaces with the other processors in the system through lines L11-L18. The system clock or CLK A signals are applied to line receiver circuit 256 which drives an inverter amplifier 258 at the input to a high impedance switching circuit 260. The output from the switching circuit 260 is connected to terminal L11 to provide clock pulses for synchronizing operations within the postage printing subsystem processor 222 with operations elsewhere in the system. The attention signal ATTN2 dedicated to the postage printing subsystem processor 222 is applied to terminal L12 through a line receiver circuit 262 while the acknowledgement signal ACK provided by the processor 222 in response to the ATTN2 signal is output from terminal L13 through a line driver circuit 264. RDY signals originating elsewhere in the system are applied to terminal L15 of the processor 222 through a line driver/receiver circuit 266 while RDY signals originating within processor 222 are output from terminal L14 to the circuit 266. The serial data bus over which the processor 222 exchanges status information and data with the remainder of the system includes a line driver/receiver circuit 268 through which incoming data can be applied to terminal L16 of the processor 222. Data originating within the processor 222 is output from terminal L17 to the line driver/receiver circuit 268. SHCLK pulses used in transmitting data to and from the processor 222 one bit at a time are applied through line driver/receiver circuit 270. Incoming SHCLK pulses are applied through circuit 270 and serially-connected inverter gate 272 to a high impedance switching circuit 274, the output of which is connected to terminal L18 of the processor 222. Outgoing SHCLK pulses are generated only when such pulses appear on terminal L18 while a connection 276 from terminal L14 to the line driver/receiver circuit 270 indicates that the outgoing RDY line is also high. When both conditions are satisfied, line driver/receiver circuit 270 passes data shifting pulses to line driver/receiver circuit 268 in the DATA bus circuit to permit data to be transmitted from the processor 222 onto the serial bus. Software and stored data, used in combination with the above-described hardware to compute both domestic and international postage, is described with reference to the remaining Figures of this application. The type of memory employed for a preferred embodiment of the invention employs eight bit words, referred to generally as storage bytes. As will be noted later, these eight bit words may be encoded in various formats. The most common format is one which divides each word into two four bit bytes, each of which is encoded in hexadecimal (base 16) format. The words may also be encoded in binary format, either as an eight bit unsigned word or as a seven bit word, the sign of which is indicated by the binary value of the most significant bit in the byte. Certain FLAG words are actually microinstruction words within which specific bits are interpreted as having specific meanings depending on their binary value. These FLAG words are used to define the remainder of a chart in which they appear or to control postage computation or printing steps. Unless stated otherwise, it can be assumed that any table entry is in the form of two four bit words encoded in hexadecimal format. Referring first to FIG. 9, data refining various rate chart structures is stored in major blocks of the programmable read only memory of the system processor. One form of stored data is a system directory table which contains the starting addresses for common structured rate data. More particularly, the system directory table includes the starting addresses for the several different classes of mail service available from the United States Postal System and the starting addresses for the several classes of delivery service provided by United States Parcel Service. The system directory table also includes the starting addresses for the various classes of postal service (letter, small packet, etc.) provided by the terms of the International Postal Union agreement. While FIG. 9 shows memory blocks of approximately the same size for the system directory table and the various major rate structures, this is a matter of drafting convenience only. In fact, the different rate structures may require considerably different amounts of memory. Each of the different rate structures is defined in terms of the weights of parcels which may be mailed and in terms of the dollar costs for mailing parcels of different weights. Generally speaking, the major rate structures are divided into one or more weight ranges which, taken together, span the distance between the minimum and maximum allowable parcel weights for the rate structure. Each weight range will have some weight-related characteristic which distinguishes it from adjacent weight ranges. For example, in one weight range, postage amounts may be changed for every eight ounce increment in parcel weight. In the next higher weight range for the same class of service, the postage amounts may change only for every one pound increment in parcel weight. FIG. 10 shows the general format for a weight header which would be stored in memory for each weight range within a major class of service. For example, the First/Priority class of service provided by the United States Postal System would have one or more "dedicated" weight headers of the type shown as would the UPS Interstate class of service. Similarly, the International Printed Matter, surface mode, class of service would have its own weight headers. Referring specifically to FIG. 10, each weight header includes three successive WGT FLAG bytes in which the individual bits (B0-B7) are used to define the meaning of other entries in the weight header. Each of these FLAG bytes is described in more detail with reference to a later Figure. The WGT FLAG bytes may be followed by a special fee mask or rate screen which is interpreted to determine which special fee may be applicable for the weight header class of service. Four special zip to zone vector address bytes may follow if special zone determinations are necessary. Each weight header includes one to three stop weight bytes which define the maximum weight for which the weight header is valid. The address of the header for the next higher range (if any) is defined by successive binary-encoded bytes which follow the stop weight bytes. There is, of course, no Next Chart Address entry for a single section rate structure or for the last chart in a multisection structure. For certain types of postal service, an oversized parcel weighing less than a certain amount may be mailed as if it weighed the specified amount regardless of its actual weight. Accordingly, an oversize default weight may be specified in one to three successive bytes of the header. As the specific example, current United States Postal Regulations permit a parcel weighing less than 15 pounds and measuring between 84 and 100 inches in combined length and girth to be mailed as if it weighed 15 pounds. For this specific example, the oversize default weight is 15 pounds. Of course, the postage calculator cannot measure the combined length and girth of parcels being weighed. Therefore, to take advantage of this oversize mailing rate, an operator must indicate through the keyboard that the parcel to be mailed is physically oversize. Each weight header also includes one to three successive bytes defining the start or minimum weight for which the weight header is applicable. The weight headers define each weight range in incremental terms. The start or minimum weight is defined directly. Then each weight increment which produces a change in postage is defined. Total parcel weight is thus defined as the sum of the start weight and one or more weight increments. For some classes of service, the weight increments throughout the range are equal, providing what is described as a linear weight chart. For a linear weight chart, only one weight increment entry may be defined. For other classes of service, weight increments may not be uniform throughout the weight range. For example, current U.S. Postal Regulations for Priority mail provide that postage amounts are increased at each 0.5 pound or 8 ounce weight increase in a range from 1.0 to 5.0 pounds. However, for parcels weighing more than 5.0 but less than 70 pounds, the postage is increased only once for each pound increase in weight. Such a rate chart is defined as a non-linear chart since the weight increments are not the same throughout the weight range. For example, if the weight header were to cover the entire span from one pound to 70 pounds, the start weight would be defined as 1.0 pounds, each of the first eight weight increments would be 0.5 pounds and the remaining weight increments would be 1.0 pounds. A weight delimiter entry follows the last weight increment entry in the weight header in non-linear weight charts. Preferably, the delimiter consists of two four bit words, equal to FF.sub.16 in hexadecimal format. If the rate chart is zone structured, the weight header includes an entry specifying the maximum zone number appearing in the weight header. While United States Postal regulations generally recognize the existence of eight distance-based zones, other types of postal service can have more or fewer zones. The zone entry may follow the single rate increment in a linear weight chart or the weight delimiter entry of a non-linear chart. The maximum zone number entry is followed in the weight header by dollar table addresses for each of the zones within the maximum number. For most United States Postal Services, dollar table addresses would be provided for zones 0 through 8. Where different zones share the same dollar rate structure, the dollar table addresses are, of course, the same. For example, current Priority mail regulations provide that parcels being mailed locally (zone 0) or to zones 1 through 3 are to be mailed at the same postage rates. For this class of service, the dollar table address is identical for the zone 0, zone 1, zone 2 and zone 3 entries. Each weight header is associated with a dollar table having its own header. The dollar table header is described in more detail later. The three WGT FLAG bytes which appear at the beginning of each weight header are critical to the definition of the rate structure. Referring to FIG. 11, which is a representation of the eight bit positions in WGT FLAG 1, the binary value of bits B5, B6 and B7 indicate whether the weight header specifies the stop weight in terms of pounds, ounces, and/or fractions of ounces when the English system of units is employed. A binary one in a particular bit position indicates that the header has an entry which will be interpreted as defining the stop weight for a particular unit of measure. For example, if bits B5 and B6 of WGT FLAG 1 are equal to binary one while bit B7 is equal to binary 0, the weight header is interpreted as including two successive entries defining the stop weight of the range in terms of pounds and ounces but not fractions of ounces. The header would not have an entry relating to fractional ounces. Bit B4 of WGT FLAG 1 is used to indicate whether the weight measurements represent parcel weight in English or metric units of measurement. If bit B4 equals 1, weight header positions normally interpreted as referring to fractional ounces are interpreted as meaning 0.1 grams. Ounce and pound positions are interpreted as 10 gram and 1.0 kilogram positions. To simplify the description herein, only English units of measurement will be mentioned. However, the discussion can be interpreted in metric units simply by making the units conversions mentioned above. The binary value of bits B0, B1, B2 and B3 of WGT FLAG 1 specify the oversize default weight described earlier. For current United States postal regulations, the oversize default weight is 15 pounds exactly. For such a weight, bit B1 would be set to 1 while bits B2 and B3 would be set to 0. The weight header would be interpreted as having only a single byte defining oversize default weight. Bit B0 is employed to denote which of two possible types of oversize calculations is employed in the rate chart. With bit B0 at a low logic level, the present weight oriented basis is indicated. A binary one at bit B0 indicates an oversize fee calculation based upon a fixed fee or other criteria similar to special fees. Referring now to FIG. 12 wherein WGT FLAG is depicted, two three bit words indicate whether the start weight entry (bits B7, B6 and B5) and the weight increment entries (Bits B3, B2 and B1) include byte positions for pounds, ounces and/or fractional ounces. For example, the two byte positions need to define a 1.5 pound start weight are specified by setting bit B5 and bit B6 to 1 and bit B7 to 0. As another example, weight increments can be specified in units of ounces and fraction of ounces by setting bits B2 and B3 equal to 1 while bit B1 is equal to 0. Bit B4 of WGT FLAG 2 is used to indicate whether or not the rate table employs other than standard zip to zone conversions. With B4 set to a binary zero, standard zip to zone conversions are used in either USPS or United Parcel Service (UPS) format. A binary one indicates employment of other than standard zip to zone USPS conversions with respect to the rate chart and/or particular shipment methods as determined with reference to bit B0. If bit B4 is set to a binary zero and bit B0 is set to binary zero, standard zip to zone USPS conversion is indicated and zip to zone conversion tables are located without further addressing. The use of UPS zip to zone conversion tables is indicated by providing a binary zero at B4 and a binary one at B0. In such instances, the UPS zip to zone conversion tables will be located by accessing the special zone bytes which follow the special fee masks. With bit B4 set to one and bit B0 set to binary zero, express mail shipment is indicated with zone data based upon airport to airport distances rather than origin to destination distances while binary one at bit B0 with bit B4 high indicates custome zip to zone conversions which may be encountered in instances wherein postage is applied to parcels which are shipped before mailing. Zip to zone conversions under such circumstances must be made with the remote mailing location as the point of origin. Referring again to the weight header, in instances wherein other than standard zip to zone conversion and/or UPS is required, the special zone bytes comprise two 16 Bit pointers, the first of which indicates the location of an illegal zip code table. The second special zone 16 bit word in the weight header vectors to the other standard or UPS zip to zone table itself. It should be appreciated that the zip to zone tables contain all zip codes even illegal zip codes, therefore the program is first directed to the illegal zip code table in order to screen out illegal zip codes which may have been entered before proceeding with the actual conversion. Referring to FIG. 13, each of the eight bits of WGT FLAG 3 serves a different function. A binary one in the bit B0 space indicates that a UPS postage meter should be used to print the computed postage. A binary 0 indicates a U.S. Postal Service meter is to be used. A binary one in the B1 position indicates that the chart is zone structured. For a zone structured chart, the weight header must have an entry defining the maximum number of zones as well as addresses for determining the dollar table location for each of the different zones. Conversely, a binary 0 in the B1 position indicates that the chart is not zone structured. The header will lack entries of the type mentioned above. A binary 1 at bit B2 indicates that the chart is non-linear and necessarily includes more than one weight increment entry and and FF.sub.16 delimiter following the last weight increment entry. If bit B2 equals 0, the weight chart is linear, has only one weight increment entry and no FF.sub.16 delimiter. Bit B3 indicates whether the rate chart is set up in linked or unlinked format. Each of these formats is discussed in more detail with reference to a later figure. Bit B4 indicates whether the weight increments range up to but do not include the maximum increment value. The value of bit B5 indicates whether the weight range covered by the header includes the stop weight value. Bit B6 equals 1 only if the weight header is part of a single section chart or part of the last chart in a multi-section class of service. When bit B6 equals 0, the weight header is interpreted as including an entry defining the address of the next chart to be used when the scale weight exceeds the stop weight. The value of bit B7 indicates whether there are any rate screen bytes present in the weight header. As indicated earlier, the rate screen bytes (if any) provide information as to which of different kinds of special fees are applicable to the particular class of service. If there are no applicable special fees, bit B7 equals 0. There is a dollar table associated with each weight header. The format of a linked dollar table option is shown in FIG. 14. The first two bytes of each dollar table contain a binary representation of the number of postage increments covered by the particular table. Bit B7 of the first byte is reserved for a last dollar table indicator. A binary one value in this position indicates that the particular dollar table is the last table in the particular rate chart. If the dollar table is not the last one in the rate chart structure, the dollar header includes two bytes for the starting address for the next applicable dollar table. The existence of this address is indicated by a binary 0 value in byte 7 of the first byte of the table. The next entry in the dollar table is a $ FLAG byte in which the individual bits are used to interpret other entries in the table. Referring briefly to FIG. 15, bits B4, B6 and B7 of the $ FLAG byte indicate whether the table has entries defining the starting postage amount in hundreds of dollars, dollars and/or fractional cents. The table is assumed to always have a starting cents entry. If bits B4, B6 and B7 are equal to 0, the table is interpreted as having a single entry defining the starting postage in cents only. Bits B3 and 5 of the $ FLAG byte serve the same general function with regard to incremental postage amounts. The table is always assumed to have incremental cents. A binary one in a particular one of these three bit locations is an indication that the dollar table defines incremental postage values in terms of the unit of measure associated with that bit position. For example, if bit B3 is equal to 1 while B5 is equal to 0, the dollar table is interpreted as having entries defining dollar and cents values for each postage increment. Bits B1 and B2 of the $ FLAG byte specify whether the computed postage is to be rounded and, if so, in what manner. Both of these bits may be set to 0, indicating that no rounding is to be performed. However, only one of the bits can be set to 1 in a given dollar table since the two rounding methods are mutually exclusive. If bit B1 is set to 1, the computed postage is rounded up to the next higher multiple of a rounding increment (to be discussed) if the fractional cents and cents portion of the result is equal to or greater than one-half of the rounding increment. If the fractional cents and cents portion of a computed postage amount is less than one-half of the rounding increment, the computed postage value is adjusted downward to the next lower rounding increment value. If bit B2 is equal to 1, the fractional cents and cents part of a computed postage is rounded up to the next higher multiple of routing increment unless, of course, that part of the result is exactly equal to the rounding increment. Bit B0 of the $ FLAG byte indicates whether the dollar table is linear or non-linear. A linear table is one in which the same dollar increment is employed for successive weight increments. Such a table would include only one postage increment entry. A non-linear table is one having different postage increments. A non-linear table will include postage increment entries corresponding to each weight increment in the weight header. Referring again to FIG. 14, the dollar table includes two four bit rounding words defining a rounding byte when rounding operations are indicated by an appropriate bit in the $ FLAG byte. This rounding byte establishes a rounding increment in a range between one cent and one dollar. The rounding byte, assuming one is included, is followed by the base or starting postage amount in the dollar table. Depending upon the binary value of bits B4, B6 and B7, this starting entry may consist of one to four successive bytes defining the start value in terms of hundred dollars, dollars, cents, and/or fraction of cents. Starting postage bytes are followed by one or more postage increment entries, each of which, may be one to three bytes long. The dollar table ends with the last postage increment. As indicated earlier, each rate chart includes one or more weight headers and one or more associated dollar tables. Zone-independent charts generally include only one dollar table for each weight range covered by a weight header. Zone-dependent charts must on the other hand, include several zone-identified dollar tables for each weight range. Zone-dependent rate charts can generally by organized in either or two formats. An unlinked format is illustrated in FIG. 16 while a linked format is shown in FIG. 17. The format employed for a particular rate chart is specified by the value of bit B3 of WGT FLAG 3 in the weight header as mentioned above. Referring first to FIG. 16 for an example of a rate chart in unlinked format, the rate chart is shown as having, for example, three weight headers, each covering a limited weight range within a particular class of service. For example, the first weight header might define a weight range of 0 to 12 ounces with one ounce increments within the range. The second weight header might define a range of 12 oz.<weight.ltoreq.5 pounds in which eight ounce weight increments are used while the third header would cover a range of 5 pounds<weight.ltoreq.70 pounds in which one pound weight increments exist. In the unlinked format, each of the weight headers defining the total weight range of 1 ounce to 70 pounds is followed by the corresponding dollar table is applicable to one of the weight range defined by the weight header. In the given example, separate dollar tables would be provided for each of the three defined weight ranges. Assuming the postage amounts are zone-dependent for all three weight ranges, the dollar tables would have dollar information for each zone for which different postal rates are charged. The addresses for these zone-related tables are obtained in the weight header. The linked rate chart format (FIG. 17) can be used to conserve memory space where the weight increments are uniform throughout the range of the rate chart notwithstanding the postage increments values may vary randomly with respect to any zone. The weight header for a linked chart includes three WGT FLAG bytes, a stop weight byte, a weight increment byte and byte specifying the maximum number of zones covered by the linked chart. The weight header further includes one or more bytes specifying the address of a dollar table for each of the zones covered by the linked chart. Typically, the linked rate chart will be employed wherein the weight increments are linear throughout the chart, however, one equation for generating dollar values may apply to one section within a zone and a further equation applies for generation of dollar values for a different section of the same zone. The dollar table for each zone is divided into sections wherein a uniform value increment applies for generation of postage values. Each section includes an individual dollar header comprising a first byte which indicates the number of increments in the section and a second byte which provides the address of the following section. If the number of weight increments of the article to be mailed exceeds the number of increments for the section accessed, the second entry of the dollar header which provides the address for the successive section is the accessed. When the article weight falls within the range of increments of a section, the next two bytes which specify the dollar start amount and dollar value of each increment is examined in order to generate the appropriate postage value. When the article weight exceeds the weight limit of a dollar header for a section of the table, the number of weight increments in the weight header of such section is subtracted from the number of weight increments of the article and the dollar header of subsequently accessed section is examined with respect to the remaining number of increments of article weight. Where the remaining number of increments falls within the limits of the accessed section, the dollar start value for such section and the dollar value of each increment will provide sufficient information for the generation of the appropriate postage value. It should be appreciated that the utilization of the linked rate chart format eliminates the necessity for providing a separate weight header for each instance wherein there is a change in the character of the incremental dollar value. Thus, in effect, a new dollar header is provided without a new weight header. A single postage computation routine is employed whether the computed postage is for use on a parcel having a domestic destination or an international destination. The postage computation routine is described with reference to FIGS. 18 through 21. In describing the routine, numerals are used to identify particular blocks or points in the routine. As a matter of convention, all such numerals are four digits in length. The first two digits identify the Figure in which the block or point is found. The last two digits identify a particular point or block within the Figure. The postage computation routine is called only after an appropriate rate chart weight header has been identified. For parcels being mailed to domestic destination, the appropriate weight header is determined by keyboard entries specifying the class of service to be employed; e.g. United States Postal Service First/Priority mail, United Parcel Service Interstate mail, etc.. The starting address of the appropriate rate chart is retrieved from a directory or lookup table when the keyboard is read. When a parcel is to be mailed using an international class of service, additional data processing steps must be carried out before an appropriate rate chart can be selected. These steps are described with reference to later Figures. However, for purposes of describing the postage computation routine, it will be assumed that an appropriate rate chart for the particular class of service has already been retrieved from memory. When the postage computation routine is called, the initial step 1802 is to reset any weight chart error flags set during the previous postage computation process. The encoded scale weight is loaded into a predetermined random access memory location from which it may be accessed during processing. In step 1804, weight header bytes are copied into random access memory for use during further processing. A comparison 1806 is then made to determine whether the scale weight is less than the stop weight specified in the weight header. If the scale weight is not less than the stop weight, a further decision 1808 must be made as to whether the scale weight is equal to the stop weight. If the two weights are equal, a check 1810 is made as to whether the weight range includes the stop weight. This check is made by determining the binary value of B5 in WGT FLAG 3 as discussed earlier with reference to FIG. 13. If the scale weight does equal the stop weight and the weight range includes the stop weight, the program goes to a point 1812 which is also reached directly from decision block 1806 where the scale weight is less than the stop weight. If, however, decision blocks 1806 and 1808 taken in tandem show that the scale weight is neither less than nor equal to the stop weight or if decision blocks 1808 and 1810 taken in tandem indicate that the scale weight equals the stop weight but that the weight range does not extend to the stop weight, then the parcel weight clearly falls outside the permissible weight range. A check 1814 is then made as to whether the weight header section called is the last section of the rate chart. If it is, the only conclusion that can be drawn is that the parcel is too heavy to be mailed by the selected class of service. An overweight error flag is set (block 1816) and program control is returned to main program. The overweight error flag causes a visual error code to be displayed on the keyboard display. If, however, decision block 1814 indicates that the last section of the rate chart has not been called, the address of the next section is generated using the address contained in the first weight header and the weight header information for the next section is loaded into memory. After the second weight header information is retrieved, the above-described steps are again performed to see whether the scale weight is within the second weight range. If it is not, a third weight header is accessed and the weight comparison steps are repeated. The sequence is reiterated until it is determined that the weight header for the correct weight range has been located. Once weight header information for the right weight range has been retrieved, a check 1818 is made to determine whether WGT FLAG 1 in the header indicates the selected class of service is one which permits mailing of oversized parcels at special rates. If check 1818 indicates that the selected class of service does not allow mailing of oversized parcels, program control goes directly to a point 1902. If, however, the mailing of oversized parcels is permitted, program control goes to a decision block 1820 at which a check is made to see whether the physically oversize key of the keyboard is depressed. If not, program control goes directly to the point 1902. If the oversized key is set, it is then cleared and a check 1822 is made as to whether the scale weight is greater than the oversize default weight. If the scale weight is less than or equal to the oversize default weight, the stored weight value is increased to the default value since the postal regulations require that the postage be computed as if the parcel weight were equal to the default weight. The entire routine is then repeated beginning at decision block 1806 to locate the weight header for the range which includes the oversize default weight. If check 1822 shows that the scale weight exceeds the oversize default weight, program control goes directly to point 1902. At this point, the next phase of the postage computation routine begins. During this phase, the parcel weight is broken down into a starting weight and a number of weight increments. At block 1904 predetermined memory locations, designated as SUM 0, SUM 1, SUM 2 and ADDCNT registers are initialized. The three SUM registers are initialized at the start weight specified in the applicable weight header with SUM 0 representing the fractional ounces term (if any) in the start weight, SUM 1 representing the ounces term of the start weight and SUM 2 representing the pounds term of the start weight. ADDCNT, which will eventually represent the total number of weight increments for the scale weight, is initially set to 0. A determination 1906 is made as to whether the scale weight is less than the SUM weight. A positive answer on the first iteration of the loop indicates that parcel weight is below the start weight for the weight range although it is to be rounded up to the start weight in the normal computation process. For example, a parcel weighing 14 ounces is less than the nominal 1.0 pound starting weight for the priority section of a combined First/Priority mail rate structure. However, the priority section cover all parcels weighing more than 12 ounces and a 14 ounce parcel would be treated as if it weighed 1.0 pounds. If block 1906 indicates that the scale weight is not less than the SUM weights, a determination 1908 is made as to whether the scale weight equals the SUM weights. If it does and WGT FLAG 3 of the weight header indicates that the incremental weight includes the upper limit (block 1910), the process of determining the number of weight increments is considered to be completed and program control goes to a branch 1912. If, however, the scale weight equals the SUM weights but the weight increment does not include the upper limit or if the scale weight does not equal the SUM weights (meaning that it exceeds the sum weights since block 1906 has already established that it is not less than the SUM weights, the program continues through block 1914 in which the first defined weight increment for the weight range is added to the SUM registers. The ADDCNT register is incremented by 1 in a step 1916 to indicate that a weight increment has been added to the SUM registers. If WGT FLAG 3 indicates that the weight chart is a linear one, decision block 1918 returns the program to point 1906. If, however, the weight chart is non-linear, the next weight increment value is retrieved (block 1920) before program control returns to point 1906. The steps which begin with block 1906 and end with block 1920 are reiterated until a positive answer is obtained either at decision block 1906 or decision block 1910. During each iteration, the SUM register values are incremented by the amount of the appropriate weight increment while the ADDCNT register is incremented by 1. At point 1912, the contents of the ADDCNT register represent the number of weight increments by which the parcel weight exceeds the start weight for the selected weight range. To leave this section of the routine, a check 1922 is made as to whether the weight chart is linear. If the weight chart is non-linear, a sequence of instructions is carried out (block 1924) to skip the remaining weight increments in the chart. If block 1922 indicates that the weight chart is linear, this sequence is bypassed with program control going directly to point 1926. A determination 1928 is made as to whether the selected rate chart section is one requiring a zone input. As indicated earlier, some rate structures are zone-independent. If the selected structure is one of these, the starting address for the appropriate dollar table is retrieved from the weight header in operation 1930. If the chart is zone structured, however, a check must be made as to whether a valid zone number has entered and, if so, whether it is greater than the maximum permissible zone number specified in the weight header. If an invalid zone number has been entered or if an otherwise valid zone number exceeds the maximum number set in the header, zip or zone error flags are set to trigger an error display which will alert an operator to the problem. If the valid zone number entered does not exceed the maximum permissible zone number, program control is transferred to a point 2002. At this point, the dollar table address for the specified zone is loaded and a determination 2004 is made as to whether there is an illegal zone entry in the address bytes. This check is needed since United Parcel Service does have illegal zone numbers. If an illegal zone entry is detected, zone error flags are set (block 2006) and control is returned to a main program. If the zone entry is legal in the address, a check 2008 is made as to whether the table format is a linked format. It will be noted that the program branch for a zone-independent rate chart converges with the zone-independent program at the input to block 2008. When the tables are presented in a linked format, a check 2010 is made as to whether the binary count in the first two bytes of the header of the first section is greater than the ADDCNT quantity. If this binary count, which represents the weight range for the selected section of the dollar table is less than the ADDCNT value, the appropriate section of the dollar table has yet to be reached. The section header binary count is subtracted from the ADDCNT quantity (block 2012), and a double byte address in the chart is accessed as shown in block 2014 to access the next section of the dollar table. Operations 2010, 2012 and 2014 are repeated until it is determined that the count in the section header is greater than the decremented ADDCNT quantity. At this point, the program will have located the proper section of the dollar table in the linked header. If the dollar table is not the last one in the chart, the remaining address bytes are skipped to reach a point 2102 in the program. If the dollar table section selected is the last section, there are no address bytes left to skip and program control bypasses this last operation. Point 2102 is reached directly from block 2008 if the latter block indicates that an unlinked table format has been employed. At this point in the computation routine, sufficient rate data has been retrieved in the form of equation boundary conditions and instructions for generating a postage value format routine having various subroutines (equations). The process of actually computing the postage in accordance with the equation is started (block 2104) by zeroing $ SUM memory locations or registers, which represent tens of dollars, dollars, tens of cents, cents and fractions of cents. The $ SUM registers are then initialized (block 2106) to the base or starting postage amount specified in the dollar table header. The full ADDCNT quantity is decremented by one in operation 2108 and a check 2110 made as to whether the resulting value is negative. If not, the first postage increment specified in the table is added to the $ SUM registers in an operation 2112. If the chart is linear as specified by the $ FLAG byte, the equation for generation of the postage returns to the block 2108. If the chart is non-linear, the next postage increment in the table is called up (block 2114) before program control returns to block 2108. The operations beginning with block 2108 are performed repeatedly with the ADDCNT value being decremented by one during each cycle while another postage increment is added to the $ SUM registers. When decision block 2110 indicates that the result of the ADDCNT decrementing step is negative, meaning that all of the weight increments for the parcel weight have been taken into account, program control is transferred to a rounding subroutine (equation) shown only as a block 2116. The postage amount may be rounded off to the next higher rounding increment or rounded off to the nearest rounding increment in accordance with the microinstructions of the $ FLAG byte. When any necessary rounding operations have been performed, the calculator sets a flag (block 2118) to indicate to the system that a postage amount has been computed. The postage amount is loaded into a display buffer to provide a visual display for the benefit of the operator before program control is returned to a main program. At this point, if the operator is satisfied with the displayed value, he can depress the Print key to cause the postage amount to be imprinted on a parcel or an adhesive-backed tape. As has been indicated before, the postage computation routine described with reference to FIGS. 18 through 21 is employed to calculate postage for both domestic and international classes of service. Where an international class of service is selected, additional precomputation steps are carried out in order to take into account different weight limits or permissible modes of shipment in different countries. These additional steps are described with reference to FIGS. 22 through 30. The international rate structure includes a directory table illustrated generally in FIG. 22. The first two bytes of the directory table include the address of a check sum location for the table. The third byte is a representation of the highest country code number used in the table. To simplify processing, different countries are identified by different three digit code numbers. In a preferred embodiment of the invention, there may be 254 different code numbers (000 through 253) available for identifying different countries. Use of all 254 available code numbers is not likely, however, so that a maximum code number less the highest available code (253) is specified. Nor is it likely that the list of country code numbers will remain static. New countries may be added to the list or existing countries may be deleted as a result of political alliance or military defeat. Because the realities of the situation, the international rate structure directory table includes a list of missing country code numbers, within the range limited by the maximum country code number entry. For each of the five recognized classes of international mail service (letter class, parcel post, printed matter, book and small packet) the international rate structure directory table includes starting addresses for group and vector tables, which are employed to determine the appropriate rate chart for a particular country, and a chart descriptor byte, which selects one of two available types of rate chart address generating processes to be employed. The exact functions and contents of the group and vector tables and of the chart descriptor byte are discussed with reference to later Figures. FIG. 23 is a more detailed representation of the type of information which is included in any of the class of service sections of the international directory table. Each class of service section includes ten successive bytes of information. The first five bytes relate to a surface mode shipment within a specific class of service while the second five bytes relate to air shipment of parcels within the same class of service. More particularly, the first two byrtes of the first section form a two word starting address for the group table applicable to the surface shipment within a particular class. The third and fourth bytes in the first section form the starting address of a corresponding vector table. The fifth byte in the first section is a chart descriptor byte. The second section has the same format as the first section and includes group and vector table addresses and a chart descriptor byte relating to air shipment within the same class of service. As indicated earlier, a user who selects an international class of service must specify through the keyboard whether air or surface shipment is to be used. The user must also specify the class of service as part of the four digit entry, the last three digits on which are the country code number for the country of destination. The calculator responds to the depression of either the air or the surface key and the entry of a code number specifying a class of service to select the particular section of the directory table containing the starting addresses and chart descriptor byte for the selected mode of shipment and class of service. The routine for performing the selection process is described in detail later. Within each class of service, a number of different countries may share a common rate chart. The group table mentioned above is a table of country code numbers in which the various countries are grouped as a function of the rate chart which is applicable to them. FIG. 24 is a generalized representation of a group table. The number of countries within each group can vary although a group obviously has to have at least one country. Each group within the table consists of a listing of the country code numbers for the various countries which share the same rate chart for the selected class of service and selected mode of shipment. To separate one group from the next group, inter-group delimiter bytes are provided. In hexadecimal format, each such group delimited byte preferably is equal to FF.sub.16. For the five presently available classes of international postal service, each having two possible modes of shipment, there are ten group tables. To identify the last entry in each table, an end of table delimiter byte is provided. In a preferred embodiment, the end of table delimiter byte is equal to FF.sub.16. Each group table does not necessarily include an entry for every country. As will be explained later, a significant number of country code numbers can be omitted from the group table without altering the effectiveness of the calculator. Group tables of the type illustrated in FIG. 24 are normally used in combination with vector tables of the type illustrated generally in FIG. 25 to obtain the actual starting address for an applicable rate chart. In a normal vector table, data is segregated by groups. Each vector tables section consists of three successive data bytes. The first byte in each group contains two four bit words in hexadecimal format establishing a weight limit for the group and, thus, for the selected mode of shipment and class of service. The next two bytes in each vector section form a two byte starting address for the applicable rate chart. Since different countries may use the same rate chart structure but set different weight limits, different sections of the vector table may have different weight limit values but the same rate chart starting address. The vector table described above is constructed on a premise that the same rate chart structures are applicable to more than one country. Under worst case conditions, each country might choose to adopt a unique rate structure for each different class of service and mode of shipment. A modified form of vector table is employed to derive the applicable rate chart addresses in such a situation. This table, to be described generally with reference to FIG. 26, is used in carrying out what has been referred to as the forced approach to rate chart address generation. The modified vector table has a specific assigned two byte rate chart address for each of the countries to which a country code number has been assigned. In a preferred embodiment, up to 253 two byte addresses could be provided although the actual number of address is equal to the maximum country code number specified at the start of the international directory table. Each address consists of two sequential eight bit bytes with the assigned address position for the N.sup.th country code number being the N.sup.th +1 position. Two or more countries which share the same rate chart will have identical addresses stored in their respective country code number positions. The function of the group and vector tables described above is to facilitate the generation of the starting address of a rate chart applicable to a particular country, class of service and mode of shipment. Once the appropriate rate chart has been addressed, the system employs the same postage computation routine as is used for determining domestic postage amounts. FIG. 27 is a flow chart describing the international postage computation routine in simplified fashion. FIGS. 28 through 30, taken together, comprise a more detailed flow chart of the describing the international postage computation routine in simplified fashion. FIGS. 28 through 30, taken together, comprise a more detailed flow chart of the process. Referring first to FIG. 27, an initial step 2702 is to determine whether the country code number entered through the keyboard is more than the maximum country code number specified in the international directory table. If the entered country code number is greater than the maximum allowable number, an error flag is set (block 2704) immediately and control returned to the main program. If the entered country code number is not more than the maximum permissible number, a second check 2706 is made as to whether the entered country code number is in the list of missing countries. If so, error flags are set. If not, the group table address is obtained (block 2708) as a function of country, class of service and mode of shipment. As indicated earlier, the class of service and country code are entered into the system in the form of a four digit number through the numerical entry keyboard. The mode of shipment (air or surface) is designated by depressing either the "international air" or "international surface" key on the keyboard. The appropriate vector table is accessed using the vector table address in the international directory table for the class of service and mode of shipment (block 2710). At this point, the program can follow either of two branches depending on whether a check 2712 indicates that a normal address generation approach (2714) or a forced address generation approach (2716) is to be employed. If the normal approach is to be employed, the accessed group table is searched (block 2718) until the table entry corresponding to the entered country code number is located. The group within which the selected country is found is then used to access the vector table (block 2720) for the selected class of service and mode of shipment. The vector table provides a maximum weight limit and the actual 16 bit address of the appropriate rate chart. Before the rate chart is called, a check 2722 is made as to whether the scale weight exceeds the weight limit or whether the weight limit in the group table is set to a default of FF.sub.16 value. If th scale weight exceeds the permissible weight limit, an overweight indicator is set (block 2724) and program control is returned to a main program. If the weight limit byte in the group table is set to the default value, this indicates that the countries within the specified group do not have a mail service corresponding to the nominally selected class of service and mode of shipment. For example, Canada does not currently have an air parcel post class of service. Assuming the scale weight is within the limit set in the vector table and that the class of service/mode of shipment is a valid one, rate chart data stored beginning at the address contained in the vector table is retrieved (block 2726) and the domestic postage computation or rate routine is called (block 2738) to calculate the appropriate postage before control is returned to a main program. If the chart descriptor byte in the directory table entry has indicated that a forced approach was to be followed in generating the address to the rate chart, branch 2716 would have been followed. The modified vector table described with reference to FIG. 26 is accessed with the entered country code number as illustrated in block 2730 to obtain the rate chart address. As presently structured, the first stored two byte address is assigned to country number 0; therefore the address for the Nth country will be found at position N+1. The rate chart data stored at the designated address is retrieved (block 2732) and used in the postage computation routine. From the foregoing, it can be seen that the only difference between the normal approach and the forced approach lies in the manner in which the address of the appropriate rate chart is obtained. Naturally, when the normal approach can be employed, much memory space is conserved. The actual rate chart data stored at any address will have the same format regardless of how that data is obtained. A more detailed flow chart of the routine for obtaining rate chart addresses for international postage service will now be described with reference to FIGS. 28 through 30. Certain decision or operation blocks appear both in the general flow chart described with reference to FIG. 27 and the more detailed flow chart to be described. For example, the first step in both is to determine whether the entered country code number is greater than the maximum number specified in the directory. To maintain consistency as to the numbering system employed, such blocks are numbered in accordance with the Figure in which they appear, notwithstanding they may also appear in other Figures. Thus, the decision block described above is identified as block 2802 in the more detailed flow chart. If the entered country code number is greater than the maximum permissible number or is included in the missing country table (block 2806), error flags are set (block 2804) before the program control is returned to a main program. If the entered country code number is not greater than the permissible number and does not appear in the missing country table, a random access memory storage location designated MSHIPC is initialized to a number, e.g. within the range of 1 through 5, indicative of the class of service to be employed. For example, if the keyboard entry indicates that letter class is to be employed, MSHIPC is set to "1". The first data section of the directory table is addressed (block 2810) before the quantity MSHIPC is decremented by 1 (block 2812). If the decremented MSHIPC quantity does not equal zero (block 2814), the section address is incremented by 10 (block 2816) to move the memory pointer to the first memory location for data pertaining to the next class of service. The quantity 10 is added since each class of service is defined in the directory table by 10 successive bytes of information. For example, referring briefly to FIG. 22, if the result of operation 2814 indicated that MSHIPC was something other than zero, the memory pointer would be moved in operation 2816 from the first byte of the letter class section of the directory table to the first byte of the parcel post section. Operations 2812, 2814 and 2816 form a loop which is reiterated until MSHIPC is decremented to zero. The loop is exited at point 2818, at which the memory pointer is set to the first byte of the data section pertaining to the selected class of service. When the directory table section for the selected class of service has been located, a check 2820 is made as to whether keyboard entries indicate air or surface shipment. If air shipment is indicated, the memory pointer is incremented by 5 to move the pointer to the first entry in the second half of the selected directory table section. Referring briefly to FIG. 23, it will be recalled that the second half of each section contains data pertaining to the air mode of shipment for the selected class of service. If air shipment is not indicated, operation 2822 is bypassed through branch 2824, leaving the memory pointer at the first entry in the surface shipment subsection of the selected section. When the proper directory table subsection has been located, the group table address, vector table address and chart descriptor byte in that subsection are loaded into working memory and the chart descriptor byte is read (operation 2826) to determine whether a normal or a forced address approach is indicated for obtaining the rate chart address. If a forced approach is to be employed, the program follows a branch beginning with an operation wherein a rate chart pointer is initialized at the address in the vector table as shown in a block 2902. Thereafter, a table code counter is zeroed as shown at block 2904 and a determination is made as to whether the entered country code number equal the table code number in the counter (block 2906). It should be appreciated that in the vector table for the forced approach successive two byte addresses for the rate chart of each valid country are sequentially stored as illustrated in FIG. 26. If the country code number in the counter is not equal to the country code number designated at the pointer storage location, the table code counter is incremented and the rate chart pointer is incremented (block 2909) to the next sequentially stored address position, i.e. incremented by two bytes, as shown in block 2908. Thereafter, decision block 2906 is reiterated with successive incremented code counter values until an equality between the incremented code counter value and the entered country code number is obtained. When a match is reached in a decision block 2906, the two byte rate chart address at the pointer is loaded as shown in a block 2910. When the normal approach to rate chart address generation is employed, the first step is to direct a memory pointer to the first country code number location (block 2920) in the group table identified by the directory table entry for the selected class of service and selected mode of shipment. A group number counter is then initialized (block 2922) to a FF.sub.16 value. The group number counter is then incremented by 1 (block 2924) to effectively reset it to zero and a zone number counter is initialized to an FF.sub.16 value. The zone number counter is incremented (block 2926) to zero it. In the context of this approach, the term zone is used to refer to the position of a country code number within a particular group. Initially, the memory pointer is at the country 000 address in the group table while both the group number counter and the zone number counter are at 0. The address pointer is incremented and the processor accumulator is loaded with the country code number from the addressed location in the group table (operation 2928). A decision (block 2930) is made as to whether the country code number loaded into the accumulator from the group table corresponds to the country code number entered through the keyboard. If there is a match, program control goes directly to a point 2932 via a branch 2934 since such a match indicates that the group including the selected country has already been located. If, however, the country code number obtained from the table does not match the entered country code number, a check (2936) is made as to whether the end of the group has been reached. As indicated earlier, the end of each group is recognized as specific delimiter value, preferably FF.sub.16. If the specific delimiter value is not sensed in operation 2936, a further determination 2938 is made as to whether the end of the table (denoted by an FF.sub.16 entry) has been reached. If neither the end of the group nor the end of the table has been reached, program control returns to operation 2926 via branch 2940. The zone number counter is incremented by 1 and the address pointer is incremented by 1 to point to the next country code number within the same grouop. The new country code number obtained from the group table is then compared to the entered country code number. When a match is detected, program control jumps directly to output point 2932 via branch 2934. But until a match is detected, or until the end of a group is reached, the program loop beginning with operation 2926 and ending with operation 2938 is repeated with the zone number counter and address pointer being incremented once per cycle and with one comparison per cycle being made between the country code number from the group table and the entered country code number. When the end of a group entry (FF.sub.16) is sensed, the program branches back to operation 2924 through branch 2942. The group number counter is then incremented by 1 to indicate that the next group has been reached and the zone number counter is again initialized. The second group and, if necessary, subsequent groups are searched sequentially until a match is detected between the country code number retrieved from the group table and the entered country code number. If no match is detected before the end of table delimiter (FF.sub.16) is detected, this is taken to be an indication that the selected country lies in a last group of countries not even listed in the group table. Under these conditions, the group number counter is incremented (operation 2944) before the program reaches exit point 2932. By setting the table up in this manner, unnecessary searching of country code numbers is avoided. If the country code number entered through the keyboard is a valid code number but has not been found during the search of all groups preceding the FF.sub.16 delimiter the assumption is that the country code number lies within the last group. A search through the last group is not necessary. Because the memory space normally required to list the last group of countries in not needed, the last group should contain the largest number of countries. Using the group number obtained from the above-identified steps and the starting address for the vector table appropriate to the class of sevice and mode of shipment, the specific vector table address for the generated group number is itself generated in an operation 3002. The weight limit byte stored at the selected vector table address is loaded into working storage (operation 3004) and a check 3006 is made as to whether the weight limit byte is equal to FF.sub.16. The FF.sub.16 value indicates that there is no valid postal service for the nominally selected class of service and mode of shipment. An error flag is set (operation 3008) and control is returned to a main program. If the weight limit byte is not equal to FF.sub.16 a second check 3010 is made as to whether the scale weight is more than the weight limit specified by the byte. If the scale weight is greater than the specified weight limit, an overweight flag is set (block 3012) before the routine is exited. However, if the scale weight is within the specified weight limit, an index pointer is incremented (operation 3014) to point to the rate chart starting address specified in the vector table. The rate chart starting address is loaded into working memory (block 3016) and tthe domestic postage computation routine is called. It will be noted that where the forced address generation approach is used, program control jumps directly from operation 2910 to the point 3018 at which the domestic postage computation routine is called. While it might appear that use of the forced approach is actually preferable since fewer program operations are to be performed, this is not necessarily the case since a considerably greater amount of memory is required to store separate rate chart addresses for each country. The normal approach, however, is premised upon present international mail rates wherein groups of countries share the same rate chart. Thus, such countries are grouped together and treated the same which reduces the memory space. The system has been described thus far without reference to specific processors or specific programming languages since different commercially-available processors and different programming languages compatible with the particular processors might be used. In a preferred embodiment, the systems central processing unit 140 may be a PPS-4/1 one chip microcomputer, MM-76 series. The communications controller/processor 64 is an A-79 processor chip. The scale subsystem processor and the peripheral subsystem processor are preferably MM-78 Series microcomputers while the postage printer subsystem processor is preferably a MM-77 Series microcomputer. All of the foregoing microcomputer products are manufactured by Rockwell International Corporation of Anaheim, California. Instruction Sets for programming these devices are disclosed in Product Description, MM-76 Series, March 1977, Revision: 3, 2941ON41, and Product Description, MM-77 and MM-78, March 1977, Revision: 3, 2941ON42, both available from Rockwell International Corp. Given the rate chart formats described herein, the actual rate charts can be constructed using data published by the United States Postal Service and the United Parcel Service. While there has been described what is considered to be a preferred embodiment of the invention, variations and modifications therein will occur to those skilled in the art when they become acquainted with the basic concepts of the invention. Therefore, it is intended that the appended claims shall be construed to include the preferred embodiment and all such variations and modifications as fall within the true spirit and scope of the invention.
|
Same subclass Same class | ||||||||||
