I have 6 Agilent series E3630 power supplies all connected to my test system via GPIB interface. Most are single channel but some have 2 channels and some have 3 channels. My program needs to identify the channel capabilities of each power supply at run time. I have been using INST:NSEL n for n = 1 to whatever until no new channels are detected but if I write INST:NSEL 3 to a power supply that only has 2 channels I get the error -222,"Data out of range" So really what I need is to know the number of channels before I begin to query about their output capabilities. Isn't there some command that will return the number of channels for a given power supply? FYI I am not using Labview, Visa, IVI, measurement studio or anything like that. I simply send commands with the NationalInstruments.NI4882 dll.