Miscellaneous, What units are used, Is there a way to get() a values that was set – Teledyne LeCroy PeRT3 Software Interface User Manual
Page 11: Table 3 example for using python ctypes facility
![background image](/manuals/353472/11/background.png)
How does LCPeRT_GetStats or LCPeRT_GetChannelStats work?
Call LCPeRT_GetStats() or LCPeRT_GetChnlStats() after LCPeRT_Run() returns or after calling
LCPeRT_Stop() to get the final results, or after LCPeRT_Start() to get intermediate results.
Miscellaneous
What units are used?
Units are documented in the LCPeRT.h header file. They are basically the same as the units displayed in
the user interface.
Do you have a sample Python script using Python ctypes facility?
from LCPeRT import LCPeRTSession
def main():
# Establish a session with the PeRT.
pert = LCPeRTSession(address="127.0.0.1")
# Configure the SerDes protocol ("CUSTOM", in this case) and
# the bit rate (3 GB/sec).
pert.configure_pert("CUSTOM", 3000)
# Connect to the DUT.
pert.connect_to_dut()
# Get the string identifier of channel 1. (The value will be "CH1").
ch1 = pert.get_channel_name(1)
# Set several stress parameters.
pert.set_low_freq_random_jitter(ch1, 10.0)
pert.set_high_freq_random_jitter(ch1, 10.0)
pert.set_periodic_jitter_frequency(ch1, 10.0e6)
# Set the termination condition for the test.
# For this example, just count errors for a fixed amount of time.
pert.set_termination_on_elapsed_time(ch1, 100.0)
# Run a test for several values of the periodic jitter magnitude.
mags = [10.0, 20.0, 30.0, 40.0]
for mag in mags:
pert.set_periodic_jitter_magnitude(ch1, mag)
# Make the measurement.
pert.run(record_results=True)
# Get the number of bits and the number of errors, and print the results.
(bits, errs) = pert.get_channel_stats(ch1)
print "Bits: %12d, Errors: %8d, BER: %.3e" % (bits, errs, float(errs)/bits)
# Disconnect from the DUT and close the PeRT session.
pert.disconnect_dut()
pert.close()
if __name__ == "__main__":
main()
Table 2 Example for using Python ctypes facility
Is there a way to GET() a values that was set?
There is no hardware/firmware support for retrieving most of the PeRT
3
settings. The driver does not
currently cache the values that are set, but may do so in the future.