Skip to content

AimTTi TF930 Frequency Counter

The AimTTi TF900 series of Benchtop Universal Counters with a USB Interface capable of measuring frequencies up to 3GHz or 6GHz. This library provides a python interface to the TF900.

TF930 Image

Reference Documents

Product Website

Datasheet

USB Driver Installation

USB Drivers

Programming Manual

Controlling FTDI USB Devices from Linux

Module Documentation

AimTTI Devices.

This module contains classes and functions for interfacing with AimTTI instrumentation

TF930

Bases: object

TF930 Frequency Counter.

This class controls a AimTTI TF930 Frequency Counter

Source code in f3ts_hardware_utils/aimtti.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
class TF930(object):
    """
    TF930 Frequency Counter.

    This class controls a AimTTI TF930 Frequency Counter
    """

    def __init__(self, port):
        """Initialize TF930 Serial Interface."""
        logger.info(f"TF930: connecting to instrument on port={port}")
        self.ser = serial.Serial(baudrate=115200, port=port)

    def close(self):
        """Close connection to instrument."""
        logger.info("TF930: closing connection to instrument")
        self.ser.close()

    def write(self, cmd):
        """Write a command to the instrument."""
        self.ser.write(f"{cmd}\n".encode("utf-8"))

    def send_cmds(self, cmds):
        """Send a list of commands to the instrument."""
        self.write([f"{cmd};" for cmd in cmds][0:-1])

    def read(self):
        """Read the frequency in Hz."""
        return float(self.ser.readline().decode("utf-8").strip("\r\n")[:-2])

    def set_input_period_b(self):
        """Set input period to B channel."""
        self.write("F0")

    def set_input_period_a(self):
        """Set input period to A channel."""
        self.write("F1")

    def set_input_frequency_a(self):
        """Set input frequency to A channel."""
        self.write("F2")

    def set_input_frequency_b(self):
        """Set input frequency to B channel."""
        self.write("F3")

    def set_frequency_ratio_b_to_a(self):
        """Set frequency ratio to B/A."""
        self.write("F4")

    def set_a_input_width_high(self):
        """Set A input width high."""
        self.write("F5")

    def set_a_input_width_low(self):
        """Set A input width low."""
        self.write("F6")

    def set_a_input_count(self):
        """Set A input count."""
        self.write("F7")

    def set_a_input_ratio_h_to_l(self):
        """Set A input ratio high to low."""
        self.write("F8")

    def set_a_input_duty_cycle(self):
        """Set A input duty cycle."""
        self.write("F9")

    def set_a_input_ac_coupling(self):
        """Set A input AC coupling."""
        self.write("AC")

    def set_a_input_dc_coupling(self):
        """Set A input DC coupling."""
        self.write("DC")

    def set_a_input_hi_z(self):
        """Set A input high impedance."""
        self.write("Z1")

    def set_a_input_lo_z(self):
        """Set A input low impedance."""
        self.write("Z5")

    def set_a_input_1_to_1_atten(self):
        """Set A input 1 to 1 attenuation."""
        self.write("A1")

    def set_a_input_5_to_1_atten(self):
        """Set A input 5 to 1 attenuation."""
        self.write("A5")

    def set_rising_edge(self):
        """Set trigger to rising edge."""
        self.write("ER")

    def set_falling_edge(self):
        """Set trigger to falling edge."""
        self.write("EF")

    def enable_low_pass_filter(self, state):
        """Enable low pass filter."""
        if state:
            cmd = "FI"
        else:
            cmd = "FO"

        self.write(cmd)

    def set_measurement_time(self, meas_time):
        """Set measurement time."""
        assert meas_time in [
            0.3,
            1,
            10,
            100,
        ], "Invalid setting, the following times are supported: 0.3, 1, 10, 100 seconds"

        if meas_time == 0.3:
            val = 1
        elif meas_time == 1:
            val = 2
        elif meas_time == 10:
            val = 3
        else:
            val = 4

        self.write(f"M{val}")

    def every_measurement(self):
        """Get every measurement."""
        self.write("E?")

    def stop(self):
        """Stop measurement."""
        self.write("STOP")

    def identify(self):
        """Get instrument identification."""
        self.write("*IDN?")
        response = self.read().split(",")
        logger.debug(f"TF930.identify: response={response}")

        return {
            "name": response[0],
            "model": response[1],
            "version": response[3],
        }

    def model(self):
        """Get instrument model."""
        self.write("I?")
        return self.read()

    def reset(self):
        """Reset instrument."""
        self.write("*RST")

    def reset_measurement(self):
        """Reset measurement."""
        self.write("R")

    def status(self):
        """Get instrument status."""
        # TODO: Parse Bit Values, see manual
        self.write("S?")
        return self.read()

__init__(port)

Initialize TF930 Serial Interface.

Source code in f3ts_hardware_utils/aimtti.py
20
21
22
23
def __init__(self, port):
    """Initialize TF930 Serial Interface."""
    logger.info(f"TF930: connecting to instrument on port={port}")
    self.ser = serial.Serial(baudrate=115200, port=port)

close()

Close connection to instrument.

Source code in f3ts_hardware_utils/aimtti.py
25
26
27
28
def close(self):
    """Close connection to instrument."""
    logger.info("TF930: closing connection to instrument")
    self.ser.close()

enable_low_pass_filter(state)

Enable low pass filter.

Source code in f3ts_hardware_utils/aimtti.py
114
115
116
117
118
119
120
121
def enable_low_pass_filter(self, state):
    """Enable low pass filter."""
    if state:
        cmd = "FI"
    else:
        cmd = "FO"

    self.write(cmd)

every_measurement()

Get every measurement.

Source code in f3ts_hardware_utils/aimtti.py
143
144
145
def every_measurement(self):
    """Get every measurement."""
    self.write("E?")

identify()

Get instrument identification.

Source code in f3ts_hardware_utils/aimtti.py
151
152
153
154
155
156
157
158
159
160
161
def identify(self):
    """Get instrument identification."""
    self.write("*IDN?")
    response = self.read().split(",")
    logger.debug(f"TF930.identify: response={response}")

    return {
        "name": response[0],
        "model": response[1],
        "version": response[3],
    }

model()

Get instrument model.

Source code in f3ts_hardware_utils/aimtti.py
163
164
165
166
def model(self):
    """Get instrument model."""
    self.write("I?")
    return self.read()

read()

Read the frequency in Hz.

Source code in f3ts_hardware_utils/aimtti.py
38
39
40
def read(self):
    """Read the frequency in Hz."""
    return float(self.ser.readline().decode("utf-8").strip("\r\n")[:-2])

reset()

Reset instrument.

Source code in f3ts_hardware_utils/aimtti.py
168
169
170
def reset(self):
    """Reset instrument."""
    self.write("*RST")

reset_measurement()

Reset measurement.

Source code in f3ts_hardware_utils/aimtti.py
172
173
174
def reset_measurement(self):
    """Reset measurement."""
    self.write("R")

send_cmds(cmds)

Send a list of commands to the instrument.

Source code in f3ts_hardware_utils/aimtti.py
34
35
36
def send_cmds(self, cmds):
    """Send a list of commands to the instrument."""
    self.write([f"{cmd};" for cmd in cmds][0:-1])

set_a_input_1_to_1_atten()

Set A input 1 to 1 attenuation.

Source code in f3ts_hardware_utils/aimtti.py
 98
 99
100
def set_a_input_1_to_1_atten(self):
    """Set A input 1 to 1 attenuation."""
    self.write("A1")

set_a_input_5_to_1_atten()

Set A input 5 to 1 attenuation.

Source code in f3ts_hardware_utils/aimtti.py
102
103
104
def set_a_input_5_to_1_atten(self):
    """Set A input 5 to 1 attenuation."""
    self.write("A5")

set_a_input_ac_coupling()

Set A input AC coupling.

Source code in f3ts_hardware_utils/aimtti.py
82
83
84
def set_a_input_ac_coupling(self):
    """Set A input AC coupling."""
    self.write("AC")

set_a_input_count()

Set A input count.

Source code in f3ts_hardware_utils/aimtti.py
70
71
72
def set_a_input_count(self):
    """Set A input count."""
    self.write("F7")

set_a_input_dc_coupling()

Set A input DC coupling.

Source code in f3ts_hardware_utils/aimtti.py
86
87
88
def set_a_input_dc_coupling(self):
    """Set A input DC coupling."""
    self.write("DC")

set_a_input_duty_cycle()

Set A input duty cycle.

Source code in f3ts_hardware_utils/aimtti.py
78
79
80
def set_a_input_duty_cycle(self):
    """Set A input duty cycle."""
    self.write("F9")

set_a_input_hi_z()

Set A input high impedance.

Source code in f3ts_hardware_utils/aimtti.py
90
91
92
def set_a_input_hi_z(self):
    """Set A input high impedance."""
    self.write("Z1")

set_a_input_lo_z()

Set A input low impedance.

Source code in f3ts_hardware_utils/aimtti.py
94
95
96
def set_a_input_lo_z(self):
    """Set A input low impedance."""
    self.write("Z5")

set_a_input_ratio_h_to_l()

Set A input ratio high to low.

Source code in f3ts_hardware_utils/aimtti.py
74
75
76
def set_a_input_ratio_h_to_l(self):
    """Set A input ratio high to low."""
    self.write("F8")

set_a_input_width_high()

Set A input width high.

Source code in f3ts_hardware_utils/aimtti.py
62
63
64
def set_a_input_width_high(self):
    """Set A input width high."""
    self.write("F5")

set_a_input_width_low()

Set A input width low.

Source code in f3ts_hardware_utils/aimtti.py
66
67
68
def set_a_input_width_low(self):
    """Set A input width low."""
    self.write("F6")

set_falling_edge()

Set trigger to falling edge.

Source code in f3ts_hardware_utils/aimtti.py
110
111
112
def set_falling_edge(self):
    """Set trigger to falling edge."""
    self.write("EF")

set_frequency_ratio_b_to_a()

Set frequency ratio to B/A.

Source code in f3ts_hardware_utils/aimtti.py
58
59
60
def set_frequency_ratio_b_to_a(self):
    """Set frequency ratio to B/A."""
    self.write("F4")

set_input_frequency_a()

Set input frequency to A channel.

Source code in f3ts_hardware_utils/aimtti.py
50
51
52
def set_input_frequency_a(self):
    """Set input frequency to A channel."""
    self.write("F2")

set_input_frequency_b()

Set input frequency to B channel.

Source code in f3ts_hardware_utils/aimtti.py
54
55
56
def set_input_frequency_b(self):
    """Set input frequency to B channel."""
    self.write("F3")

set_input_period_a()

Set input period to A channel.

Source code in f3ts_hardware_utils/aimtti.py
46
47
48
def set_input_period_a(self):
    """Set input period to A channel."""
    self.write("F1")

set_input_period_b()

Set input period to B channel.

Source code in f3ts_hardware_utils/aimtti.py
42
43
44
def set_input_period_b(self):
    """Set input period to B channel."""
    self.write("F0")

set_measurement_time(meas_time)

Set measurement time.

Source code in f3ts_hardware_utils/aimtti.py
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
def set_measurement_time(self, meas_time):
    """Set measurement time."""
    assert meas_time in [
        0.3,
        1,
        10,
        100,
    ], "Invalid setting, the following times are supported: 0.3, 1, 10, 100 seconds"

    if meas_time == 0.3:
        val = 1
    elif meas_time == 1:
        val = 2
    elif meas_time == 10:
        val = 3
    else:
        val = 4

    self.write(f"M{val}")

set_rising_edge()

Set trigger to rising edge.

Source code in f3ts_hardware_utils/aimtti.py
106
107
108
def set_rising_edge(self):
    """Set trigger to rising edge."""
    self.write("ER")

status()

Get instrument status.

Source code in f3ts_hardware_utils/aimtti.py
176
177
178
179
180
def status(self):
    """Get instrument status."""
    # TODO: Parse Bit Values, see manual
    self.write("S?")
    return self.read()

stop()

Stop measurement.

Source code in f3ts_hardware_utils/aimtti.py
147
148
149
def stop(self):
    """Stop measurement."""
    self.write("STOP")

write(cmd)

Write a command to the instrument.

Source code in f3ts_hardware_utils/aimtti.py
30
31
32
def write(self, cmd):
    """Write a command to the instrument."""
    self.ser.write(f"{cmd}\n".encode("utf-8"))