IWATSU SC7203 GPIB, no documentation: what to do?  - Page 1
Forum section: electronics / testgear

author: justanothername
author_rank: Regular Contributor
timestamp: March 22, 2020, 10:45:42 pm
content: Hi Everyone!I got an Iwatsu SC-7203 with SC-0111 GPIB option. Unfortunately in the user manual (available from the official website from Iwatsu) there is not documentation about the GPIB commands.Asides from *IDN? which strangely always answers EEE#O9999999999E+9, I haven't found a way to get anything else out of this instrument.I tried other Iwatsu commands like those from SC-7207H, but without any luck. Since I'm not that of a specialist with GPIB, I may have missed something essential.Can anyone help me to get started or does anyone have a command reference for this instrument?

author: justanothername
author_rank: Regular Contributor
timestamp: March 23, 2020, 12:45:39 am
content: For all those that have the same Instrument, I got it working, sort of.I oriented myself with the manual of this old instrument:http://www.iti.iwatsu.co.jp/manual/pdf/voac7510_13-ope-v2-e-t.pdfI figured out these commands:C - clear instrumentG0 - get measurementG1 - get measurement (same as G0?)modes:F0 - check on (no turning off with anything but C)F1 - Freq CF2 - Freq AF3 - Period AF4 - f1/f2 A/BF5 - f1-> f2 A -> BF6 - TIME INT A -> BF7 - MANUAL Agate:R0 - EXT GATE BR3 - 1msR4 - 10msR5 - 100msR6 - 1sR7 - 10sI found these out by trying, but don't yet know what they mean:P0 - set default number format?P4 - displays H in front of the display and the readout will look like this: F C H 105.5293E+0, I guess this has something to do with programming modes.P4 - displays E in front of the display and the readout will look like this: F S E 105.3383E+0

author: justanothername
author_rank: Regular Contributor
timestamp: April 18, 2020, 12:14:21 pm
content: Here is code in python file i've written to control this instrument using pyvisa:Code:'''IWATSU COUNTER CODESC - clear instrumentG0 - get measurementG1 - get measurement (same as G0?)modes:F0 - check on (no turning off with anything but C)F1 - Freq CF2 - Freq AF3 - Period AF4 - f1/f2 A/BF5 - f1 - f2 A - BF6 - TIME INT A -> BF7 - MANUAL Agate:R0 - EXT GATE BR3 - 1msR4 - 10msR5 - 100msR6 - 1sR7 - 10s'''import pyvisaimport enumimport timeclass Measurement:def __init__(self):self.raw = ""self.value = 1.0self.overflow = Falseself.unit = ""# Command, Timeout for Gates(ms)GATEMODES_LIST = (('R0', 2),('R3', 4),('R4', 23),('R5', 220),('R6', 2020),('R7', 20000),)# Command, Timeout for Gates(ms)MEASMODES_LIST = ('F0','F1','F2','F3','F4','F5','F6','F7',)def get_available_devices():rm = pyvisa.ResourceManager()devices = rm.list_resources()rm.close()return devicesdef _decode(rawdata):measurement = Measurement()measurement.raw = rawdataprint(rawdata)print(len(rawdata))# in case of errorif len(rawdata) is 20:measurement.value = float(rawdata[6:19])print("SC720x reported an error")else:measurement.value = float(rawdata[5:18])if rawdata == "O":measurement.overflow = Trueif rawdata[0:2] == "F ":measurement.unit = "HZ"elif rawdata[0:2] == "FR":measurement.unit = "NONE"elif rawdata[0:2] == "FD":measurement.unit = "NONE"elif rawdata[0:2] == "TI":measurement.unit = "SEC"elif rawdata[0:2] == "P ":measurement.unit = "SEC"return measurementclass SC720X(object):class GateModes(enum.Enum):EXT_GATE_B = 0INT_1MS = 1INT_10MS = 2INT_100MS = 3INT_1S = 4INT_10S = 5class MeasModes(enum.Enum):CHECK_ON = 0FREQ_C = 1FREQ_A = 2PERIOD_A = 3A_DIV_B = 4A_MINUS_B = 5A_TO_B = 6MANUAL_A = 7def __init__(self, address):self._address = addressself._rm = pyvisa.ResourceManager()self._inst = self._rm.open_resource(address)self._inst.write_termination = "\n"self._inst.timeout = 10self._settle_time = 0.2self._inst.clear()self.gatemode = self.GateModes.INT_1Sself.measmode = self.MeasModes.FREQ_Cdef __del__(self):self._rm.close()def get_measurement(self):self._inst.timeout = GATEMODES_LIST[self._gatemode.value]try:result = self._inst.query('G0?')except:return Nonereturn _decode(result)def clear(self):self._inst.write('C')time.sleep(self._settle_time)@propertydef gatemode(self):return self._gatemode@gatemode.setterdef gatemode(self, mode):if not isinstance(mode, self.GateModes):raise TypeError('mode must be an instance of GateModes Enum')self._gatemode = modeself._inst.write(GATEMODES_LIST[self._gatemode.value])time.sleep(self._settle_time)@propertydef measmode(self):return self._measmode@measmode.setterdef measmode(self, mode):if not isinstance(mode, self.MeasModes):raise TypeError('mode must be an instance of GateModes Enum')self._measmode = modeself._inst.write(MEASMODES_LIST[self._measmode.value])time.sleep(self._settle_time)if __name__ == '__main__':import timeinstrument = SC720X("GPIB1::0::0::INSTR")instrument.measmode = instrument.MeasModes.FREQ_Ainstrument.gatemode = instrument.GateModes.INT_1Smeas = instrument.get_measurement()print("raw answer: " + meas.raw)print("value: " + str(meas.value))print("unit: " + meas.unit)print("overflow: " + str(meas.overflow))del instrument