visastatus
Description
Examples
Check VISA Resource Status
Create a connection to an oscilloscope using the VISA-GPIB interface.
v = visadev("GPIB0::11::INSTR");
Configure the oscilloscope to request service when a command error occurs.
writeline(v,"*CLS"); writeline(v,"*PSC 0"); writeline(v,"*ESE 0"); writeline(v,"DESE 0"); writeline(v,"*SRE 32");
Send the "Volt?"
query to the oscilloscope. Since it is an
invalid command, a command error occurs.
writeline(v,"Volt?");
Check whether the oscilloscope has requested service.
visastatus(v)
ans = logical 1
Since a command error occurs when you send the "Volt?"
command,
the oscilloscope has requested service.
Input Arguments
v
— VISA resource
visadev
object
VISA resource, specified as a visadev
object.
Example: visastatus(v)
checks the status of the VISA resource
service request.
Output Arguments
tf
— True or false result
1
| 0
True or false result, returned as a 1
or 0
of
data type logical
.
Data Types: logical
status
— Status byte register
double | 0 to 255
Status byte register, returned as a positive integer from 0 to 255. You can convert
this value to its binary value using dec2bin
and interpret each bit
as information about the VISA resource.
Each bit is associated with a type of event. For example, bit 6 (RQS) indicates the status of the VISA resource service request.
Status Byte Register Bits
Bit | Label | Description |
---|---|---|
0-3 | – | Instrument-specific summary messages. |
4 | MAV | The Message Available bit indicates if data is available in the Output Queue. MAV is 1 if the Output Queue contains data. MAV is 0 if the Output Queue is empty. |
5 | ESB | The Event Status bit indicates if one or more enabled events have occurred. ESB is 1 if an enabled event occurs. ESB is 0 if no enabled events occur. You enable events with the Standard Event Status Enable Register. |
6 | MSS | The Master Summary Status summarizes
the ESB and MAV bits. MSS is 1 if either MAV or ESB is 1. MSS is 0 if both
MAV and ESB are 0. This bit is obtained from the |
RQS | The Request Service bit indicates that the instrument requests service. This bit can be used for serial polling. | |
7 | – | Instrument-specific summary message. |
Data Types: double
Version History
Introduced in R2021a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)