Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I detect the number of channels on an oscilloscope?

Solved!
Go to solution

I have various oscilloscope models sitting around the lab, some two-channel, some four-channel.  I would like for my program to be able to detect how many channels are available.

 

I can just tell my program how many channels are available based on model number, but is there a VISA command to ask the scope directly what channels it has?  I would also like to be able to ask it what, if any, math function capability it has. 

0 Kudos
Message 1 of 7
(5,083 Views)
The only relationship between VISA and your problem is that you would use VISA to write any instrument specific command that might exist and then use VISA to read the response.
0 Kudos
Message 2 of 7
(5,072 Views)
all oscilloscope drivers should return the instrumentID after the initialize and that should be enough to know the number of channels
greetings from the Netherlands
0 Kudos
Message 3 of 7
(5,045 Views)

"The only relationship between VISA and your problem is that you would use VISA to write any instrument specific command that might exist and then use VISA to read the response."

 

Sorry, you're right.  I meant SCPI, not VISA.  I can access individual channels in with :CHAN<n>, where <n> is the channel number, but I don't know what acceptable values for <n> are.  Although, as I look more into SCPI, it looks like :CHAN<n> may be instrument specific.

 

 "all oscilloscope drivers should return the instrumentID after the initialize and that should be enough to know the number of channels"

 

 This gives me manufacturer, model number, serial number, software revision.  It tells me nothing about number of channels.

0 Kudos
Message 4 of 7
(5,041 Views)
Yes, each instrument has it's own (and often quite different) set of SCPI commands. You'll have to read the manual of each. Perhaps CHAN? is supported? If you did a CH 3 command on a two channel scope, perhaps the scope would generate an error. Unfortunately, I don't know of a quick and easy way.
0 Kudos
Message 5 of 7
(5,026 Views)
Solution
Accepted by topic author treespicer

"all oscilloscope drivers should return the instrumentID after the initialize and that should be enough to know the number of channels"

 

What Albert was refering to is that all IVI Scope compliant drivers in their base class interface have a property/attribute which tells you how many channels the scope has.

 

If you don't want to use the IVI driver for the scope then maybe download some of the drivers and look at the source code to see how they calculate this dynamic repeated capablity.

 

0 Kudos
Message 6 of 7
(5,016 Views)

I had looked for this attribute and couldn't find it, but once you said that all IVI scope drivers have this I looked a bit harder and was able to find it.  If all IVI scope-compliant drivers are required to support this, then I think I have what I need.

 

Thanks! 

0 Kudos
Message 7 of 7
(5,007 Views)