Product specifications
NRAO Linux Python Library
28
def set_ref_select(self, e_not_i = 1):
"""
Selects either internal or external reference clock.
@param e_not_i : 1 (external) or 0 (internal); default 1
@type e_not_i : int
@return: True if success (bool)
"""
self.conn.open()
bytes = struct.pack('>BB', 0x06, e_not_i & 1)
checksum = self._generate_checksum(bytes)
self.conn.write(bytes + checksum)
bytes = self.conn.read(1)
self.conn.close()
ack = struct.unpack('>B', bytes)[0]
return ack == ACK
def get_vco_range(self, synth):
"""
Returns (min, max) VCO range tuple.
@param synth : synthesizer base address
@type synth : int
@return: min,max in MHz
"""
self.conn.open()
bytes = struct.pack('>B', 0x83 | synth)
self.conn.write(bytes)
bytes = self.conn.read(4)
checksum = self.conn.read(1)
self.conn.close()
#self._verify_checksum(bytes, checksum)
min, max = struct.unpack('>HH', bytes)
return min, max
def set_vco_range(self, synth, min, max):
"""
Sets VCO range.
@param synth : synthesizer base address
@type synth : int
@param min : minimum VCO frequency
@type min : int
@param max : maximum VCO frequency
@type max : int
@return: True if success (bool)
"""
self.conn.open()
bytes = struct.pack('>BHH', 0x03 | synth, min, max)
checksum = self._generate_checksum(bytes)
self.conn.write(bytes + checksum)
bytes = self.conn.read(1)
self.conn.close()
ack = struct.unpack('>B', bytes)[0]
return ack == ACK
def get_phase_lock(self, synth):
"""
Get phase lock status
@param synth : synthesizer base address
@type synth : int