Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Source 6221: comp bit not set

6220, 6221 Current Sources
Post Reply
Tad Bak
Posts: 3
Joined: January 24th, 2017, 8:18 pm
Country: Australia

Source 6221: comp bit not set

Post by Tad Bak » January 24th, 2017, 8:59 pm

I am trying to control 6221 via GPIB from a custom C program. In the test program I set current and compliance voltage, switch source on (1.5 kohm resistor connected to the output), wait 50 ms and read status register (STAT:MEAS:COND?), then switch source off after another 5 s. That works almost fine, for example using the values 10 uA and 2.2 V I can see on the 6621 display the correct current and compliance voltage, the blue diode is steady and the retrieved value of the register is 0. After setting 5 mA and 0.25 V the blue diode is blinking, as expected, however the value of the register is still 0, Comp bit is not set to 1. Do I need to send some other commands first in order to obtain the proper status of the instruments? It identifies itself as: KEITHLEY INSTRUMENTS INC.,MODEL 6221,1291692,A05 /700x.

Thanks in advance for any suggestions.
Regards, Tad

Dale C
Keithley Applications
Keithley Applications
Posts: 2849
Joined: June 10th, 2010, 6:22 am
Country: United States
Contact:

Re: Source 6221: comp bit not set

Post by Dale C » January 26th, 2017, 7:44 am

The Measurement Status Register is a real time register.
It should reflect the present condition of the events/bits.
So :STAT:MEAS:COND? should come back with the COMP bit set if the unit is in compliance.
Since this does not seem to work reliably I normally use the SRQ on Compliance method.
Send the following commands.
:STAT:MEAS:ENAB 8 This sets the mask for the compliance event.
*SRE 1 This set the mask for the STB register.
*STB?
and look for bit 1 to set.
That should do it.

Tad Bak
Posts: 3
Joined: January 24th, 2017, 8:18 pm
Country: Australia

Re: Source 6221: comp bit not set

Post by Tad Bak » January 26th, 2017, 10:57 pm

Dale, thank you for your response. After sending my query and reading the manual again I have realised that condition register is real time, therefore I modified my program to read event register instead (:STAT:MEAS?), where the COMP bit should be latched. However, that did not help, the bit was still 0 in compliance conditions. Consequently, your suggestion did not work neither, because the mask in event enable register is AND-ed with event register, so the measurement summary bit was not set in status byte register.

Fortunately, it seems that I have solved my problem. It turned out that I have read the register to early, 50 ms after switching the current on, as I have mentioned in my first post. I had to increase this delay to 250 ms in order to get a meaningful response from the instrument. With that modification both: direct reading of the register and the SRQ method work fine.

Post Reply

Return to “Current Sources”

Who is online

Users browsing this forum: No registered users and 3 guests