0

I'm trying to do a IV curve measurement with Keithley and PyVISA. I found a Matlab example on Keithley website, but there's one section that I could not understand.

% Used the serail poll function to wait for SRQ
val = [1]; % 1st instrument in the gpib object, not the gpib add
spoll(obj1,val); % keep control until SRQ
fprintf(obj1,':TRAC:DATA?')

What exactly does this serial poll function do? And I don't have this spoll function in PyVISA, do I?

asked Apr 18, 2013 at 5:14

1 Answer 1

1

Serial polling is usually implemented in higher-level drivers. It is just repeated querying with the SCPI *STB? or the equivalent bus command.

PyVISA's read_stb(vi) calls VISA's viReadSTB(vi). With it you can do your own polling.

EDIT:

read_stb is from PyVISA's low-level module. To use the low-level calls you need to pass the vi field obtained from the instrument object.

There is a good example here but be sure to use the appropriate SCPI commands for your instrument and its status model.

Status polling depends on the status and event registers being set up before the measurements start. You can set up the instrument to indicate that samples are available or that measurement is complete.

If the bus is GPIB (IEEE 488.2) then PyVISA's wait_for_srq function will work because, on GPIB, SRQ is one of the bus signals. The code for that is also shown in the example.

answered Apr 19, 2013 at 0:47
Sign up to request clarification or add additional context in comments.

1 Comment

The pyvisa instrument has an stb property. In general I would prefer it over the lowlevel function.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.