In MAXX most users programs are just called PROGRAMS. There are, for special purposes, some other user programs called PARTS. What are they? And why do we need them?
First of all, we don’t need them! You can’t do anything with PARTS that you can’t do with PROGRAMS. There are some things however that you can do more easily. For example:
Sometimes you may want to sort out a lot of zener diodes with VZ values that span several different part numbers. You may have a preference for a particular part number where the specifications overlap. Later your preference regarding part number(s) may change.
You can of course write a program suitable for each lot and for each preferred part. If you do this you will find that each program will contain many common elements. Also keeping track of all the various programs may be difficult. Then what happens if the specs' for a few part numbers need to be changed? Now you need to find each PROGRAM that has a sort to the changed part number and change it. Bother!
You can write a PROGRAM called a TEMPLATE that contains a sorting program for up to nine PARTS. This program contains all of the conditional jumps and bin sort information. This is the most difficult part of the programming task but it is the part that seldom changes. You probably can’t get by with just one TEMPLATE, but you typically won’t need very many. More about templates later.
The PART program on the other hand, contains no jumps or bin sort information, just a list of the tests (up to six) and the forcing and limit values. Consider the sample PART below.TITLE
TEST 1 VZ 3MA >42.57V <43.43V
TEST 2 ZZT 3MA 43V <93R
TEST 3 ZZK .25MA 43V <900R
TEST 4 IR 33V <100NA T50
TEST 5 VF 200MA <1.1V
TEST 6 MP
Notes: After you finish reading this, you may wonder if PARTS and TEMPLATES are worth the trouble. I don’t know. We have some customers who use them all the time and some that never use them. You might want to weigh the pros and cons and then decide. Please let us know if we can help.
One relevant thought is this. A well designed standard PROGRAM is fairly easy to edit to create a new PROGRAM, and if you have a well thought out file naming system, they are easy enough to keep track of.The sequence numbers 1-6 are always the same but they will be relocated when the part is loaded (using CLOAD).
All six tests must be programmed since the TEMPLATE will expect them all to “pass”. Set all unused tests to MP.
In a typical TEMPLATE a jump on fail will fail on test 1 will skip the tests 2-6 if test 1 fails. The jump target will be the VZ test in the next PART. (JF +6)
Usually (but not always) your template will cause a jump to END if any test 2-5 fails, since this usually means that the part won’t be good for any sort.
HOW TO MAKE A PART
To write a PART from scratch, just enter the command SCR to erase any existing program, then write a program similar to the example above. When you have finished save it with RECORDC <filename>. The PART program will be saved to the directory C:\MAXX\PARTS.
You may want to just edit an existing PART program. In that case load it with ELOAD, then edit it and save as above. Be sure to use ELOAD not CLOAD. ELOAD loads a part for editing, and CLOAD loads it for testing.
HOW TO MAKE A TEMPLATE
A TEMPLATE is substantially the same as a PROGRAM. In fact, MAXX can’t tell the difference unless you tell it. You do that anytime while you are writing one by entering the command TEMPLATE.
There are some differences in content though. The PARTS programs will overlay the TEMPLATE (later) starting with bin 1 at TEST 3. Each part uses 6 tests and you can CLOAD up to nine PARTS. So TESTS 3-56 will be programmed to accept the PARTS programs by entering the tests as MP and adding the desired conditional and unconditional jumps.
Program the bin sorts by requiring the bins 1-9 to pass their respective tests (tests 3-8 for bin 1, for example).
You can enter other tests in TEST 1,2 and 57-75. You can use these other tests for anything you please. Some practical uses might be to add common tests for all sorts or to sort out the rejects (parts not in bins 1-9).
TEMPLATES typically contain many conditional and unconditional jumps. Sometimes a programmer will forget the jump on pass on the last test for each bin (8,14,etc). At that point in the program if the test passes, there is no need to test it for any other sort (although you may want to add some more common tests).
If you need more than two pre-qualifying tests before test 3, you can do that by jumping to a test beyond test 56, then doing your tests and jumping back to 3.
USING TEMPLATES AND PARTS
First load a suitable TEMPLATE using LOAD <filename>. If you forget, MAXX will remind you when you try to overlay the PARTS.
Normally the default for the next bin is 1 but if you are not sure, enter BIN# 1. Now you can overlay your first PART with CLOAD <filename>. The pointer will be incremented so that the next part will overlay bin 2. Note that the PART titles appear on the screen so that you can see what you are doing.
If you want to overly a particular bin out of sequence, that’s ok, just enter BIN#n and then go ahead and CLOAD it.
If you don’t use all of the parts available (1-9) you should probably have a dummy PART program available to load in each of the unused positions. This dummy should be written so that it could not possibly “pass”. This will prevent parts from falling to these sorts.
We don’t want this dummy to waste a lot of time, so how about something that doesn’t actually test anything.TEST 1 RATIO 1 1 >1 <.9
That ought to do it.
Do you want to name this part “DUMMY”? You decide. I put that name in a program once and one of my customers called me up to ask why my program insulted him!