Tray numbers in PCL are non-intuitive, for two reasons.  First, the earliest Laserjets included trays 2 and 3 as manual and envelope feed trays.  When they added additional trays, they had to start with "4".  In addition, in the PCL5 specification, HP didn't dictate tray numbers after the first three, resulting in different vendors using different tray numbers for large scale printers with more than three input trays.

Generally, you can rely on trays 1, 4, and 5 being the first three trays of a printer, but after that, you need to either find a printer-specific manual or spec sheet that defines the tray numbers (as defined in the "paper source" escape sequence), or experiment to find the right numbers.

To experiment, you can write a rule set that will print multiple copies, one for each tray number you want to test, then put identifiable paper in each tray and run the rule set.  The paper for any given tray will have the tray number printed in bold.  Unrecognized tray numbers will usually pull from the default tray.  Here is a sample rule set you can use:

# traytest.rul


pcopies 20

text 35,30,{"Tray number "+str(copy)},cgtimes,16,bold


if copy=2 or copy=3 then skip=1



Run this as: uf90c -i /dev/null -f traytest.rul -r traytest -o traytest.pcl

You can now copy traytest.pcl to any printer you want to test:

Linux: lp -dprinter -oraw traytest.pcl

Windows: copy traytest.pcl \\server\sharename