Exemple #1
0
    def __init__(self, gpib_address):
        self.gpib_address = gpib_address

        # Configure Control Loop Parameters
        send_GPIB('\"CSET 1 A 1 on\"', self.gpib_address)
        self.input = 'A'
        self.controlLoop = '1'
Exemple #2
0
    def heater_output(self):
        '''
        Query Heater Output (0 to 100%).

        :Return: heater output in percent.
        '''
        send_GPIB('HTR?', self.gpib_address)
        return float(receive_GPIB(self.gpib_address))
Exemple #3
0
    def get_setpoint(self):
        '''
        Query Control Loop Setpoint.

        :Return: Returns the control loop setpoint.
        '''
        send_GPIB('\"SETP? ' + self.controlLoop + '\"', self.gpib_address)
        return float(receive_GPIB(self.gpib_address))
Exemple #4
0
    def v(self):
        '''
        Reads a voltage value in Volts.

        :return: measured voltage in volts.
        '''

        send_GPIB(':READ?', self.gpib_address)

        return float(receive_GPIB(self.gpib_address))
Exemple #5
0
    def heater_range(self, *args):
        '''
        heater_range() >> Query Heater Range.
        heater_range(0-5) >> Configure Heater Range (from 0 to 5).

        :params range: heater range.

        :Return: the heater range.
        '''
        if len(args) == 1:
            send_GPIB('\"Range ' + str(args[0]) + '\"', self.gpib_address)
        else:
            send_GPIB('RANGE?', self.gpib_address)
            return float(receive_GPIB(self.gpib_address))
Exemple #6
0
    def t(self, *args):
        '''
        t() queries temperature.
        t(setpoint) sets the setpoint temperature of the selected input.

        :params setpoint: temperature setpoint in Kelvin.
        '''

        if len(args) == 1:
            send_GPIB(
                '\"SETP ' + self.controlLoop + ', ' + str(args[0]) + '\"',
                self.gpib_address)
        else:
            send_GPIB('\"KRDG? ' + self.input + '\"', self.gpib_address)
            return float(receive_GPIB(self.gpib_address))
Exemple #7
0
    def set_A(self, current):
        '''
        Set current in Ampere.

        :params current: Output current in Amps.
        '''
        return send_GPIB('CURR '+ str(current), self.gpib_address)
Exemple #8
0
    def set_range(self, currentRange):
        '''
        Set current range in Ampere. Selecting a fixed source range disables autorange.
        Ranges: 2nA, 2µA, 2mA, 20nA, 20µA, 20mA, 200nA, 200µA, 100mA

        :params currentRange: Current range in Amps.
        '''
        return send_GPIB('CURR:RANG '+ str(currentRange), self.gpib_address)
Exemple #9
0
    def set_compliance(self, complience):
        '''
        Set voltage complience in volts.

        The voltage compliance limit can be set from 0.1V to 105V in 10mV steps

        :params complience: Voltage complience in volts.
        '''
        return send_GPIB('CURR:COMP '+ str(complience), self.gpib_address)
Exemple #10
0
    def __init__(self, gpib_address):
        self.gpib_address = gpib_address

        # INITIAL CONFIGURATION (Edit acording to your needs) =============
        # Restore GPIB and remote options to default.
        send_GPIB('*RST', gpib_address)

        # Select function: ‘VOLTage’ or ‘TEMPerature’.
        send_GPIB('\":sens:func \'volt\'\"', gpib_address)

        # Select channel: 0 (internal temperature sensor), 1, or 2.
        send_GPIB('\":sens:chan 1\"', gpib_address)

        # Enable/disable channel 1 auto range; (ON or OFF).
        send_GPIB('\":sens:volt:chan1:rang:auto ON\"', gpib_address)
Exemple #11
0
 def output_resp_SLOW(self):
     '''
     Select slow output response speed for 6221.
     '''
     return send_GPIB('OUTP:RESP SLOW', self.gpib_address)
Exemple #12
0
 def clear(self):
     '''
     Turns output off and sets output level to zero.
     '''
     return send_GPIB('CLE', self.gpib_address)
Exemple #13
0
 def AutoRange_OFF(self):
     '''
     Disables source autorange
     '''
     return send_GPIB('CURR:RAN:AUTO OFF', self.gpib_address)
Exemple #14
0
 def AutoRange_ON(self):
     '''
     Enables source autorange
     '''
     return send_GPIB('CURR:RAN:AUTO ON', self.gpib_address)
Exemple #15
0
 def output_OFF(self):
     '''
     Turn output off.
     '''
     return send_GPIB('OUTP OFF', self.gpib_address)
Exemple #16
0
 def output_ON(self):
     '''
     Turn output on.
     '''
     return send_GPIB('OUTP ON', self.gpib_address)
Exemple #17
0
 def output_resp_FAST(self):
     '''
     Select fast output response speed for 6221.
     '''
     return send_GPIB('OUTP:RESP FAST', self.gpib_address)
Exemple #18
0
 def filter_Off(self):
     '''
     Disables the output analog filter.
     '''
     return send_GPIB('CURR:FILT OFF', self.gpib_address)
Exemple #19
0
 def filter_ON(self):
     '''
     Enables the output analog filter.
     '''
     return send_GPIB('CURR:FILT ON', self.gpib_address)
Exemple #20
0
# -*- coding: utf-8 -*-
"""
amreft-m4p example script 0.

@author: Carlos galdino
[email protected]
"""

from KUSB_488A_communication import init_gpib, terminate_gpib, send_GPIB, receive_GPIB

# %% Initizalize communication

comm_gpib = init_gpib()

# %% Send and receive identification message on adress 3

sent1 = send_GPIB('*idn?', 1)
received1 = receive_GPIB(1)
print(received1)

# %% Terminate communication

terminate_gpib(comm_gpib)