spoll
(To be removed) Perform serial poll on GPIB objects
This gpib object function will be removed in a future release.
Use visadev object functions instead. For more information, see Version History.
Syntax
out = spoll(obj)
out = spoll(obj,val)
[out] = spoll(obj)
[out,statusByte] = spoll(obj)
[out] = spoll(obj,val)
[out,statusByte] = spoll(obj,val)
Arguments
| A GPIB object or an array of GPIB objects. |
| A numeric array containing the indices of the objects in
|
| The GPIB objects ready for servicing. |
| The service request (SRQ) line status byte. |
Description
out = spoll(obj) performs a serial poll
on the instruments associated with obj. out
contains the GPIB objects that are ready for servicing. If no objects are ready for
servicing, then out is empty.
out = spoll(obj,val) performs a serial
poll and waits until the instruments specified by val are ready
for servicing. An error is returned if a value specified in val
does not match an index value in obj.
Using this syntax, spoll blocks access to the MATLAB Command Window until the objects specified by val
are ready for servicing, or a timeout occurs for each object specified by
val. The timeout period is specified by the
Timeout property.
[out] = spoll(obj) returns the object or an array of
objects.
[out,statusByte] = spoll(obj) returns the status byte along
with the object or an array of objects.
[out] = spoll(obj,val) returns the object and the value
specified in the index value of the object.
[out,statusByte] = spoll(obj,val) returns the status byte
along with the object and the value specified in the index value of the
object.
Examples
If obj is a four-element array and val is
set to [1 3], then spoll will block access to
the MATLAB Command Window until the instruments connected to the first and third
GPIB objects have both asserted their SRQ line, or a timeout occurs.
Example of second output argument:
g1 = gpib('ni', 0, 1);
g2 = gpib('ni', 0, 2);
fopen([g1 g2]);
out1 = spoll(g1);
out2 = spoll([g1 g2], 1);
out3 = spoll([g1 g2], [1 2])
[out4 statusBytes] = spoll([g1 g2])
[out5 statusBytes] = spoll([g1 g2], 2)
fclose([g1 g2]);Tips
Serial polling is a method of obtaining specific information from GPIB objects
when they request service. When you perform a serial poll, out
contains the GPIB object that has asserted its SRQ line.
If obj is an array of GPIB objects
Each element of
objmust have the sameBoardIndexproperty value.Each element of
objis polled to determine if the instrument is ready for servicing.
If you specify a second output argument when you call an spoll,
full serial poll bytes are returned in addition to the SRQ line status in the second
argument.
Note
To get a list of options you can use on a function, press the Tab key after entering a function on the MATLAB command line. The list expands, and you can scroll to choose a property or value. For information about using this advanced tab completion feature, see Using Tab Completion for Functions.
Version History
Introduced before R2006aSee Also
visastatus | gpib | length | spoll (visa)