Skip to content

Commit

Permalink
added display on off toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
ElPsyKurisu committed Nov 5, 2024
1 parent b098c28 commit 754fafd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/piec/drivers/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def configure_wf(self, channel: str='1', func: str='SIN', voltage: str='1.0', of
offset (str): The voltage offset in units of volts
frequency (str): the frequency in units of Hz for the arbitrary waveform
duty_cycle (str): duty_cycle defined as 100* pulse_width / Period ranges from 0-100, (cant actually do 0 or 100 but in between is fine)
num_cycles (str): number of cycles by default set to None which means continous
num_cycles (str): number of cycles by default set to None which means continous NOTE only works under BURST mode, not implememnted
invert (bool): Inverts the waveform by flipping the polarity
"""
#might need to rewrite check_params here
Expand Down Expand Up @@ -556,7 +556,7 @@ def _configure_built_in_wf(self, channel: str='1', func='SIN', frequency='1e3',

def _configure_arb_wf(self, channel: str='1', name='VOLATILE', voltage: str='1.0', offset: str='0.00', frequency: str='1000', invert: bool=False):
"""
This program configures arbitrary waveform already saved on the instrument. Taken from EKPY.
This program configures arbitrary waveform already saved on the instrument. Adapted from EKPY.
args:
wavegen (pyvisa.resources.gpib.GPIBInstrument): Keysight 81150A
channel (str): Desired Channel to configure accepted params are [1,2]
Expand All @@ -566,6 +566,8 @@ def _configure_arb_wf(self, channel: str='1', name='VOLATILE', voltage: str='1.0
frequency (str): the frequency in units of Hz for the arbitrary waveform
invert (bool): Inverts the waveform by flipping the polarity
"""
dict_to_check = locals()
dict_to_check['func'] = 'USER' #this is useless i want to make sure frequency is good tho for arb waveform
if self.slew_rate is not None:
points = self.instrument.query(":DATA:ATTR:POIN? {}".format(name)).strip()
if (float(voltage))/(float(frequency)/float(points)) > self.slew_rate:
Expand Down Expand Up @@ -594,6 +596,17 @@ def output_enable(self, channel: str='1', on=True):
else:
self.instrument.write(":OUTP{} OFF".format(channel))

def display_enable(self, on=True):
"""
This program toggles the display On or OFF, it is recommended for programming speed to disale the display
args:
on (boolean): True for display on, False for off
"""
if on:
self.instrument.write("DISP ON")
else:
self.instrument.write("DISP OFF")

def send_software_trigger(self):
"""
This program sends the software trigger. Taken from EKPY.
Expand Down
2 changes: 1 addition & 1 deletion src/piec/drivers/keysight81150a/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Keysight81150a(Awg):
#correct syntax is tuple for ranges, list for limited amount, and dictionaries for nested things...
channel = ['1', '2'] #allowable channels ['1', '2']
voltage = (8.0e-3, 40.0) #V_pp
frequency = {'func': {'sine': (1e-6, 240e6), 'square': (1e-6, 120e6), 'ramp': (1e-6, 5e6), 'pulse': (1e-6, 120e6), 'pattern': (1e-6, 120e6), 'arb': (1e-6, 120e6)}} #where did i get this info?
frequency = {'func': {'SIN': (1e-6, 240e6), 'SQU': (1e-6, 120e6), 'RAMP': (1e-6, 5e6), 'PULS': (1e-6, 120e6), 'pattern': (1e-6, 120e6), 'ARB': (1e-6, 120e6)}} #where did i get this info?
func = ['SIN', 'SQU', 'RAMP', 'PULS', 'NOIS', 'DC', 'USER']
#might be useless since all awgs should have sin, squ, pulse etc maybe not include arb? idk
slew_rate = 1.0e9 # V/s
Expand Down

0 comments on commit 754fafd

Please sign in to comment.