Measurement

The Measurement API allows you to measure characteristics of a net's waveform in real-time.

Average Voltage

measure_average_voltage.py
 from lager import Net, NetType

 sck = Net.get('I2C.SCK',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(sck.measurement.voltage_average())
Measure Average Voltage
~  lager analog I2C.SCK measure vavg --dut 1

Maximum Voltage

measure_maximum_voltage.py
 from lager import Net, NetType

 sck = Net.get('I2C.SCK',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(sck.measurement.voltage_max())
Measure Maximum Voltage
~  lager analog I2C.SCK measure vmax --dut 1

Minimum Voltage

measure_minimum_voltage.py
 from lager import Net, NetType

 sck = Net.get('I2C.SCK',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(sck.measurement.voltage_min())
Measure Minimum Voltage
~  lager analog I2C.SCK measure vmin --dut 1

Peak to Peak Voltage

measure_peak_to_peak_voltage.py
 from lager import Net, NetType

 sck = Net.get('I2C.SCK',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(sck.measurement.voltage_peak_to_peak())
Measure Peak to Peak Voltage
~  lager analog I2C.SCK measure vpp --dut 1

RMS Voltage

measure_rms_voltage.py
 from lager import Net, NetType

 sck = Net.get('I2C.SCK',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(sck.measurement.voltage_rms())
Measure RMS Voltage
~  lager analog I2C.SCK measure vrms --dut 1

Waveform Period

measure_period.py
 from lager import Net, NetType

 sck = Net.get('I2C.SCK',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(sck.measurement.period())
Measure Waveform Period
~  lager analog I2C.SCK measure period --dut 1

Waveform Frequency

measure_freq.py
 from lager import Net, NetType

 sck = Net.get('I2C.SCK',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(sck.measurement.frequency())
Measure Waveform Frequency
~  lager analog I2C.SCK measure freq --dut 1

Duty Cycle

Positive Duty Cycle

measure_pos_duty_cycle.py
 from lager import Net, NetType

 pwm = Net.get('PWM',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(pwm.measurement.duty_cycle_positive())
Measure Positive Duty Cycle
~  lager analog PWM measure dc-pos --dut 1

Negative Duty Cycle

measure_neg_duty_cycle.py
 from lager import Net, NetType

 pwm = Net.get('PWM',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(pwm.measurement.duty_cycle_negative())
Measure Negative Duty Cycle
~  lager analog PWM measure dc-neg --dut 1

Pulse Width

Positive Pulse Width

measure_pos_pulse_width.py
 from lager import Net, NetType

 button = Net.get('BTN',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(button.measurement.pulse_width_positive())
Measure Positive Pulse Width
~  lager analog PWM measure pw-pos --dut 1

Negative Pulse Width

measure_neg_pulse_width.py
 from lager import Net, NetType

 button = Net.get('BTN',
         type=NetType.Analog,
         setup_function=setup_nets,
         teardown_function=teardown_nets)

 print(button.measurement.pulse_width_negative())
Measure Negative Pulse Width
~  lager analog PWM measure pw-neg --dut 1