Is there a function that returns all instrument VISA resources as a table?

3 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 16 Jun 2022
Edited: MathWorks Support Team on 16 Jun 2022
The visadevlist function, available in MATLAB R2021a and newer releases, returns available VISA resources as a table.
The attached visalist.m convenience function uses the legacy instrhwinfo command to return a table output similar to the new visadevlist function. visalist is expected to work with MATLAB R2016b or newer releases.
By default, visalist will return the VISA resource names as provided by the installed vendors' VISA libraries, without any additional instrument information.
>> visalist
8×2 table
ResourceName Adaptor
____________________________________________ __________
1 "ASRL3::INSTR" "ni"
2 "ASRL5::INSTR" "ni"
3 "ASRL6::INSTR" "ni"
4 "ASRL7::INSTR" "ni"
5 "ASRL8::INSTR" "ni"
6 "TCPIP0::127.0.0.1::5000::SOCKET" "keysight"
7 "USB0::0x2A8D::0x1797::CN58236453::0::INSTR" "keysight"
8 "USB0::0x2A8D::0x1797::CN58236453::INSTR" "ni"
To also output instrument auto-identification information (instrument manufacturer/vendor, model, and serial number), as a response to *IDN? command, use the following syntax:
>> visalist(true)
ans =
8×5 table
ResourceName Vendor Model SerialNumber Adaptor
____________________________________________ _______________________ _____________ ____________ __________
1 "ASRL3::INSTR" "" "" "" "ni"
2 "ASRL5::INSTR" "" "" "" "ni"
3 "ASRL6::INSTR" "" "" "" "ni"
4 "ASRL7::INSTR" "" "" "" "ni"
5 "ASRL8::INSTR" "" "" "" "ni"
6 "TCPIP0::127.0.0.1::5000::SOCKET" "" "" "" "keysight"
7 "USB0::0x2A8D::0x1797::CN58236453::0::INSTR" "KEYSIGHT TECHNOLOGIES" "DSO-X 1102G" "CN58236453" "keysight"
8 "USB0::0x2A8D::0x1797::CN58236453::INSTR" "KEYSIGHT TECHNOLOGIES" "DSO-X 1102G" "CN58236453" "ni"
Note that:
  • If the instrument does not respond to *IDN? command, or if visa cannot connect to the instrument, the auto-identification information will be empty.
  • If the hardware configuration changes (for example, if you connect/disconnect instruments) execute instrreset before visalist to get updated information.

More Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!