Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout error from waitcomplete() function #19

Open
soha-namnabat opened this issue Jan 8, 2021 · 1 comment
Open

timeout error from waitcomplete() function #19

soha-namnabat opened this issue Jan 8, 2021 · 1 comment

Comments

@soha-namnabat
Copy link

Hi,
I am trying to use this driver to trigger a 2602B SMU to perform some measurements but I am facing timeout errors while using the waitcomplete function as suggested in the manual. Have you tried it ? and have seen it to work?

this is the lua code example I am trying to replicate :

smua.trigger.source.linearv(10, 100, 10)
smua.trigger.source.action = smua.ENABLE
-- Configure TRIG key press as input trigger for source action.
smua.trigger.source.stimulus = display.trigger.EVENT_ID
-- Command SMU to execute a single 10-point sweep.
smua.trigger.count = 10
smua.trigger.arm.count = 1
-- Turn on the output in preparation for the sweep
smua.source.output = smua.OUTPUT_ON
-- Start the sweep and clear the event detectors.
smua.trigger.initiate()
-- The SMU will wait for the front panel TRIG key press before executing
-- each source action.
-- Wait for the sweep to complete.
waitcomplete()

it works after pressing the TRG button on display for a couple times but then face timeout!
Do you get a similar problem? should I add python based pause ?

thanks
Soha

@samschott
Copy link
Member

@soha-namnabat, I am not actually certain what the waitcomplete function does. From the Keithley 2600 reference manual:

This function will wait for all previously started overlapped commands to complete.

This definately applies to all measurements started with a smuX.measure.overlappedY() command but a triggered sweep may not qualify as such a group of "started overlapped commands".

Personally, I use a somewhat different approach in the voltage_sweep_single_smu method here:

# INITIATE MEASUREMENT
# prepare SMUs to wait for trigger
smu.trigger.initiate()

# send trigger
self.send_trigger()  # self._write("*trg")

# CHECK STATUS BUFFER FOR MEASUREMENT TO FINISH
# Possible return values:
# 6 = smua and smub sweeping
# 4 = only smub sweeping
# 2 = only smua sweeping
# 0 = neither smu sweeping

# while loop that runs until the sweep begins
while self.status.operation.sweeping.condition == 0:
    time.sleep(0.1)

# while loop that runs until the sweep ends
while self.status.operation.sweeping.condition > 0:
    time.sleep(0.1)

In the above code, self stands for the actual Keithley instance. Let me know if this works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants