Index: CN0_Python_Scripts/EVAL_CN0359_REV_B.py =================================================================== diff -u -r685d8eb11e2a49f2c8f7a270e379186415594601 -r855524c483c89b2cabf1b0fdb91227d5614b1639 --- CN0_Python_Scripts/EVAL_CN0359_REV_B.py (.../EVAL_CN0359_REV_B.py) (revision 685d8eb11e2a49f2c8f7a270e379186415594601) +++ CN0_Python_Scripts/EVAL_CN0359_REV_B.py (.../EVAL_CN0359_REV_B.py) (revision 855524c483c89b2cabf1b0fdb91227d5614b1639) @@ -1,10 +1,4 @@ -import numpy as np import time -from datetime import datetime -import pandas as pd -import os -from serial import Serial -import struct import commands_rev_b as commands # load the Python API for the Analog Devices CN0359 evaluation board @@ -79,54 +73,12 @@ commands.cmd_get_cal_data(cond1) time.sleep(sleep_time) -# Update Coefficient 1 and read response in ASCII format -commands.cmd_setcal(cond1, 1, 3.1) -time.sleep(sleep_time) +# Set Coefficients value 1..12 in order +for idx, value in enumerate(commands.exp_coeff, start=1): + # Update coefficient idx and read response in ASCII format + commands.cmd_setcal(cond1, idx, value) + time.sleep(sleep_time) -# Update Coefficient 2 and read response in ASCII format -commands.cmd_setcal(cond1, 2, 0.006) -time.sleep(sleep_time) - -# Update Coefficient 3 and read response in ASCII format -commands.cmd_setcal(cond1, 3, 0.6) -time.sleep(sleep_time) - -# Update Coefficient 4 and read response in ASCII format -commands.cmd_setcal(cond1, 4, -1.0) -time.sleep(sleep_time) - -# Update Coefficient 5 and read response in ASCII format -commands.cmd_setcal(cond1, 5, 3.1) -time.sleep(sleep_time) - -# Update Coefficient 6 and read response in ASCII format -commands.cmd_setcal(cond1, 6, 0.03) -time.sleep(sleep_time) - -# Update Coefficient 7 and read response in ASCII format -commands.cmd_setcal(cond1, 7, 2.0) -time.sleep(sleep_time) - -# Update Coefficient 8 and read response in ASCII format -commands.cmd_setcal(cond1, 8, 999.0) -time.sleep(sleep_time) - -# Update Coefficient 9 and read response in ASCII format -commands.cmd_setcal(cond1, 9, 1.5) -time.sleep(sleep_time) - -# Update Coefficient 10 and read response in ASCII format -commands.cmd_setcal(cond1, 10, 7.1) -time.sleep(sleep_time) - -# Update Coefficient 11 and read response in ASCII format -commands.cmd_setcal(cond1, 11, 100.11) -time.sleep(sleep_time) - -# Update Coefficient 12 and read response in ASCII format -commands.cmd_setcal(cond1, 12, 100.12) -time.sleep(sleep_time) - # Read Calibration data in ASCII format to confirm the changes were made commands.cmd_get_cal_data(cond1) time.sleep(sleep_time) @@ -136,11 +88,11 @@ time.sleep(sleep_time) # Update Hardware Version Number and read response in ASCII format -commands.cmd_set_hardware_ver(cond1) +commands.cmd_set_hardware_ver(cond1, commands.exp_hw_ver) time.sleep(sleep_time) # Update Serial Number and read response in ASCII format -commands.cmd_set_serial_num(cond1) +commands.cmd_set_serial_num(cond1, commands.exp_sn) time.sleep(sleep_time) # Read Version information in ASCII format to confirm the changes were made @@ -151,4 +103,27 @@ commands.cmd_get_cal_ver_bin(cond1) time.sleep(sleep_time) +######################################################################################################################## +# Below code is for data analysis +# commands.cmd_stop_poll_bin(cond1) +# time.sleep(sleep_time) +# commands.cmd_frequency(cond1,10000.0) +# time.sleep(sleep_time) +# commands.cmd_poll(cond1) +# time.sleep(sleep_time) + +# # Reading Auto polled data for different durations +# read_durations = [30, 60, 120, 240, 480] +# for read_duration in read_durations: +# print("Read Duration:", read_duration) +# commands.cmd_start_poll_bin(cond1) +# time.sleep(sleep_time) +# commands.printTimestamp() +# commands.read_autopoll(cond1, read_duration) +# commands.printTimestamp() +# time.sleep(sleep_time) +# commands.cmd_stop_poll_bin(cond1) +# time.sleep(sleep_time) + +