Your posted image is exactly specific to your question.
"5001" is reserved for the Device Control Ports. That's the IO ports. On your "tree", it is the CONTROLLER.
"5002" is reserved for the the AV SWITCHER/SCALER. That's NOT the IO ports. It's a specific device - the SWITCHER.
If you open the 5001 device on the Netlinx tree display, you will see all the IO control ports. Serial ports are first, one per serial control jack, then the relays as a group on one port, then the IR ports individually, and finally the IO Sense ports as a single group.
This and (much) more information on IO ports in the documentation of NetLinx controllers.
Sure, you control the switcher, but you control it WITH the build in controller, you always use that.
You can think of device 5002 as an external device that they put in the same casing, it has nothing to do with the controller.
An AMX controller consists of the 'master' (device 0) and the integrated devices (serial ports, ir ports, relays, i/o ports, axlink) on device 5001 (default).
Hth, good luck