{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "2404558e-8356-47e1-8f04-7dd18dfc2864", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 30 44 22 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 65 01 03 60 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 56 50 2D 43 38 34 37 2D 30 30 44 2D 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 54 41 43 32 5F 30 34 32 36 5F 31 31 56 31 2E 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 89 F4 16\n", "Parse Result:\n", "0x0100: SLCP101_250111_0800_V2.03 版本(ODM)\n", "0x0110: PVC-48-700-DX 型号 \n", "0x0120: TCCA_240621_V1.16 载波芯片地址 \n", "SLCP101\n", "D:\\WorkingProject\\LightStackAdapter\\software\\lamina_adapter\\release\\device_V2.03\\lamina_adapter\\Debug\\lamina_adapter.hex\n" ] } ], "source": [ "import time\n", "import warnings\n", "from pathlib import Path\n", "from device.LaminaAdapter import LaminaAdapter\n", "from device.tools.ByteConv import trans_list_to_str, trans_str_to_list\n", "\n", "def test_communication(time_out=2):\n", " \"\"\" 通信成功率测试 \"\"\"\n", " time_start = time.time()\n", " param_saved = dev_lamina.flag_print, dev_lamina.retry, dev_lamina.time_out\n", " dev_lamina.flag_print = False\n", " dev_lamina.retry = 1\n", " try:\n", " while True:\n", " dev_lamina.frame_read(0x0C, 0x20)\n", " print(f\"Time Stamp: {time.ctime()}\")\n", " print(f\"Success Frame: {dev_lamina.log['read']}\")\n", " print(f\"Failed Frame: {dev_lamina.log['send'] - dev_lamina.log['read']}\")\n", " print(f\"Max Series Failed Frame: {dev_lamina.log['keep-fail']}\")\n", " time.sleep(time_out)\n", " finally:\n", " time_end = time.time()\n", " print(\"Test Result: \")\n", " print(f\"Time Start: {time.strftime(r'%Y-%m-%d %H:%M:%S', time.localtime(time_start))}, \\tTime End: {time.strftime(r'%Y-%m-%d %H:%M:%S', time.localtime(time_end))}\")\n", " print(f\"Time Elapsed: {time_end - time_start}\")\n", " print(f\"Success Rate: {dev_lamina.log['read'] / dev_lamina.log['send'] * 100}%\")\n", " dev_lamina.flag_print, dev_lamina.retry, dev_lamina.time_out = param_saved\n", "\n", "\n", "def make_Pakeage(fp: Path, func):\n", " \"\"\" 生成升级包 \"\"\"\n", "\n", " hex_update = fp\n", " file_package = fp.parent / f'{hex_update.stem}.dat'\n", " file_update_bin = fp.parent / f'{hex_update.stem}.bin'\n", "\n", " data_package, data_update_bin = func(hex_update)\n", "\n", " file_package.write_bytes(data_package)\n", " file_update_bin.write_bytes(data_update_bin)\n", "\n", " return file_package\n", "\n", "\n", "def test():\n", " if 0:\n", " dev_lamina.frame_read(0xA9, 1) # 读ADC参考电压\n", " dev_lamina.frame_write_one(0xA9, 2000) # 写ADC参考电压:2.0V\n", " dev_lamina.frame_write_one(0xA9, 3300) # 写ADC参考电压:3.3V\n", " dev_lamina.frame_read(0x13, 1) # 读输入电压\n", " dev_lamina.frame_read(0x16, 1) # 读输出电压\n", " dev_lamina.frame_read(0x97, 4) # 读校准参数: Vin_a, Vin_b, Vout_a, Vout_b\n", " dev_lamina.frame_write_one(0x97, 1000) # 写校准参数Vin_a: 1.000\n", " dev_lamina.frame_write_one(0x97, 1500) # 写校准参数Vin_a: 1.500\n", " dev_lamina.frame_write_one(0x98, 100) # 写校准参数Vin_b: 1.00\n", " dev_lamina.frame_write_one(0x98, 150) # 写校准参数Vin_b: 1.50\n", " dev_lamina.frame_write_one(0x99, 1000) # 写校准参数Vout_a: 1.000\n", " dev_lamina.frame_write_one(0x99, 1500) # 写校准参数Vout_a: 1.500\n", " dev_lamina.frame_write_one(0x9A, 1000) # 写校准参数Vout_a: 1.00\n", " dev_lamina.frame_write_one(0x9A, 1500) # 写校准参数Vout_a: 1.50\n", " if 0:\n", " dev_lamina.frame_write_str(0x82, [0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA])\n", " dev_lamina.frame_write_str(0x82, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00])\n", " dev_lamina.frame_write_str(0x82, [0x0A, 0x00, 0x00, 0x00, 0x00, 0x00])\n", " dev_lamina.frame_write_str(0x82, [0xFF, 0x00, 0x00, 0x00, 0x00, 0x00])\n", " dev_lamina.frame_write_str(0x82, [0xA1, 0x00, 0x00, 0x00, 0x00, 0x00])\n", " dev_lamina.frame_write_str(0x82, [0x1A, 0x00, 0x00, 0x00, 0x00, 0x00])\n", " dev_lamina.frame_write_str(0x82, [0x99, 0x99, 0x99, 0x99, 0x99, 0x99])\n", " dev_lamina.frame_write_str(0x82, [0x00, 0x00, 0x00, 0x00, 0x00, 0x01])\n", " if 0:\n", " dev_lamina.frame_write_one(0x52, 0x01)\n", " time.sleep(0.5)\n", " dev_lamina.frame_write_one(0x50, 0x00)\n", " if 0:\n", " while 1:\n", " code_mes = input(\"扫描数据\")\n", " temp = code_mes[5:7] + code_mes[-10:]\n", " code_addr = [int(temp[i:i+2], 16) for i in range(0, len(temp), 2)]\n", " print(f\"扫描结果: {code_mes}\")\n", " print(f\"载波地址: {trans_list_to_str(code_addr)}\")\n", " dev_lamina.frame_read(0x100, 0x20)\n", " time.sleep(0.5)\n", " dev_lamina.frame_write_str(0x0180, list(code_mes))\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(0x180, 0x10)\n", " time.sleep(0.5)\n", " dev_lamina.frame_write_str(0x82, code_addr)\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(0x80, 0x08)\n", " time.sleep(0.5)\n", " dev_lamina.frame_write_one(0xA3, 0x01)\n", " time.sleep(0.5)\n", " dev_lamina.frame_write_one(0x51, 0x01)\n", " time.sleep(5)\n", " dev_lamina.frame_read(0x0E, 0x13)\n", " time.sleep(5)\n", " dev_lamina.frame_read(0x0E, 0x13)\n", " time.sleep(0.5)\n", " dev_lamina.frame_write_one(0x50, 0x00)\n", " if 0:\n", " dev_lamina.frame_write_one(0x0054, 0x01)\n", " dev_lamina.frame_read(0x000E, 0x02)\n", " dev_lamina.frame_write_one(0x0054, 0x03)\n", " dev_lamina.frame_read(0x000E, 0x02)\n", " dev_lamina.frame_write_one(0x0054, 0x07)\n", " dev_lamina.frame_read(0x000E, 0x02)\n", " dev_lamina.frame_write_one(0x0054, 0x06)\n", " dev_lamina.frame_read(0x000E, 0x02)\n", " dev_lamina.frame_write_one(0x0054, 0x04)\n", " dev_lamina.frame_read(0x000E, 0x02)\n", " dev_lamina.frame_write_one(0x0054, 0x00)\n", " dev_lamina.frame_read(0x000E, 0x02)\n", " if 0:\n", " dev_lamina.frame_read(0x0E, 0x14)\n", " if 0:\n", " dev_lamina.frame_read(0x60, 0x60)\n", " if 0:\n", " dev_lamina.frame_read(0x70, 0x02)\n", " dev_lamina.frame_write_one(0x70, 2100)\n", " dev_lamina.frame_write_one(0x71, 2200)\n", " dev_lamina.frame_read(0x70, 0x02)\n", " dev_lamina.frame_write_one(0x70, 2300)\n", " dev_lamina.frame_write_one(0x71, 2100)\n", " dev_lamina.frame_read(0x70, 0x02)\n", " if 0:\n", " dev_lamina.frame_write_str(0x0170, list(\"SN202405201117-1\"))\n", " dev_lamina.frame_write_str(0x0180, list(\"MES202405201117-2\"))\n", " dev_lamina.frame_write_str(0x0190, list(\"D202405211500-3\"))\n", " time.sleep(2)\n", " dev_lamina.frame_read(0x0170, 0x30)\n", "\n", " if 0:\n", " dev_lamina.flag_print = False\n", " dev_lamina.frame_write_one(0x52, 0x01)\n", " time.sleep(6)\n", " dev_lamina.frame_read(0x69, 0x02)\n", " for value in [40, 41.9, 42, 42.1, 56.5, 57, 57.5, 57.9, 58, 58.1, 59]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write_one(0x21, int(value * 10))\n", " print(f\"Write Value: {value}, result: {'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(0x21,1)\n", " time.sleep(0.5)\n", " value = 46\n", " result = dev_lamina.frame_write_one(0x69, int(value * 10))\n", " print(f\"Write Value: {value} in Addr: {0x69}, result: {'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " value = 60\n", " result = dev_lamina.frame_write_one(0x6A, int(value * 10))\n", " print(f\"Write Value: {value} in Addr: {0x6A}, result: {'Seccusss' if result else 'Fail'}.\")\n", " for value in [45, 45.9, 46, 46.1, 56.5, 57, 57.5, 58, 59.9, 60, 60.1, 61]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write_one(0x21, int(value * 10))\n", " print(f\"Write Value: {value}, result: {'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(0x21,1)\n", " time.sleep(0.5)\n", " dev_lamina.frame_write_one(0x53, 0x01)\n", " time.sleep(4.5)\n", " dev_lamina.frame_read(0x21, 1)\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(0x69, 2)\n", " dev_lamina.flag_print = True\n", "\n", " if 0: # 并机功率限值测试\n", " dev_lamina.flag_print = False\n", " step = 0\n", " time_start = time.time()\n", " time_interval = 120\n", " list_power_limit = [650, 300, 200, 150, 120, 100, 80, 70, 50, 25, 10, 5, 1, 0.1, 0, 650]\n", " while True:\n", " time.sleep(1)\n", " print(time.ctime())\n", " dev_lamina.frame_read(0x0E, 0x20)\n", " if time.time() - time_start > time_interval:\n", " if step >= len(list_power_limit):\n", " break\n", " time.sleep(0.5)\n", " time_start = time.time()\n", " value = list_power_limit[step]\n", " result = dev_lamina.frame_write_dual(0x1F, int(value * 1000))\n", " print(f\"Write Value: {value} in Addr: 0x1F by Time: {time.ctime(time_start)}. \\n\\tresult: {'Seccusss' if result else 'Fail'}.\")\n", " step += 1\n", " dev_lamina.flag_print = True\n", " if 0: # 启停机条件测试\n", " dev_lamina.flag_print = False\n", " dev_lamina.frame_read(0x60, 0x0B) \n", " while True:\n", " time.sleep(1)\n", " print(time.ctime())\n", " dev_lamina.frame_read(0x0E, 0x20)\n", " dev_lamina.flag_print = True\n", "\n", " if 0: # 程序升级\n", " dev_lamina.frame_update(file_hex, makefile=True)\n", " time.sleep(4.5)\n", " dev_lamina.frame_read(0x100, 0x20)\n", " if 0: # 曲线扫描\n", " dev_lamina.flag_print = False\n", " action_list = [(0x50, 1), (0x50, 0), (0xA8, 0), (0x50, 1)]\n", " dev_lamina.frame_write_one(0x50, 0)\n", " time.sleep(0.5)\n", " dev_lamina.frame_write_one(0x52, 1) \n", " time.sleep(4.5)\n", " dev_lamina.frame_read(0x60, 0x60)\n", " step = 0\n", " time_start = time.time()\n", " time_interval = 120\n", " while True:\n", " time.sleep(1)\n", " print(time.ctime())\n", " dev_lamina.frame_read(0x0E, 0x20)\n", " if time.time() - time_start > time_interval:\n", " if step >= len(action_list):\n", " break\n", " time.sleep(0.5)\n", " time_start = time.time()\n", " result = dev_lamina.frame_write_one(*action_list[step])\n", " print(f\"Write Value: {action_list[step][1]} in Addr: 0x{action_list[step][0]:x} by Time: {time.ctime(time_start)}. \\n\\tresult: {'Seccusss' if result else 'Fail'}.\")\n", " step += 1\n", " dev_lamina.flag_print = True\n", " if 0: # 数据读写验证\n", " addr, value = 0x61, 29.9\n", " dlen = 1\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)\n", "\n", "if __name__=='__main__':\n", " mode_config = {\n", " \"Log\": {'com_name': None, \n", " # 'addr_645': [0x01, 0x00, 0x00, 0x00, 0x00, 0x40], \n", " },\n", " \"Debug\": {'com_name': 'COM3', 'baudrate': 115200, 'parity': 'N', 'bytesize': 8, 'stopbits': 1,\n", " # 'addr_645': [0x01, 0x02, 0x03, 0x04, 0x05, 0x06], \n", " 'frame_print': True, \n", " 'time_out': 0.5, 'retry': 1, 'retry_sub': 10},\n", " \"HPLC\": {'com_name': 'COM8', 'baudrate': 9600, 'parity': 'E', 'bytesize': 8, 'stopbits': 1,\n", " 'addr_645': trans_str_to_list(\"02 01 00 00 24 20\"), \n", " 'frame_print': True, \n", " 'time_out': 3, 'time_gap': 0.1, 'retry': 3, 'retry_sub': 10},\n", " }\n", "\n", " dev_lamina = LaminaAdapter(type_dev=\"SLCP101\", **mode_config['Debug'])\n", "\n", " dev_lamina.frame_read(0x0100, 0x30)\n", "\n", " # 工程-即时转换\n", " if dev_lamina.device == 'SLCP001':\n", " file_hex = Path(r\"D:\\WorkingProject\\LightStackAdapter\\software\\lamina_adapter\\release\\device_V1\\lamina_adapter\\Debug\\lamina_adapter.hex\")\n", " elif dev_lamina.device == 'SLCP101':\n", " file_hex = Path(r\"D:\\WorkingProject\\LightStackAdapter\\software\\lamina_adapter\\release\\device_V2.03\\lamina_adapter\\Debug\\lamina_adapter.hex\")\n", " elif dev_lamina.device == 'SLCP102':\n", " file_hex = Path(r\"D:\\WorkingProject\\LightStackAdapter\\software\\lamina_adapter\\release\\device_V3.01\\lamina_adapter\\Debug\\lamina_adapter.hex\")\n", " elif dev_lamina.device == 'DLSY001':\n", " file_hex = Path(r\"D:\\WorkingProject\\LightStackOptimizer\\software\\lamina_optimizer\\lamina_optimizer\\Debug\\lamina_optimizer.hex\")\n", " else:\n", " file_hex = Path(r\"D:\\WorkingProject\\LightStackAdapter\\software\\lamina_adapter\\lamina_adapter\\Debug\\lamina_adapter.hex\")\n", " if not file_hex.exists():\n", " raise Exception(\"工程编译目标文件不存在.\")\n", " # if dev_lamina.output['Regs'][0x100][1].split('_')[0] != dev_lamina.device:\n", " # warnings.warn(\"设备型号不匹配.\", UserWarning)\n", " print(dev_lamina.device)\n", " print(file_hex)\n", "\n", " if not hasattr(__builtins__,\"__IPYTHON__\"):\n", " version = \"SLCP101_241030_2000_V2.03\"\n", " addr = [0x24, 0x09, 0x12, 0x00, 0x00, 0x00]\n", "\n", " while True:\n", " \"\"\" 自动检测升级流程 \"\"\"\n", " ret = False\n", " while not ret or ('Regs' not in dev_lamina.output.keys()) or (version == dev_lamina.output['Regs'][0x0100][1].strip('\\000')):\n", " # dev_lamina.frame_read(0x82, 3)\n", " ret = dev_lamina.frame_read(0x0100, 0x20)\n", " time.sleep(1)\n", "\n", " dev_lamina.frame_update(file_hex, makefile=True)\n", "\n", " time.sleep(3)\n", "\n", " ret = dev_lamina.frame_read(0x0100, 0x20)\n", "\n", " if ret and (version == dev_lamina.output['Regs'][0x0100][1]):\n", " dev_lamina.frame_write_one(0x52, 0x01)\n", "\n", " # print(f\"address: {' '.join(map(lambda x: ('000' + hex(x)[2:])[-2:], addr))}\")\n", " # dev_lamina.frame_write_str(0x82, addr)\n", " # dev_lamina.frame_read(0x82, 3)\n", " # addr[5] += 1\n", " # if addr[5] & 0x0F >= 10:\n", " # addr[5] += 0x10 - 10" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 60 00 60 45 FC F8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F C5 01 03 C0 00 01 01 2C 01 90 00 C8 03 20 00 C8 03 20 01 F4 02 58 01 E0 02 58 02 BC 02 6C 01 F4 0B B8 13 88 00 64 00 65 03 E8 03 E8 02 58 03 21 03 21 03 20 01 90 02 58 AE 61 00 0A AE 5F 00 0A AE 60 00 0A AE 60 00 0A 05 06 03 04 01 02 27 10 27 0F 27 10 27 0F 00 C8 03 95 03 96 00 96 C3 50 00 00 00 C8 00 00 00 FA 00 00 00 14 00 00 00 02 00 00 03 E8 00 00 03 E8 00 00 03 E8 00 00 03 E8 00 00 03 E8 00 00 00 00 00 00 00 00 03 E8 37 DC 2D B4 02 23 00 01 0C AD FF FF FF FF FF FF FF FF FF FF FF FF 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 15 46 53 16\n", "Parse Result:\n", "0x0060: 0x0001 光伏通道使能 \n", "0x0061: 30.0 最小启动输入电压 \n", "0x0062: 40.0 最大启动输入电压 \n", "0x0063: 20.0 最小停止输入电压 \n", "0x0064: 80.0 最大停止输入电压 \n", "0x0065: 20.0 最小MPPT电压 \n", "0x0066: 80.0 最大MPPT电压 \n", "0x0067: 50.0 最小启动输出电压 \n", "0x0068: 60.0 最大启动输出电压 \n", "0x0069: 48.0 最小停止输出电压 \n", "0x006A: 60.0 最大停止输出电压 \n", "0x006B: 70.0 输入过压保护值 \n", "0x006C: 62.0 输出过压保护值 \n", "0x006D: 50.0 输出欠压保护值 \n", "0x006E: 30.0 电感过流保护值 \n", "0x006F: 50.0 输入过流保护值 \n", "0x0070: 1.0 最小电感电流限值 \n", "0x0071: 1.01 最大电感电流限值 \n", "0x0072: 100.0 浮充电压阈值 \n", "0x0073: 100.0 三点法中间阈值 \n", "0x0074: 60.0 恒压充电电压 \n", "0x0075: 80.1 过温故障值 \n", "0x0076: 80.1 过温告警值 \n", "0x0077: 80.0 温度恢复值 \n", "0x0078: 40.0 最低满载电压 \n", "0x0079: 60.0 最高满载电压 \n", "0x007A: 700.001 输入过载保护值 \n", "0x007C: 699.999 最小功率限值 \n", "0x007E: 700.0 最大功率限值 \n", "0x0080: 700.0 最大功率限值存储值 \n", "0x0082: 06 05 04 03 02 01 载波通信地址 \n", "0x0085: 100.0 电压环out_max \n", "0x0086: 99.99 电压环out_min \n", "0x0087: 100.0 电流环out_max \n", "0x0088: 99.99 电流环out_min \n", "0x0089: 2.0 MPPT扰动系数k_d_vin \n", "0x008A: 0.917 dmin \n", "0x008B: 0.918 dmax \n", "0x008C: 15.0 扫描电压偏移scanvolt_offset\n", "0x008D: 0.5 电压环Kp \n", "0x008F: 0.002 电压环Ki \n", "0x0091: 0.0025 电流环Kp \n", "0x0093: 0.0002 电流环Ki \n", "0x0095: 0x0002 日志级别 \n", "0x0096: 0x0000 日志输出方式 \n", "0x0097: 1.0 采样校准volt_in_a \n", "0x0098: 0.0 采样校准volt_in_b \n", "0x0099: 1.0 采样校准volt_out_a \n", "0x009A: 0.0 采样校准volt_out_b \n", "0x009B: 1.0 采样校准curr_in_a \n", "0x009C: 0.0 采样校准curr_in_b \n", "0x009D: 1.0 采样校准curr_induc_a \n", "0x009E: 0.0 采样校准curr_induc_b \n", "0x009F: 1.0 采样校准volt_12V_a \n", "0x00A0: 0.0 采样校准volt_12V_b \n", "0x00A1: 0.0 温度补偿temp1_b \n", "0x00A2: 0.0 温度补偿temp2_b \n", "0x00A3: 0 系统工作模式 \n", "0x00A4: 10.0 电感电流给定值curr_set \n", "0x00A5: 143.0 抖动频率上限 \n", "0x00A6: 117.0 抖动频率下限 \n", "0x00A7: 54.7 电池电压判断限值 \n", "0x00A8: 0x0001 MPPT追踪模式 \n", "0x00A9: 3.245 ADC参考电压 \n", "0x00AA: 0xFFFF 硬件版本 \n", "0x00AB: 0xFFFF 保留 \n", "0x00AC: 0xFFFF 保留 \n", "0x00AD: 0xFFFF 保留 \n", "0x00AE: 0xFFFF 保留 \n", "0x00AF: 0xFFFF 保留 \n", "0x00B0: SLCP101_250111_0800_V2.03 版本 \n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dev_lamina.frame_read(0x60, 0x60)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 参数读写测试" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 62 02 BD E9 05 09 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0062:\t70.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 62 00 01 25 D4 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 62 38 CD FA 16\n", "Parse Result:\n", "0x0062: 61.0 最大启动输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x62, 70.1\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 62 02 BC 28 C5 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 62 02 BC 28 C5 A0 16\n", "Write Result: \n", "0x0062:\t70\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 62 00 01 25 D4 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 BC B8 95 9C 16\n", "Parse Result:\n", "0x0062: 70.0 最大启动输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x62, 70\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 62 02 BB 69 07 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 62 02 BB 69 07 22 16\n", "Write Result: \n", "0x0062:\t69.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 62 00 01 25 D4 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 BB F9 57 9E 16\n", "Parse Result:\n", "0x0062: 69.9 最大启动输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x62, 69.9\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 62 01 91 E8 28 FE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 62 01 91 E8 28 97 16\n", "Write Result: \n", "0x0062:\t40.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 62 00 01 25 D4 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 91 78 78 13 16\n", "Parse Result:\n", "0x0062: 40.1 最大启动输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x62, 40.1\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 62 01 90 29 E8 FE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 62 01 90 29 E8 97 16\n", "Write Result: \n", "0x0062:\t40\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 62 00 01 25 D4 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 90 B9 B8 93 16\n", "Parse Result:\n", "0x0062: 40.0 最大启动输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x62, 40\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 62 01 8F 68 20 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0062:\t39.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 62 00 01 25 D4 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 90 B9 B8 93 16\n", "Parse Result:\n", "0x0062: 40.0 最大启动输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x62, 39.9\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 63 00 3B 38 07 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0063:\t5.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 63 00 01 74 14 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 5A 38 7F A2 16\n", "Parse Result:\n", "0x0063: 9.0 最小停止输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x63, 5.9\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 63 00 3C 79 C5 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 63 00 3C 79 C5 70 16\n", "Write Result: \n", "0x0063:\t6.0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 63 00 01 74 14 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 3C B8 55 DA 16\n", "Parse Result:\n", "0x0063: 6.0 最小停止输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x63, 6.0\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 63 00 3D B8 05 57 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 63 00 3D B8 05 F0 16\n", "Write Result: \n", "0x0063:\t6.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 63 00 01 74 14 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 3D 79 95 DC 16\n", "Parse Result:\n", "0x0063: 6.1 最小停止输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x63, 6.1\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 63 00 C7 38 46 A2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 63 00 C7 38 46 3B 16\n", "Write Result: \n", "0x0063:\t19.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 63 00 01 74 14 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C7 F9 D6 27 16\n", "Parse Result:\n", "0x0063: 19.9 最小停止输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x63, 19.9\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 63 00 C8 78 42 DF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 63 00 C8 78 42 78 16\n", "Write Result: \n", "0x0063:\t20\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 63 00 01 74 14 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0063: 20.0 最小停止输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x63, 20\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 63 00 C9 B9 82 61 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0063:\t20.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 63 00 01 74 14 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0063: 20.0 最小停止输入电压\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, value = 0x63, 20.1\n", "dlen = 1\n", "result = dev_lamina.frame_write(addr, dlen, value)\n", "print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 64 02 57 88 8B CA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0064:\t59.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 64 00 01 C5 D5 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 6C B9 09 C1 16\n", "Parse Result:\n", "0x0064: 62.0 最大停止输入电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 64 02 58 C8 8F 0F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 64 02 58 C8 8F A8 16\n", "Write Result: \n", "0x0064:\t60\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 64 00 01 C5 D5 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0064: 60.0 最大停止输入电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 64 02 59 09 4F 11 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 64 02 59 09 4F AA 16\n", "Write Result: \n", "0x0064:\t60.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 64 00 01 C5 D5 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 59 79 1E 83 16\n", "Parse Result:\n", "0x0064: 60.1 最大停止输入电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 64 03 1F 89 2D 36 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 64 03 1F 89 2D CF 16\n", "Write Result: \n", "0x0064:\t79.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 64 00 01 C5 D5 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 1F F9 7C 28 16\n", "Parse Result:\n", "0x0064: 79.9 最大停止输入电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 64 03 20 C9 3D 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 64 03 20 C9 3D 20 16\n", "Write Result: \n", "0x0064:\t80\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 64 00 01 C5 D5 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 20 B9 6C D9 16\n", "Parse Result:\n", "0x0064: 80.0 最大停止输入电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 64 03 21 08 FD 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0064:\t80.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 64 00 01 C5 D5 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 20 B9 6C D9 16\n", "Parse Result:\n", "0x0064: 80.0 最大停止输入电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 64 FF F6 09 A3 FF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0064:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 64 00 01 C5 D5 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 20 B9 6C D9 16\n", "Parse Result:\n", "0x0064: 80.0 最大停止输入电压\n" ] } ], "source": [ "addr, value = 0x64, 60\n", "dlen = 1\n", "for value in [59.9, 60, 60.1, 79.9, 80, 80.1, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 4F D8 21 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 4F D8 21 40 16\n", "Write Result: \n", "0x0065:\t7.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 4F F9 B0 89 16\n", "Parse Result:\n", "0x0065: 7.9 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 50 99 E9 31 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 50 99 E9 CA 16\n", "Write Result: \n", "0x0065:\t8\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 50 B8 78 11 16\n", "Parse Result:\n", "0x0065: 8.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 51 58 29 31 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 51 58 29 CA 16\n", "Write Result: \n", "0x0065:\t8.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 51 79 B8 13 16\n", "Parse Result:\n", "0x0065: 8.1 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C7 D8 47 45 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 C7 D8 47 DE 16\n", "Write Result: \n", "0x0065:\t19.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C7 F9 D6 27 16\n", "Parse Result:\n", "0x0065: 19.9 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C8 98 43 02 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 C8 98 43 9B 16\n", "Write Result: \n", "0x0065:\t20\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C9 59 83 04 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t20.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 FF F6 58 63 0F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n" ] } ], "source": [ "addr, value = 0x65, 10\n", "dlen = 1\n", "for value in [7.9, 8, 8.1, 19.9, 20, 20.1, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 3B D8 06 78 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t5.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 3C 99 C4 F8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t6\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 3D 58 04 F8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t6.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C7 D8 47 45 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 C7 D8 47 DE 16\n", "Write Result: \n", "0x0065:\t19.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C7 F9 D6 27 16\n", "Parse Result:\n", "0x0065: 19.9 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C8 98 43 02 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 C8 98 43 9B 16\n", "Write Result: \n", "0x0065:\t20\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C9 59 83 04 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t20.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 FF F6 58 63 0F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n" ] } ], "source": [ "addr, value = 0x65, 10\n", "dlen = 1\n", "for value in [5.9, 6, 6.1, 19.9, 20, 20.1, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 45 58 26 22 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t6.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 46 18 27 E4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 46 18 27 7D 16\n", "Write Result: \n", "0x0065:\t7\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 46 39 B6 C6 16\n", "Parse Result:\n", "0x0065: 7.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 47 D9 E7 66 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 47 D9 E7 FF 16\n", "Write Result: \n", "0x0065:\t7.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 47 F8 76 46 16\n", "Parse Result:\n", "0x0065: 7.1 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C7 D8 47 45 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 C7 D8 47 DE 16\n", "Write Result: \n", "0x0065:\t19.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C7 F9 D6 27 16\n", "Parse Result:\n", "0x0065: 19.9 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C8 98 43 02 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 65 00 C8 98 43 9B 16\n", "Write Result: \n", "0x0065:\t20\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 00 C9 59 83 04 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t20.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 65 FF F6 58 63 0F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0065:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 65 00 01 94 15 06 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0065: 20.0 最小MPPT电压\n" ] } ], "source": [ "addr, value = 0x65, 10\n", "dlen = 1\n", "for value in [6.9, 7, 7.1, 19.9, 20, 20.1, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 66 01 2B 28 5A 0E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0066:\t29.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 66 00 01 64 15 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 1C B8 ED 54 16\n", "Parse Result:\n", "0x0066: 54.0 最大MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 66 01 2C 69 98 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 66 01 2C 69 98 27 16\n", "Write Result: \n", "0x0066:\t30\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 66 00 01 64 15 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 2C B8 09 7F 16\n", "Parse Result:\n", "0x0066: 30.0 最大MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 66 01 2D A8 58 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 66 01 2D A8 58 27 16\n", "Write Result: \n", "0x0066:\t30.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 66 00 01 64 15 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 2D 79 C9 01 16\n", "Parse Result:\n", "0x0066: 30.1 最大MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 66 03 1F 28 ED 97 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 66 03 1F 28 ED 30 16\n", "Write Result: \n", "0x0066:\t79.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 66 00 01 64 15 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 1F F9 7C 28 16\n", "Parse Result:\n", "0x0066: 79.9 最大MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 66 03 20 68 FD E8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 66 03 20 68 FD 81 16\n", "Write Result: \n", "0x0066:\t80\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 66 00 01 64 15 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 20 B9 6C D9 16\n", "Parse Result:\n", "0x0066: 80.0 最大MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 66 03 21 A9 3D 6A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0066:\t80.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 66 00 01 64 15 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 20 B9 6C D9 16\n", "Parse Result:\n", "0x0066: 80.0 最大MPPT电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 66 FF F6 A8 63 60 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0066:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 66 00 01 64 15 D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 20 B9 6C D9 16\n", "Parse Result:\n", "0x0066: 80.0 最大MPPT电压\n" ] } ], "source": [ "addr, value = 0x66, 10\n", "dlen = 1\n", "for value in [29.9, 30, 30.1, 79.9, 80, 80.1, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 67 01 AD F8 38 3F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0067:\t42.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 67 00 01 35 D5 69 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 CC B9 81 98 16\n", "Parse Result:\n", "0x0067: 46.0 最小启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 67 01 AE B8 39 01 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 67 01 AE B8 39 9A 16\n", "Write Result: \n", "0x0067:\t43\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 67 00 01 35 D5 69 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 AE 38 68 E0 16\n", "Parse Result:\n", "0x0067: 43.0 最小启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 67 01 AF 79 F9 83 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 67 01 AF 79 F9 1C 16\n", "Write Result: \n", "0x0067:\t43.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 67 00 01 35 D5 69 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 AF F9 A8 E2 16\n", "Parse Result:\n", "0x0067: 43.1 最小启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 67 01 F3 79 C0 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 67 01 F3 79 C0 27 16\n", "Write Result: \n", "0x0067:\t49.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 67 00 01 35 D5 69 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F3 F9 91 0F 16\n", "Parse Result:\n", "0x0067: 49.9 最小启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 67 01 F4 38 02 90 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 67 01 F4 38 02 29 16\n", "Write Result: \n", "0x0067:\t50\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 67 00 01 35 D5 69 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x0067: 50.0 最小启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 67 01 F5 F9 C2 12 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0067:\t50.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 67 00 01 35 D5 69 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x0067: 50.0 最小启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 67 FF F6 F9 A3 F2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0067:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 67 00 01 35 D5 69 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x0067: 50.0 最小启动输出电压\n" ] } ], "source": [ "addr, value = 0x67, 10\n", "dlen = 1\n", "vmin, vmax, vacc = 43, 50, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 68 02 11 C9 7A B8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0068:\t52.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 68 00 01 05 D6 3B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 3A 39 37 3D 16\n", "Parse Result:\n", "0x0068: 57.0 最大启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 68 02 12 89 7B 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 68 02 12 89 7B 13 16\n", "Write Result: \n", "0x0068:\t53\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 68 00 01 05 D6 3B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 12 39 29 07 16\n", "Parse Result:\n", "0x0068: 53.0 最大启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 68 02 13 48 BB 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 68 02 13 48 BB 13 16\n", "Write Result: \n", "0x0068:\t53.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 68 00 01 05 D6 3B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 13 F8 E9 87 16\n", "Parse Result:\n", "0x0068: 53.1 最大启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 68 02 57 48 88 8B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 68 02 57 48 88 24 16\n", "Write Result: \n", "0x0068:\t59.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 68 00 01 05 D6 3B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 57 F8 DA BC 16\n", "Parse Result:\n", "0x0068: 59.9 最大启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 68 02 58 08 8C 50 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 68 02 58 08 8C E9 16\n", "Write Result: \n", "0x0068:\t60\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 68 00 01 05 D6 3B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0068: 60.0 最大启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 68 02 59 C9 4C D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0068:\t60.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 68 00 01 05 D6 3B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0068: 60.0 最大启动输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 68 FF F6 C9 A0 C0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0068:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 68 00 01 05 D6 3B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0068: 60.0 最大启动输出电压\n" ] } ], "source": [ "addr, value = 0x68, 10\n", "dlen = 1\n", "vmin, vmax, vacc = 53, 60, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 01 A3 18 3F 5E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t41.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 A4 B8 6F 5D 16\n", "Parse Result:\n", "0x0069: 42.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 01 A4 59 FD 5E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 69 01 A4 59 FD F7 16\n", "Write Result: \n", "0x0069:\t42\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 A4 B8 6F 5D 16\n", "Parse Result:\n", "0x0069: 42.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 01 A5 98 3D DE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 69 01 A5 98 3D 77 16\n", "Write Result: \n", "0x0069:\t42.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 A5 79 AF 5F 16\n", "Parse Result:\n", "0x0069: 42.1 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 01 DF 19 DE 3A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 69 01 DF 19 DE D3 16\n", "Write Result: \n", "0x0069:\t47.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 DF F8 4C B5 16\n", "Parse Result:\n", "0x0069: 47.9 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 01 E0 59 CE 6B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 69 01 E0 59 CE 04 16\n", "Write Result: \n", "0x0069:\t48\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 01 E1 98 0E EB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t48.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 FF F6 98 60 50 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n" ] } ], "source": [ "addr, value = 0x69, 10\n", "dlen = 1\n", "vmin, vmax, vacc = 42, 48, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 02 11 98 BA C8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t52.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 02 12 D8 BB 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t53\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 02 13 19 7B 0C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t53.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 02 57 19 48 1D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t59.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 02 58 59 4C 62 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t60\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 02 59 98 8C E2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t60.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 69 FF F6 98 60 50 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0069:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 69 00 01 54 16 CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 E0 B8 5C 86 16\n", "Parse Result:\n", "0x0069: 48.0 最小停止输出电压\n" ] } ], "source": [ "addr, value = 0x69, 10\n", "dlen = 1\n", "vmin, vmax, vacc = 53, 60, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6A 02 11 68 BA 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006a:\t52.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6A 00 01 A4 16 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 44 B9 17 A7 16\n", "Parse Result:\n", "0x006A: 58.0 最大停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6A 02 12 28 BB 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6A 02 12 28 BB F4 16\n", "Write Result: \n", "0x006a:\t53\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6A 00 01 A4 16 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 12 39 29 07 16\n", "Parse Result:\n", "0x006A: 53.0 最大停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6A 02 13 E9 7B DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6A 02 13 E9 7B 76 16\n", "Write Result: \n", "0x006a:\t53.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6A 00 01 A4 16 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 13 F8 E9 87 16\n", "Parse Result:\n", "0x006A: 53.1 最大停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6A 02 57 E9 48 EE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6A 02 57 E9 48 87 16\n", "Write Result: \n", "0x006a:\t59.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6A 00 01 A4 16 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 57 F8 DA BC 16\n", "Parse Result:\n", "0x006A: 59.9 最大停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6A 02 58 A9 4C B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6A 02 58 A9 4C 4C 16\n", "Write Result: \n", "0x006a:\t60\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6A 00 01 A4 16 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x006A: 60.0 最大停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6A 02 59 68 8C B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006a:\t60.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6A 00 01 A4 16 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x006A: 60.0 最大停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6A FF F6 68 60 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006a:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6A 00 01 A4 16 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x006A: 60.0 最大停止输出电压\n" ] } ], "source": [ "addr, dlen = 0x6A, 1\n", "vmin, vmax, vacc = 53, 60, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6B 00 63 B8 3F BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006b:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6B 00 01 F5 D6 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 94 B8 8B 6A 16\n", "Parse Result:\n", "0x006B: 66.0 输入过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6B 00 64 F9 FD BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6B 00 64 F9 FD 58 16\n", "Write Result: \n", "0x006b:\t10\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6B 00 01 F5 D6 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x006B: 10.0 输入过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6B 00 65 38 3D 3F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6B 00 65 38 3D D8 16\n", "Write Result: \n", "0x006b:\t10.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6B 00 01 F5 D6 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x006B: 10.1 输入过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6B 02 BB B9 05 E0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6B 02 BB B9 05 79 16\n", "Write Result: \n", "0x006b:\t69.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6B 00 01 F5 D6 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 BB F9 57 9E 16\n", "Parse Result:\n", "0x006B: 69.9 输入过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6B 02 BC F8 C7 E2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6B 02 BC F8 C7 7B 16\n", "Write Result: \n", "0x006b:\t70\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6B 00 01 F5 D6 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 BC B8 95 9C 16\n", "Parse Result:\n", "0x006B: 70.0 输入过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6B 02 BD 39 07 64 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006b:\t70.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6B 00 01 F5 D6 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 BC B8 95 9C 16\n", "Parse Result:\n", "0x006B: 70.0 输入过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6B FF F6 39 A0 33 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006b:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6B 00 01 F5 D6 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 BC B8 95 9C 16\n", "Parse Result:\n", "0x006B: 70.0 输入过压保护值\n" ] } ], "source": [ "addr, dlen = 0x6B, 1\n", "vmin, vmax, vacc = 10, 70, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6C 00 63 09 FE D0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006c:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6C 00 01 44 17 BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x006C: 60.0 输出过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6C 00 64 48 3C 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6C 00 64 48 3C E7 16\n", "Write Result: \n", "0x006c:\t10\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6C 00 01 44 17 BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x006C: 10.0 输出过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6C 00 65 89 FC 50 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6C 00 65 89 FC E9 16\n", "Write Result: \n", "0x006c:\t10.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6C 00 01 44 17 BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x006C: 10.1 输出过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6C 02 6B 09 58 34 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6C 02 6B 09 58 CD 16\n", "Write Result: \n", "0x006c:\t61.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6C 00 01 44 17 BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 6B F8 CB C1 16\n", "Parse Result:\n", "0x006C: 61.9 输出过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6C 02 6C 48 9A B6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6C 02 6C 48 9A 4F 16\n", "Write Result: \n", "0x006c:\t62\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6C 00 01 44 17 BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 6C B9 09 C1 16\n", "Parse Result:\n", "0x006C: 62.0 输出过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6C 02 6D 89 5A B8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006c:\t62.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6C 00 01 44 17 BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 6C B9 09 C1 16\n", "Parse Result:\n", "0x006C: 62.0 输出过压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6C FF F6 88 61 44 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006c:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6C 00 01 44 17 BF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 6C B9 09 C1 16\n", "Parse Result:\n", "0x006C: 62.0 输出过压保护值\n" ] } ], "source": [ "addr, dlen = 0x6C, 1\n", "vmin, vmax, vacc = 10, 62, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6D 00 63 58 3E 60 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006d:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6D 00 01 15 D7 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 B8 B9 A6 A9 16\n", "Parse Result:\n", "0x006D: 44.0 输出欠压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6D 00 64 19 FC E0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6D 00 64 19 FC 79 16\n", "Write Result: \n", "0x006d:\t10\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6D 00 01 15 D7 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x006D: 10.0 输出欠压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6D 00 65 D8 3C E0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6D 00 65 D8 3C 79 16\n", "Write Result: \n", "0x006d:\t10.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6D 00 01 15 D7 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x006D: 10.1 输出欠压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6D 01 F3 59 C2 76 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6D 01 F3 59 C2 0F 16\n", "Write Result: \n", "0x006d:\t49.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6D 00 01 15 D7 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F3 F9 91 0F 16\n", "Parse Result:\n", "0x006D: 49.9 输出欠压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6D 01 F4 18 00 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6D 01 F4 18 00 0D 16\n", "Write Result: \n", "0x006d:\t50\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6D 00 01 15 D7 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x006D: 50.0 输出欠压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6D 01 F5 D9 C0 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006d:\t50.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6D 00 01 15 D7 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x006D: 50.0 输出欠压保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6D FF F6 D9 A1 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006d:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6D 00 01 15 D7 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x006D: 50.0 输出欠压保护值\n" ] } ], "source": [ "addr, dlen = 0x6D, 1\n", "vmin, vmax, vacc = 10, 50, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6E 01 2B A9 98 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006e:\t2.99\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6E 00 01 E5 D7 22 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 09 60 BE 3C F4 16\n", "Parse Result:\n", "0x006E: 24.0 电感过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6E 01 2C E8 5A D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6E 01 2C E8 5A 70 16\n", "Write Result: \n", "0x006e:\t3\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6E 00 01 E5 D7 22 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 2C B8 09 7F 16\n", "Parse Result:\n", "0x006E: 3.0 电感过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6E 01 2D 29 9A 59 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6E 01 2D 29 9A F2 16\n", "Write Result: \n", "0x006e:\t3.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6E 00 01 E5 D7 22 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 2D 79 C9 01 16\n", "Parse Result:\n", "0x006E: 3.01 电感过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6E 0B B7 AF 51 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6E 0B B7 AF 51 C3 16\n", "Write Result: \n", "0x006e:\t29.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6E 00 01 E5 D7 22 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 0B B7 FF 02 54 16\n", "Parse Result:\n", "0x006E: 29.99 电感过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6E 0B B8 EF 55 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6E 0B B8 EF 55 08 16\n", "Write Result: \n", "0x006e:\t30\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6E 00 01 E5 D7 22 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 0B B8 BF 06 19 16\n", "Parse Result:\n", "0x006E: 30.0 电感过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6E 0B B9 2E 95 EF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006e:\t30.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6E 00 01 E5 D7 22 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 0B B8 BF 06 19 16\n", "Parse Result:\n", "0x006E: 30.0 电感过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6E FF 9C A9 8E 3A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006e:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6E 00 01 E5 D7 22 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 0B B8 BF 06 19 16\n", "Parse Result:\n", "0x006E: 30.0 电感过流保护值\n" ] } ], "source": [ "addr, dlen = 0x6E, 1\n", "vmin, vmax, vacc = 3, 30, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6F FF FF B8 67 86 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006f:\t-0.01\tFail.\n", "Write Result: \n", "0x006f:\t-0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6F 00 01 B4 17 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x006F: 20.0 输入过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6F 00 00 B9 D7 F9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6F 00 00 B9 D7 92 16\n", "Write Result: \n", "0x006f:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6F 00 01 B4 17 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x006F: 0.0 输入过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6F 00 01 78 17 F9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6F 00 01 78 17 92 16\n", "Write Result: \n", "0x006f:\t0.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6F 00 01 B4 17 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x006F: 0.01 输入过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6F 13 87 F4 85 7C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6F 13 87 F4 85 15 16\n", "Write Result: \n", "0x006f:\t49.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6F 00 01 B4 17 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 87 F5 16 36 16\n", "Parse Result:\n", "0x006F: 49.99 输入过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6F 13 88 B4 81 39 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 6F 13 88 B4 81 D2 16\n", "Write Result: \n", "0x006f:\t50\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6F 00 01 B4 17 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 88 B5 12 F3 16\n", "Parse Result:\n", "0x006F: 50.0 输入过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6F 13 89 75 41 BB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006f:\t50.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6F 00 01 B4 17 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 88 B5 12 F3 16\n", "Parse Result:\n", "0x006F: 50.0 输入过流保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 6F FF 9C F8 4E 4A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x006f:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 6F 00 01 B4 17 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 88 B5 12 F3 16\n", "Parse Result:\n", "0x006F: 50.0 输入过流保护值\n" ] } ], "source": [ "addr, dlen = 0x6F, 1\n", "vmin, vmax, vacc = 0, 50, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 FF FF 89 A1 92 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t-0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 0A 38 43 16 16\n", "Parse Result:\n", "0x0070: 0.1 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 00 00 88 11 03 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 00 00 88 11 9C 16\n", "Write Result: \n", "0x0070:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0070: 0.0 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 00 01 49 D1 85 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 00 01 49 D1 1E 16\n", "Write Result: \n", "0x0070:\t0.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 13 87 C5 43 0C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t49.99\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 13 88 85 47 D1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t50\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 13 89 44 87 D1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t50.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 FF 9C C9 88 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n" ] } ], "source": [ "addr, dlen = 0x70, 1\n", "vmin, vmax, vacc = 0, 50, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 FF FF 89 A1 92 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t-0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 00 00 88 11 03 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 00 00 88 11 9C 16\n", "Write Result: \n", "0x0070:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0070: 0.0 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 00 01 49 D1 85 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 00 01 49 D1 1E 16\n", "Write Result: \n", "0x0070:\t0.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 08 97 CE 7F 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 08 97 CE 7F EF 16\n", "Write Result: \n", "0x0070:\t21.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 08 97 FE 2A 58 16\n", "Parse Result:\n", "0x0070: 21.99 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 08 98 8E 7B 13 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t22\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 08 97 FE 2A 58 16\n", "Parse Result:\n", "0x0070: 21.99 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 08 99 4F BB 15 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t22.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 08 97 FE 2A 58 16\n", "Parse Result:\n", "0x0070: 21.99 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 FF 9C C9 88 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 08 97 FE 2A 58 16\n", "Parse Result:\n", "0x0070: 21.99 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 00 64 89 FA 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 00 64 89 FA EA 16\n", "Write Result: \n", "0x0070:\t1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x0070: 1.0 最小电感电流限值\n" ] } ], "source": [ "addr, dlen = 0x70, 1\n", "vmin, vmax, vacc = 0, 22, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 FF FF D8 61 A2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0071:\t-0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 08 98 BE 2E 1D 16\n", "Parse Result:\n", "0x0071: 22.0 最大电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 00 00 D9 D1 15 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0071:\t0\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 08 98 BE 2E 1D 16\n", "Parse Result:\n", "0x0071: 22.0 最大电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 00 01 18 11 95 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0071:\t0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 08 98 BE 2E 1D 16\n", "Parse Result:\n", "0x0071: 22.0 最大电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 13 87 94 83 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 71 13 87 94 83 B5 16\n", "Write Result: \n", "0x0071:\t49.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 87 F5 16 36 16\n", "Parse Result:\n", "0x0071: 49.99 最大电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 13 88 D4 87 61 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 71 13 88 D4 87 FA 16\n", "Write Result: \n", "0x0071:\t50\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 88 B5 12 F3 16\n", "Parse Result:\n", "0x0071: 50.0 最大电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 13 89 15 47 63 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0071:\t50.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 88 B5 12 F3 16\n", "Parse Result:\n", "0x0071: 50.0 最大电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 FF 9C 98 48 E6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0071:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 88 B5 12 F3 16\n", "Parse Result:\n", "0x0071: 50.0 最大电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 00 64 D8 3A E1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0071:\t1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 88 B5 12 F3 16\n", "Parse Result:\n", "0x0071: 50.0 最大电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 71 00 65 19 FA E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 71 00 65 19 FA 7C 16\n", "Write Result: \n", "0x0071:\t1.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 71 00 01 D4 11 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x0071: 1.01 最大电感电流限值\n" ] } ], "source": [ "addr, dlen = 0x71, 1\n", "vmin, vmax, vacc = 0, 50, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 1, 1.01]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 FF FF 89 A1 92 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t-0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x0070: 1.0 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 00 00 88 11 03 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 00 00 88 11 9C 16\n", "Write Result: \n", "0x0070:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0070: 0.0 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 00 01 49 D1 85 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 00 01 49 D1 1E 16\n", "Write Result: \n", "0x0070:\t0.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 08 97 CE 7F 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t21.99\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 08 98 8E 7B 13 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t22\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 08 99 4F BB 15 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t22.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 FF 9C C9 88 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0070:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0070: 0.01 最小电感电流限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 70 00 64 89 FA 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 70 00 64 89 FA EA 16\n", "Write Result: \n", "0x0070:\t1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 70 00 01 85 D1 BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x0070: 1.0 最小电感电流限值\n" ] } ], "source": [ "addr, dlen = 0x70, 1\n", "vmin, vmax, vacc = 0, 22, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 72 FF FF 28 61 F3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0072:\t-0.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 72 00 01 24 11 9F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 3A 39 37 3D 16\n", "Parse Result:\n", "0x0072: 57.0 浮充电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 72 00 00 29 D1 66 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 72 00 00 29 D1 FF 16\n", "Write Result: \n", "0x0072:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 72 00 01 24 11 9F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0072: 0.0 浮充电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 72 00 01 E8 11 66 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 72 00 01 E8 11 FF 16\n", "Write Result: \n", "0x0072:\t0.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 72 00 01 24 11 9F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0072: 0.1 浮充电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 72 03 E7 69 6B 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 72 03 E7 69 6B C3 16\n", "Write Result: \n", "0x0072:\t99.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 72 00 01 24 11 9F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E7 F8 FE 71 16\n", "Parse Result:\n", "0x0072: 99.9 浮充电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 72 03 E8 29 6F EF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 72 03 E8 29 6F 88 16\n", "Write Result: \n", "0x0072:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 72 00 01 24 11 9F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x0072: 100.0 浮充电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 72 03 E9 E8 AF EF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0072:\t100.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 72 00 01 24 11 9F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x0072: 100.0 浮充电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 72 FF F6 E8 67 B0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0072:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 72 00 01 24 11 9F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x0072: 100.0 浮充电压阈值\n" ] } ], "source": [ "addr, dlen = 0x72, 1\n", "vmin, vmax, vacc = 0, 100, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 73 FF FF 79 A1 85 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0073:\t-0.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 73 00 01 75 D1 B1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 35 79 33 74 16\n", "Parse Result:\n", "0x0073: 56.5 三点法中间阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 73 00 00 78 11 F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 73 00 00 78 11 8F 16\n", "Write Result: \n", "0x0073:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 73 00 01 75 D1 B1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0073: 0.0 三点法中间阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 73 00 01 B9 D1 F8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 73 00 01 B9 D1 91 16\n", "Write Result: \n", "0x0073:\t0.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 73 00 01 75 D1 B1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0073: 0.1 三点法中间阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 73 03 E7 38 AB 3A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 73 03 E7 38 AB D3 16\n", "Write Result: \n", "0x0073:\t99.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 73 00 01 75 D1 B1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E7 F8 FE 71 16\n", "Parse Result:\n", "0x0073: 99.9 三点法中间阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 73 03 E8 78 AF 7F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 73 03 E8 78 AF 18 16\n", "Write Result: \n", "0x0073:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 73 00 01 75 D1 B1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x0073: 100.0 三点法中间阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 73 03 E9 B9 6F 81 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0073:\t100.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 73 00 01 75 D1 B1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x0073: 100.0 三点法中间阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 73 FF F6 B9 A7 C2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0073:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 73 00 01 75 D1 B1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x0073: 100.0 三点法中间阈值\n" ] } ], "source": [ "addr, dlen = 0x73, 1\n", "vmin, vmax, vacc = 0, 100, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 74 00 63 89 F9 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0074:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 74 00 01 C4 10 40 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 21 79 3C 69 16\n", "Parse Result:\n", "0x0074: 54.5 恒压充电电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 74 00 64 C8 3B D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 74 00 64 C8 3B 6E 16\n", "Write Result: \n", "0x0074:\t10\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 74 00 01 C4 10 40 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x0074: 10.0 恒压充电电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 74 00 65 09 FB D7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 74 00 65 09 FB 70 16\n", "Write Result: \n", "0x0074:\t10.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 74 00 01 C4 10 40 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x0074: 10.1 恒压充电电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 74 02 57 89 4E 9E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 74 02 57 89 4E 37 16\n", "Write Result: \n", "0x0074:\t59.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 74 00 01 C4 10 40 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 57 F8 DA BC 16\n", "Parse Result:\n", "0x0074: 59.9 恒压充电电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 74 02 58 C9 4A DB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 74 02 58 C9 4A 74 16\n", "Write Result: \n", "0x0074:\t60\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 74 00 01 C4 10 40 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0074: 60.0 恒压充电电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 74 02 59 08 8A 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0074:\t60.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 74 00 01 C4 10 40 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0074: 60.0 恒压充电电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 74 FF F6 08 66 D1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0074:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 74 00 01 C4 10 40 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0074: 60.0 恒压充电电压\n" ] } ], "source": [ "addr, dlen = 0x74, 1\n", "vmin, vmax, vacc = 10, 60, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 00 63 D8 39 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 04 1A 3B 4F 39 16\n", "Parse Result:\n", "0x0075: 105.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 00 64 99 FB 67 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t10\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 04 1A 3B 4F 39 16\n", "Parse Result:\n", "0x0075: 105.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 00 65 58 3B 67 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t10.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 04 1A 3B 4F 39 16\n", "Parse Result:\n", "0x0075: 105.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 05 DB DB 1B 45 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 75 05 DB DB 1B DE 16\n", "Write Result: \n", "0x0075:\t149.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DB FB 4F BB 16\n", "Parse Result:\n", "0x0075: 149.9 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 05 DC 9A D9 C3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 75 05 DC 9A D9 5C 16\n", "Write Result: \n", "0x0075:\t150\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0075: 150.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 05 DD 5B 19 C5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t150.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0075: 150.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 FF F6 59 A6 63 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0075: 150.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 03 52 19 1D FA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t85\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0075: 150.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 03 53 D8 DD 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 75 03 53 D8 DD 13 16\n", "Write Result: \n", "0x0075:\t85.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 53 F8 89 68 16\n", "Parse Result:\n", "0x0075: 85.1 过温故障值\n" ] } ], "source": [ "addr, dlen = 0x75, 1\n", "vmin, vmax, vacc = 10, 150, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 85, 85.1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 00 63 28 39 34 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 B6 39 02 85 16\n", "Parse Result:\n", "0x0076: 95.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 00 64 69 FB 38 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t10\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 B6 39 02 85 16\n", "Parse Result:\n", "0x0076: 95.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 00 65 A8 3B B8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t10.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 B6 39 02 85 16\n", "Parse Result:\n", "0x0076: 95.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 05 DB 2B 1B 96 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 76 05 DB 2B 1B 2F 16\n", "Write Result: \n", "0x0076:\t149.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DB FB 4F BB 16\n", "Parse Result:\n", "0x0076: 149.9 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 05 DC 6A D9 94 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 76 05 DC 6A D9 2D 16\n", "Write Result: \n", "0x0076:\t150\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0076: 150.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 05 DD AB 19 16 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t150.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0076: 150.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 FF F6 A9 A6 B4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0076: 150.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 03 52 E9 1D CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t85\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0076: 150.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 03 53 28 DD CB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 76 03 53 28 DD 64 16\n", "Write Result: \n", "0x0076:\t85.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 53 F8 89 68 16\n", "Parse Result:\n", "0x0076: 85.1 过温告警值\n" ] } ], "source": [ "addr, dlen = 0x76, 1\n", "vmin, vmax, vacc = 10, 150, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 85, 85.1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 00 63 79 F9 46 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0077:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 52 39 49 68 16\n", "Parse Result:\n", "0x0077: 85.0 温度恢复值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 00 64 38 3B 48 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 77 00 64 38 3B E1 16\n", "Write Result: \n", "0x0077:\t10\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x0077: 10.0 温度恢复值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 00 65 F9 FB CA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 77 00 65 F9 FB 63 16\n", "Write Result: \n", "0x0077:\t10.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x0077: 10.1 温度恢复值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 04 AF 7B 6C 0B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0077:\t119.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x0077: 10.1 温度恢复值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 04 B0 3A A4 03 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0077:\t120\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x0077: 10.1 温度恢复值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 04 B1 FB 64 85 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0077:\t120.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x0077: 10.1 温度恢复值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 FF F6 F8 66 C4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0077:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 65 78 6F DD 16\n", "Parse Result:\n", "0x0077: 10.1 温度恢复值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 03 52 B8 DD 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 77 03 52 B8 DD F4 16\n", "Write Result: \n", "0x0077:\t85\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 52 39 49 68 16\n", "Parse Result:\n", "0x0077: 85.0 温度恢复值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 03 53 79 1D 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0077:\t85.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 77 00 01 34 10 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 52 39 49 68 16\n", "Parse Result:\n", "0x0077: 85.0 温度恢复值\n" ] } ], "source": [ "addr, dlen = 0x77, 1\n", "vmin, vmax, vacc = 10, 120, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 85, 85.1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 77 03 20 38 F8 C4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 77 03 20 38 F8 5D 16\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dev_lamina.frame_write_one(0x77, 80)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 00 63 D8 39 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 53 F8 89 68 16\n", "Parse Result:\n", "0x0075: 85.1 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 00 64 99 FB 67 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t10\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 53 F8 89 68 16\n", "Parse Result:\n", "0x0075: 85.1 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 00 65 58 3B 67 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t10.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 53 F8 89 68 16\n", "Parse Result:\n", "0x0075: 85.1 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 05 DB DB 1B 45 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 75 05 DB DB 1B DE 16\n", "Write Result: \n", "0x0075:\t149.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DB FB 4F BB 16\n", "Parse Result:\n", "0x0075: 149.9 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 05 DC 9A D9 C3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 75 05 DC 9A D9 5C 16\n", "Write Result: \n", "0x0075:\t150\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0075: 150.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 05 DD 5B 19 C5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t150.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0075: 150.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 FF F6 59 A6 63 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0075: 150.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 03 20 99 38 63 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0075:\t80\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0075: 150.0 过温故障值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 75 03 21 58 F8 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 75 03 21 58 F8 7C 16\n", "Write Result: \n", "0x0075:\t80.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 75 00 01 95 D0 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 21 78 AC D9 16\n", "Parse Result:\n", "0x0075: 80.1 过温故障值\n" ] } ], "source": [ "addr, dlen = 0x75, 1\n", "vmin, vmax, vacc = 10, 150, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 80, 80.1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Discard Data: b'MICRO MONITOR 1.20.13\\r\\nPlatform: HC32F460\\r\\nCPU: HC32F460\\r\\nBuilt: Oct 31 2024 @ 22:55:07\\r\\nMonitor RAM: 0x1fff8448-0x1fff938c\\r\\nApplication RAM Base: 0x20010000\\r\\njump to app...\\r\\r\\n'\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 00 63 28 39 34 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t9.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 53 F8 89 68 16\n", "Parse Result:\n", "0x0076: 85.1 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 00 64 69 FB 38 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t10\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 53 F8 89 68 16\n", "Parse Result:\n", "0x0076: 85.1 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 00 65 A8 3B B8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t10.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 53 F8 89 68 16\n", "Parse Result:\n", "0x0076: 85.1 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 05 DB 2B 1B 96 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 76 05 DB 2B 1B 2F 16\n", "Write Result: \n", "0x0076:\t149.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DB FB 4F BB 16\n", "Parse Result:\n", "0x0076: 149.9 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 05 DC 6A D9 94 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 76 05 DC 6A D9 2D 16\n", "Write Result: \n", "0x0076:\t150\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0076: 150.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 05 DD AB 19 16 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t150.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0076: 150.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 FF F6 A9 A6 B4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0076: 150.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 03 20 69 38 34 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0076:\t80\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 05 DC BA 8D B9 16\n", "Parse Result:\n", "0x0076: 150.0 过温告警值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 76 03 21 A8 F8 34 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 76 03 21 A8 F8 CD 16\n", "Write Result: \n", "0x0076:\t80.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 76 00 01 65 D0 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 21 78 AC D9 16\n", "Parse Result:\n", "0x0076: 80.1 过温告警值\n" ] } ], "source": [ "addr, dlen = 0x76, 1\n", "vmin, vmax, vacc = 10, 150, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 80, 80.1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 78 00 C7 48 41 C2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0078:\t19.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 78 00 01 04 13 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 5E 38 2C 54 16\n", "Parse Result:\n", "0x0078: 35.0 最低满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 78 00 C8 08 45 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 78 00 C8 08 45 20 16\n", "Write Result: \n", "0x0078:\t20\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 78 00 01 04 13 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0078: 20.0 最低满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 78 00 C9 C9 85 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 78 00 C9 C9 85 22 16\n", "Write Result: \n", "0x0078:\t20.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 78 00 01 04 13 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C9 78 12 E4 16\n", "Parse Result:\n", "0x0078: 20.1 最低满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 78 01 8F 49 E7 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 78 01 8F 49 E7 CB 16\n", "Write Result: \n", "0x0078:\t39.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 78 00 01 04 13 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 8F F8 70 89 16\n", "Parse Result:\n", "0x0078: 39.9 最低满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 78 01 90 08 2F 3A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 78 01 90 08 2F D3 16\n", "Write Result: \n", "0x0078:\t40\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 78 00 01 04 13 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 90 B9 B8 93 16\n", "Parse Result:\n", "0x0078: 40.0 最低满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 78 01 91 C9 EF BC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0078:\t40.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 78 00 01 04 13 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 90 B9 B8 93 16\n", "Parse Result:\n", "0x0078: 40.0 最低满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 78 FF F6 C8 65 94 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0078:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 78 00 01 04 13 87 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 90 B9 B8 93 16\n", "Parse Result:\n", "0x0078: 40.0 最低满载电压\n" ] } ], "source": [ "addr, dlen = 0x78, 1\n", "vmin, vmax, vacc = 20, 40, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 79 01 F3 19 C6 46 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0079:\t49.9\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 79 00 01 55 D3 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 30 B9 30 AC 16\n", "Parse Result:\n", "0x0079: 56.0 最高满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 79 01 F4 58 04 C4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 79 01 F4 58 04 5D 16\n", "Write Result: \n", "0x0079:\t50\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 79 00 01 55 D3 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x0079: 50.0 最高满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 79 01 F5 99 C4 C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 79 01 F5 99 C4 5F 16\n", "Write Result: \n", "0x0079:\t50.1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 79 00 01 55 D3 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F5 79 93 93 16\n", "Parse Result:\n", "0x0079: 50.1 最高满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 79 02 57 18 8D 71 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 79 02 57 18 8D 0A 16\n", "Write Result: \n", "0x0079:\t59.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 79 00 01 55 D3 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 57 F8 DA BC 16\n", "Parse Result:\n", "0x0079: 59.9 最高满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 79 02 58 58 89 AE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 79 02 58 58 89 47 16\n", "Write Result: \n", "0x0079:\t60\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 79 00 01 55 D3 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0079: 60.0 最高满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 79 02 59 99 49 B0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0079:\t60.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 79 00 01 55 D3 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0079: 60.0 最高满载电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 79 FF F6 99 A5 A6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0079:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 79 00 01 55 D3 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 58 B8 DE 81 16\n", "Parse Result:\n", "0x0079: 60.0 最高满载电压\n" ] } ], "source": [ "addr, dlen = 0x79, 1\n", "vmin, vmax, vacc = 50, 60, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 86 9F 00 01 AC 52 AD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007a:\t99.999\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 60 00 0A 5A C2 C9 16\n", "Parse Result:\n", "0x007A: 700.0 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 86 A0 00 01 9C 5E AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7A 00 02 60 11 8A 16\n", "Write Result: \n", "0x007a:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 86 A0 00 01 12 99 67 16\n", "Parse Result:\n", "0x007A: 100.0 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 86 A1 00 01 CD 9E 1C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7A 00 02 60 11 8A 16\n", "Write Result: \n", "0x007a:\t100.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 86 A1 00 01 43 59 59 16\n", "Parse Result:\n", "0x007A: 100.001 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 34 FF 00 0C 4A F1 03 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7A 00 02 60 11 8A 16\n", "Write Result: \n", "0x007a:\t799.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 34 FF 00 0C C4 36 CE 16\n", "Parse Result:\n", "0x007A: 799.999 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 35 00 00 0C 7B 3D 82 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7A 00 02 60 11 8A 16\n", "Write Result: \n", "0x007a:\t800\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007A: 800.0 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 35 01 00 0C 2A FD F2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007a:\t800.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007A: 800.0 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 FC 18 FF FF C5 13 73 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007a:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007A: 800.0 输入过载保护值\n" ] } ], "source": [ "addr, dlen = 0x7A, 2\n", "vmin, vmax, vacc = 100, 800, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 FF FF FF FF F5 4A C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 03 E8 00 00 7A 43 3D 16\n", "Parse Result:\n", "0x007C: 1.0 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 00 00 00 00 F4 DE 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 00 00 FA 33 C2 16\n", "Parse Result:\n", "0x007C: 0.0 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 00 01 00 00 A5 1E 4F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t0.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 34 FF 00 0C CA DB 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t799.999\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 35 00 00 0C FB 17 DE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t800\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 35 01 00 0C AA D7 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t800.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 FC 18 FF FF 45 39 1B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 49 F0 00 02 63 70 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t150\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 49 F0 00 02 6D 9D DA 16\n", "Parse Result:\n", "0x007C: 150.0 最小功率限值\n" ] } ], "source": [ "addr, dlen = 0x7C, 2\n", "vmin, vmax, vacc = 0, 800, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 150]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 FF FF FF FF F5 4A C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 49 F0 00 02 6D 9D DA 16\n", "Parse Result:\n", "0x007C: 150.0 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 00 00 00 00 F4 DE 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 00 00 FA 33 C2 16\n", "Parse Result:\n", "0x007C: 0.0 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 00 01 00 00 A5 1E 4F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t0.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 34 FF 00 0C CA DB 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t799.999\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 35 00 00 0C FB 17 DE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t800\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 35 01 00 0C AA D7 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t800.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 FC 18 FF FF 45 39 1B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 EB 0F 00 09 31 3F FE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t649.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 EB 0F 00 09 3F D2 A9 16\n", "Parse Result:\n", "0x007C: 649.999 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 EB 10 00 09 00 F9 88 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t650\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 EB 0F 00 09 3F D2 A9 16\n", "Parse Result:\n", "0x007C: 649.999 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 49 F0 00 02 63 70 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t150\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 49 F0 00 02 6D 9D DA 16\n", "Parse Result:\n", "0x007C: 150.0 最小功率限值\n" ] } ], "source": [ "addr, dlen = 0x7C, 2\n", "vmin, vmax, vacc = 0, 800, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 650-vacc, 650, 150]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 49 EF 00 02 D3 6F 09 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t149.999\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 EB 10 00 09 0E 14 BB 16\n", "Parse Result:\n", "0x007E: 650.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 49 F0 00 02 E2 A9 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t150\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 EB 10 00 09 0E 14 BB 16\n", "Parse Result:\n", "0x007E: 650.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 49 F1 00 02 B3 69 E5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7E 00 02 21 D0 0E 16\n", "Write Result: \n", "0x007e:\t150.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 49 F1 00 02 3C 5D 6A 16\n", "Parse Result:\n", "0x007E: 150.001 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 34 FF 00 0C 4B 02 19 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7E 00 02 21 D0 0E 16\n", "Write Result: \n", "0x007e:\t799.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 34 FF 00 0C C4 36 CE 16\n", "Parse Result:\n", "0x007E: 799.999 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 35 00 00 0C 7A CE 16 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7E 00 02 21 D0 0E 16\n", "Write Result: \n", "0x007e:\t800\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007E: 800.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 35 01 00 0C 2B 0E 08 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t800.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007E: 800.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 FC 18 FF FF C4 E0 43 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007E: 800.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 AE 60 00 0A D5 F6 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7E 00 02 21 D0 0E 16\n", "Write Result: \n", "0x007e:\t700\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 60 00 0A 5A C2 C9 16\n", "Parse Result:\n", "0x007E: 700.0 最大功率限值\n" ] } ], "source": [ "addr, dlen = 0x7E, 2\n", "vmin, vmax, vacc = 150, 800, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 700]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 06 04 10 8D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 11 01 03 0C 49 F0 00 02 AE 60 00 0A EB 10 00 09 13 E4 F3 16\n", "Parse Result:\n", "0x007C: 150.0 最小功率限值 \n", "0x007E: 700.0 最大功率限值 \n", "0x0080: 650.0 最大功率限值存储值\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dev_lamina.frame_read(0x7C, 6)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 FF FF FF FF 75 60 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007a:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007A: 800.0 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 00 00 00 00 74 F4 F1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007a:\t0\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007A: 800.0 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 00 01 00 00 25 34 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007a:\t0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007A: 800.0 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 AE 5F 00 0A E4 09 8D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7A 00 02 60 11 8A 16\n", "Write Result: \n", "0x007a:\t699.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 5F 00 0A 6A CE E4 16\n", "Parse Result:\n", "0x007A: 699.999 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 AE 60 00 0A D4 05 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7A 00 02 60 11 8A 16\n", "Write Result: \n", "0x007a:\t700\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 60 00 0A 5A C2 C9 16\n", "Parse Result:\n", "0x007A: 700.0 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 AE 61 00 0A 85 C5 EC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7A 00 02 60 11 8A 16\n", "Write Result: \n", "0x007a:\t700.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 61 00 0A 0B 02 BB 16\n", "Parse Result:\n", "0x007A: 700.001 输入过载保护值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7A 00 02 04 FC 18 FF FF C5 13 73 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007a:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7A 00 02 E5 D2 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 61 00 0A 0B 02 BB 16\n", "Parse Result:\n", "0x007A: 700.001 输入过载保护值\n" ] } ], "source": [ "addr, dlen = 0x7A, 2\n", "vmin, vmax, vacc = 0, 700, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 FF FF FF FF F5 4A C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 49 F0 00 02 6D 9D DA 16\n", "Parse Result:\n", "0x007C: 150.0 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 00 00 00 00 F4 DE 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 00 00 FA 33 C2 16\n", "Parse Result:\n", "0x007C: 0.0 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 00 01 00 00 A5 1E 4F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t0.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x007C: 0.001 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 AE 5F 00 0A 64 23 29 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7C 00 02 80 10 AB 16\n", "Write Result: \n", "0x007c:\t699.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 5F 00 0A 6A CE E4 16\n", "Parse Result:\n", "0x007C: 699.999 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 AE 60 00 0A 54 2F 26 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t700\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 5F 00 0A 6A CE E4 16\n", "Parse Result:\n", "0x007C: 699.999 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 AE 61 00 0A 05 EF 98 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t700.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 5F 00 0A 6A CE E4 16\n", "Parse Result:\n", "0x007C: 699.999 最小功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7C 00 02 04 FC 18 FF FF 45 39 1B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007c:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7C 00 02 05 D3 4D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 5F 00 0A 6A CE E4 16\n", "Parse Result:\n", "0x007C: 699.999 最小功率限值\n" ] } ], "source": [ "addr, dlen = 0x7C, 2\n", "vmin, vmax, vacc = 0, 700, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 49 EF 00 02 D3 6F 09 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t149.999\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 60 00 0A 5A C2 C9 16\n", "Parse Result:\n", "0x007E: 700.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 49 F0 00 02 E2 A9 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t150\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 60 00 0A 5A C2 C9 16\n", "Parse Result:\n", "0x007E: 700.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 49 F1 00 02 B3 69 E5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t150.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 60 00 0A 5A C2 C9 16\n", "Parse Result:\n", "0x007E: 700.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 34 FF 00 0C 4B 02 19 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7E 00 02 21 D0 0E 16\n", "Write Result: \n", "0x007e:\t799.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 34 FF 00 0C C4 36 CE 16\n", "Parse Result:\n", "0x007E: 799.999 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 35 00 00 0C 7A CE 16 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7E 00 02 21 D0 0E 16\n", "Write Result: \n", "0x007e:\t800\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007E: 800.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 35 01 00 0C 2B 0E 08 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t800.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007E: 800.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 FC 18 FF FF C4 E0 43 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007E: 800.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 AE 5F 00 0A E5 FA 83 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x007e:\t699.999\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x007E: 800.0 最大功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 7E 00 02 04 AE 60 00 0A D5 F6 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 7E 00 02 21 D0 0E 16\n", "Write Result: \n", "0x007e:\t700\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 7E 00 02 A4 13 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 60 00 0A 5A C2 C9 16\n", "Parse Result:\n", "0x007E: 700.0 最大功率限值\n" ] } ], "source": [ "addr, dlen = 0x7E, 2\n", "vmin, vmax, vacc = 150, 800, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 700-vacc, 700]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 86 9F 00 01 23 69 41 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0080:\t99.999\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 EB 10 00 09 0E 14 BB 16\n", "Parse Result:\n", "0x0080: 650.0 最大功率限值存储值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 86 A0 00 01 13 65 2E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 80 00 02 40 20 7F 16\n", "Write Result: \n", "0x0080:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 86 A0 00 01 12 99 67 16\n", "Parse Result:\n", "0x0080: 100.0 最大功率限值存储值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 86 A1 00 01 42 A5 9E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 80 00 02 40 20 7F 16\n", "Write Result: \n", "0x0080:\t100.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 86 A1 00 01 43 59 59 16\n", "Parse Result:\n", "0x0080: 100.001 最大功率限值存储值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 34 FF 00 0C C5 CA 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 80 00 02 40 20 7F 16\n", "Write Result: \n", "0x0080:\t799.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 34 FF 00 0C C4 36 CE 16\n", "Parse Result:\n", "0x0080: 799.999 最大功率限值存储值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 35 00 00 0C F4 06 CA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 80 00 02 40 20 7F 16\n", "Write Result: \n", "0x0080:\t800\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x0080: 800.0 最大功率限值存储值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 35 01 00 0C A5 C6 3C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0080:\t800.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x0080: 800.0 最大功率限值存储值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 FC 18 FF FF 4A 28 13 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0080:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 35 00 00 0C F5 FA C5 16\n", "Parse Result:\n", "0x0080: 800.0 最大功率限值存储值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 AE 5F 00 0A 6B 32 43 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 80 00 02 40 20 7F 16\n", "Write Result: \n", "0x0080:\t699.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 5F 00 0A 6A CE E4 16\n", "Parse Result:\n", "0x0080: 699.999 最大功率限值存储值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 80 00 02 04 AE 60 00 0A 5B 3E 40 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 80 00 02 40 20 7F 16\n", "Write Result: \n", "0x0080:\t700\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 80 00 02 C5 E3 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 AE 60 00 0A 5A C2 C9 16\n", "Parse Result:\n", "0x0080: 700.0 最大功率限值存储值\n" ] } ], "source": [ "addr, dlen = 0x80, 2\n", "vmin, vmax, vacc = 100, 800, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 700-vacc, 700]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 D8 EF 83 AF 78 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t-100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 09 C4 BF 87 A4 16\n", "Parse Result:\n", "0x0085: 25.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 D8 F0 C2 67 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t-100\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 09 C4 BF 87 A4 16\n", "Parse Result:\n", "0x0085: 25.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 D8 F1 03 A7 F2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t-99.99\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 09 C4 BF 87 A4 16\n", "Parse Result:\n", "0x0085: 25.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 0F C3 D7 4F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 27 0F C3 D7 E8 16\n", "Write Result: \n", "0x0085:\t99.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0085: 99.99 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 10 82 1F 57 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 27 10 82 1F F0 16\n", "Write Result: \n", "0x0085:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0085: 100.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 11 43 DF D9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0085: 100.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 FF 9C D9 BA AD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 FF 9C D9 BA 46 16\n", "Write Result: \n", "0x0085:\t-1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF 9C F9 DD 02 16\n", "Parse Result:\n", "0x0085: -1.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 11 6F D4 5F 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 11 6F D4 5F CB 16\n", "Write Result: \n", "0x0085:\t699.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 6F F4 38 3D 16\n", "Parse Result:\n", "0x0085: 44.63 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 11 70 95 97 2C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 11 70 95 97 C5 16\n", "Write Result: \n", "0x0085:\t700\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 70 B5 F0 B7 16\n", "Parse Result:\n", "0x0085: 44.64 电压环out_max\n" ] } ], "source": [ "addr, dlen = 0x85, 1\n", "vmin, vmax, vacc = -100, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 700-vacc, 700]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 04 55 E0 B5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 0D 01 03 08 00 00 FE D4 00 64 00 00 F1 C4 88 16\n", "Parse Result:\n", "0x0085: 0.0 电压环out_max\n", "0x0086: -3.0 电压环out_min\n", "0x0087: 1.0 电流环out_max\n", "0x0088: 0.0 电流环out_min\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dev_lamina.frame_read(0x85, 0x04)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 FE 0B 99 84 A5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t-5.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF 38 F8 66 26 16\n", "Parse Result:\n", "0x0085: -2.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 FE 0C D8 46 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t-5\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF 38 F8 66 26 16\n", "Parse Result:\n", "0x0085: -2.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 FE 0D 19 86 29 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 FE 0D 19 86 C2 16\n", "Write Result: \n", "0x0085:\t-4.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FE 0D 39 E1 B6 16\n", "Parse Result:\n", "0x0085: -4.99 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 0F C3 D7 4F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 27 0F C3 D7 E8 16\n", "Write Result: \n", "0x0085:\t99.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0085: 99.99 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 10 82 1F 57 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 27 10 82 1F F0 16\n", "Write Result: \n", "0x0085:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0085: 100.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 11 43 DF D9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0085: 100.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 FF 9C D9 BA AD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 FF 9C D9 BA 46 16\n", "Write Result: \n", "0x0085:\t-1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF 9C F9 DD 02 16\n", "Parse Result:\n", "0x0085: -1.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 11 6F D4 5F 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 11 6F D4 5F CB 16\n", "Write Result: \n", "0x0085:\t699.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 6F F4 38 3D 16\n", "Parse Result:\n", "0x0085: 44.63 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 11 70 95 97 2C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 11 70 95 97 C5 16\n", "Write Result: \n", "0x0085:\t700\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 70 B5 F0 B7 16\n", "Parse Result:\n", "0x0085: 44.64 电压环out_max\n" ] } ], "source": [ "addr, dlen = 0x85, 1\n", "vmin, vmax, vacc = -5, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc, -1, 700-vacc, 700]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 FE 0B 99 84 A5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t-5.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 70 B5 F0 B7 16\n", "Parse Result:\n", "0x0085: 44.64 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 FE 0C D8 46 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t-5\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 70 B5 F0 B7 16\n", "Parse Result:\n", "0x0085: 44.64 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 FE 0D 19 86 29 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 FE 0D 19 86 C2 16\n", "Write Result: \n", "0x0085:\t-4.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FE 0D 39 E1 B6 16\n", "Parse Result:\n", "0x0085: -4.99 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 0F C3 D7 4F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 27 0F C3 D7 E8 16\n", "Write Result: \n", "0x0085:\t99.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0085: 99.99 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 10 82 1F 57 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 85 27 10 82 1F F0 16\n", "Write Result: \n", "0x0085:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0085: 100.0 电压环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 85 27 11 43 DF D9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0085:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 85 00 01 95 E3 F5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0085: 100.0 电压环out_max\n" ] } ], "source": [ "addr, dlen = 0x85, 1\n", "vmin, vmax, vacc = -5, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 86 D8 EF 73 AF 69 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0086:\t-100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 86 00 01 65 E3 C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FE 0C F8 21 B4 16\n", "Parse Result:\n", "0x0086: -5.0 电压环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 86 D8 F0 32 67 E1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 86 D8 F0 32 67 7A 16\n", "Write Result: \n", "0x0086:\t-100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 86 00 01 65 E3 C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F0 E2 00 3B 16\n", "Parse Result:\n", "0x0086: -100.0 电压环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 86 D8 F1 F3 A7 E3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 86 D8 F1 F3 A7 7C 16\n", "Write Result: \n", "0x0086:\t-99.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 86 00 01 65 E3 C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F1 23 C0 3D 16\n", "Parse Result:\n", "0x0086: -99.99 电压环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 86 27 0F 33 D7 C0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 86 27 0F 33 D7 59 16\n", "Write Result: \n", "0x0086:\t99.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 86 00 01 65 E3 C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0086: 99.99 电压环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 86 27 10 72 1F 48 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0086:\t100\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 86 00 01 65 E3 C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0086: 99.99 电压环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 86 27 11 B3 DF 4A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0086:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 86 00 01 65 E3 C6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0086: 99.99 电压环out_min\n" ] } ], "source": [ "addr, dlen = 0x86, 1\n", "vmin, vmax, vacc = -100, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 87 FF FF 38 53 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0087:\t-0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 87 00 01 34 23 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x0087: 1.0 电流环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 87 00 00 39 E3 9D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0087:\t0\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 87 00 01 34 23 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x0087: 1.0 电流环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 87 00 01 F8 23 9D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 87 00 01 F8 23 36 16\n", "Write Result: \n", "0x0087:\t0.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 87 00 01 34 23 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0087: 0.01 电流环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 87 27 0F 62 17 30 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 87 27 0F 62 17 C9 16\n", "Write Result: \n", "0x0087:\t99.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 87 00 01 34 23 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0087: 99.99 电流环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 87 27 10 23 DF BA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 87 27 10 23 DF 53 16\n", "Write Result: \n", "0x0087:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 87 00 01 34 23 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0087: 100.0 电流环out_max\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 87 27 11 E2 1F BA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0087:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 87 00 01 34 23 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0087: 100.0 电流环out_max\n" ] } ], "source": [ "addr, dlen = 0x87, 1\n", "vmin, vmax, vacc = 0, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 88 D8 EF 12 6C C7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0088:\t-100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 88 00 01 04 20 A4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0088: 0.0 电流环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 88 D8 F0 53 A4 41 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 88 D8 F0 53 A4 DA 16\n", "Write Result: \n", "0x0088:\t-100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 88 00 01 04 20 A4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F0 E2 00 3B 16\n", "Parse Result:\n", "0x0088: -100.0 电流环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 88 D8 F1 92 64 41 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 88 D8 F1 92 64 DA 16\n", "Write Result: \n", "0x0088:\t-99.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 88 00 01 04 20 A4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F1 23 C0 3D 16\n", "Parse Result:\n", "0x0088: -99.99 电流环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 88 27 0F 52 14 1E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 88 27 0F 52 14 B7 16\n", "Write Result: \n", "0x0088:\t99.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 88 00 01 04 20 A4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0088: 99.99 电流环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 88 27 10 13 DC A8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0088:\t100\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 88 00 01 04 20 A4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0088: 99.99 电流环out_min\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 88 27 11 D2 1C A8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0088:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 88 00 01 04 20 A4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0088: 99.99 电流环out_min\n" ] } ], "source": [ "addr, dlen = 0x88, 1\n", "vmin, vmax, vacc = -100, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 89 FF FF 59 90 6A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0089:\t-0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 89 00 01 55 E0 B6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 64 B9 AF 5D 16\n", "Parse Result:\n", "0x0089: 1.0 MPPT扰动系数k_d_vin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 89 00 00 58 20 FB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 89 00 00 58 20 94 16\n", "Write Result: \n", "0x0089:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 89 00 01 55 E0 B6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0089: 0.0 MPPT扰动系数k_d_vin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 89 00 01 99 E0 FD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 89 00 01 99 E0 96 16\n", "Write Result: \n", "0x0089:\t0.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 89 00 01 55 E0 B6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0089: 0.01 MPPT扰动系数k_d_vin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 89 00 C7 19 B2 15 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 89 00 C7 19 B2 AE 16\n", "Write Result: \n", "0x0089:\t1.99\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 89 00 01 55 E0 B6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C7 F9 D6 27 16\n", "Parse Result:\n", "0x0089: 1.99 MPPT扰动系数k_d_vin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 89 00 C8 59 B6 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 89 00 C8 59 B6 F3 16\n", "Write Result: \n", "0x0089:\t2\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 89 00 01 55 E0 B6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0089: 2.0 MPPT扰动系数k_d_vin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 89 00 C8 59 B6 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 89 00 C8 59 B6 F3 16\n", "Write Result: \n", "0x0089:\t2.01\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 89 00 01 55 E0 B6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 C8 B9 D2 E4 16\n", "Parse Result:\n", "0x0089: 2.0 MPPT扰动系数k_d_vin\n" ] } ], "source": [ "addr, dlen = 0x89, 1\n", "vmin, vmax, vacc = 0, 2, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A FF FF A9 90 BB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008a:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 0D 79 81 98 16\n", "Parse Result:\n", "0x008A: 0.013 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 00 00 A8 20 4C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8A 00 00 A8 20 E5 16\n", "Write Result: \n", "0x008a:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x008A: 0.0 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 00 01 69 E0 CE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8A 00 01 69 E0 67 16\n", "Write Result: \n", "0x008a:\t0.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x008A: 0.001 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 03 E7 E8 9A F0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008a:\t0.999\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x008A: 0.001 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 03 E8 A8 9E B5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008a:\t1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x008A: 0.001 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 03 E8 A8 9E B5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008a:\t1.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x008A: 0.001 dmin\n" ] } ], "source": [ "addr, dlen = 0x8A, 1\n", "vmin, vmax, vacc = 0, 1, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 02 E5 E1 49 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 03 96 2B 6D C7 16\n", "Parse Result:\n", "0x008A: 0.001 dmin\n", "0x008B: 0.918 dmax\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dev_lamina.frame_read(0x8A, 2)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A FF FF A9 90 BB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008a:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 0A 38 43 16 16\n", "Parse Result:\n", "0x008A: 0.01 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 00 00 A8 20 4C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8A 00 00 A8 20 E5 16\n", "Write Result: \n", "0x008a:\t0\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x008A: 0.0 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 00 01 69 E0 CE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8A 00 01 69 E0 67 16\n", "Write Result: \n", "0x008a:\t0.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x008A: 0.001 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 03 E7 E8 9A F0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8A 03 E7 E8 9A 89 16\n", "Write Result: \n", "0x008a:\t0.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E7 F8 FE 71 16\n", "Parse Result:\n", "0x008A: 0.999 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 03 E8 A8 9E B5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008a:\t1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E7 F8 FE 71 16\n", "Parse Result:\n", "0x008A: 0.999 dmin\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 03 E8 A8 9E B5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008a:\t1.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E7 F8 FE 71 16\n", "Parse Result:\n", "0x008A: 0.999 dmin\n" ] } ], "source": [ "addr, dlen = 0x8A, 1\n", "vmin, vmax, vacc = 0, 1, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8A 00 0A 28 27 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8A 00 0A 28 27 76 16\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8A 00 01 A5 E0 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 0A 38 43 16 16\n", "Parse Result:\n", "0x008A: 0.01 dmin\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dev_lamina.frame_write_one(0x8A, 0.01)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x8A, 1)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8B 00 09 39 E6 AD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008b:\t0.009000000000000001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8B 00 01 F4 20 97 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 96 38 DA 3C 16\n", "Parse Result:\n", "0x008B: 0.918 dmax\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8B 00 0A 79 E7 EF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008b:\t0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8B 00 01 F4 20 97 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 96 38 DA 3C 16\n", "Parse Result:\n", "0x008B: 0.918 dmax\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8B 00 0B B8 27 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8B 00 0B B8 27 08 16\n", "Write Result: \n", "0x008b:\t0.011\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8B 00 01 F4 20 97 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 0B F9 83 18 16\n", "Parse Result:\n", "0x008B: 0.011 dmax\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8B 03 E7 B9 5A 82 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8B 03 E7 B9 5A 1B 16\n", "Write Result: \n", "0x008b:\t0.999\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8B 00 01 F4 20 97 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E7 F8 FE 71 16\n", "Parse Result:\n", "0x008B: 0.999 dmax\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8B 03 E8 F9 5E C7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8B 03 E8 F9 5E 60 16\n", "Write Result: \n", "0x008b:\t1\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8B 00 01 F4 20 97 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x008B: 1.0 dmax\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8B 03 E8 F9 5E C7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8B 03 E8 F9 5E 60 16\n", "Write Result: \n", "0x008b:\t1.001\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8B 00 01 F4 20 97 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x008B: 1.0 dmax\n" ] } ], "source": [ "addr, dlen = 0x8B, 1\n", "vmin, vmax, vacc = 0.01, 1, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8C FC 17 49 2F 11 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008c:\t-100.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8C 00 01 45 E1 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 96 38 2A 89 16\n", "Parse Result:\n", "0x008C: 15.0 扫描电压偏移scanvolt_offset\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8C FC 18 09 2B CE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8C FC 18 09 2B 67 16\n", "Write Result: \n", "0x008c:\t-100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8C 00 01 45 E1 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FC 18 F9 4E EC 16\n", "Parse Result:\n", "0x008C: -100.0 扫描电压偏移scanvolt_offset\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8C FC 19 C8 EB 4E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8C FC 19 C8 EB E7 16\n", "Write Result: \n", "0x008c:\t-99.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8C 00 01 45 E1 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FC 19 38 8E 6C 16\n", "Parse Result:\n", "0x008C: -99.9 扫描电压偏移scanvolt_offset\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8C 03 E7 08 9B 13 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8C 03 E7 08 9B AC 16\n", "Write Result: \n", "0x008c:\t99.9\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8C 00 01 45 E1 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E7 F8 FE 71 16\n", "Parse Result:\n", "0x008C: 99.9 扫描电压偏移scanvolt_offset\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8C 03 E8 48 9F 58 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 8C 03 E8 48 9F F1 16\n", "Write Result: \n", "0x008c:\t100\tSeccusss.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8C 00 01 45 E1 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x008C: 100.0 扫描电压偏移scanvolt_offset\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 8C 03 E9 89 5F 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x008c:\t100.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8C 00 01 45 E1 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x008C: 100.0 扫描电压偏移scanvolt_offset\n" ] } ], "source": [ "addr, dlen = 0x8C, 1\n", "vmin, vmax, vacc = -100, 100, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Seccusss' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8D 00 02 04 FF FF FF FF 3B C2 95 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x008d:\t-1e-05\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8D 00 02 54 20 FA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 C3 50 00 00 C6 66 D4 16\n", "Parse Result:\n", "0x008D: 0.5 电压环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8D 00 02 04 00 00 00 00 3A 56 2C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 8D 00 02 D1 E3 E0 16\n", "Write Result: \n", "0x008d:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8D 00 02 54 20 FA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 00 00 FA 33 C2 16\n", "Parse Result:\n", "0x008D: 0.0 电压环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8D 00 02 04 00 01 00 00 6B 96 9E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 8D 00 02 D1 E3 E0 16\n", "Write Result: \n", "0x008d:\t1e-05\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8D 00 02 54 20 FA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x008D: 1e-05 电压环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8D 00 02 04 0D 3F 00 03 48 F7 2A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 8D 00 02 D1 E3 E0 16\n", "Write Result: \n", "0x008d:\t1.99999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8D 00 02 54 20 FA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 3F 00 03 88 92 FE 16\n", "Parse Result:\n", "0x008D: 1.99999 电压环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8D 00 02 04 0D 40 00 03 79 2F 94 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 8D 00 02 D1 E3 E0 16\n", "Write Result: \n", "0x008d:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8D 00 02 54 20 FA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 40 00 03 B9 4A E8 16\n", "Parse Result:\n", "0x008D: 2.0 电压环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8D 00 02 04 0D 41 00 03 28 EF 04 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x008d:\t2.00001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8D 00 02 54 20 FA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 40 00 03 B9 4A E8 16\n", "Parse Result:\n", "0x008D: 2.0 电压环Kp\n" ] } ], "source": [ "addr, dlen = 0x8D, 2\n", "vmin, vmax, vacc = 0, 2, 0.00001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8F 00 02 04 FF FF FF FF BA 1B 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x008f:\t-1e-05\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8F 00 02 F5 E0 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 C8 00 00 7B CD A5 16\n", "Parse Result:\n", "0x008F: 0.002 电压环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8F 00 02 04 00 00 00 00 BB 8F E8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 8F 00 02 70 23 C1 16\n", "Write Result: \n", "0x008f:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8F 00 02 F5 E0 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 00 00 FA 33 C2 16\n", "Parse Result:\n", "0x008F: 0.0 电压环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8F 00 02 04 00 01 00 00 EA 4F D8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 8F 00 02 70 23 C1 16\n", "Write Result: \n", "0x008f:\t1e-05\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8F 00 02 F5 E0 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x008F: 1e-05 电压环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8F 00 02 04 0D 3F 00 03 C9 2E E4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 8F 00 02 70 23 C1 16\n", "Write Result: \n", "0x008f:\t1.99999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8F 00 02 F5 E0 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 3F 00 03 88 92 FE 16\n", "Parse Result:\n", "0x008F: 1.99999 电压环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8F 00 02 04 0D 40 00 03 F8 F6 DC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 8F 00 02 70 23 C1 16\n", "Write Result: \n", "0x008f:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8F 00 02 F5 E0 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 40 00 03 B9 4A E8 16\n", "Parse Result:\n", "0x008F: 2.0 电压环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 8F 00 02 04 0D 41 00 03 A9 36 CE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x008f:\t2.00001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 8F 00 02 F5 E0 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 40 00 03 B9 4A E8 16\n", "Parse Result:\n", "0x008F: 2.0 电压环Ki\n" ] } ], "source": [ "addr, dlen = 0x8F, 2\n", "vmin, vmax, vacc = 0, 2, 0.00001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 91 00 02 04 FF FF FF FF 3A 9B 71 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0091:\t-1e-05\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 91 00 02 95 E6 05 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 FA 00 00 DA 02 6B 16\n", "Parse Result:\n", "0x0091: 0.0025 电流环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 91 00 02 04 00 00 00 00 3B 0F EA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 91 00 02 10 25 65 16\n", "Write Result: \n", "0x0091:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 91 00 02 95 E6 05 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 00 00 FA 33 C2 16\n", "Parse Result:\n", "0x0091: 0.0 电流环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 91 00 02 04 00 01 00 00 6A CF DA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 91 00 02 10 25 65 16\n", "Write Result: \n", "0x0091:\t1e-05\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 91 00 02 95 E6 05 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x0091: 1e-05 电流环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 91 00 02 04 0D 3F 00 03 49 AE E6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 91 00 02 10 25 65 16\n", "Write Result: \n", "0x0091:\t1.99999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 91 00 02 95 E6 05 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 3F 00 03 88 92 FE 16\n", "Parse Result:\n", "0x0091: 1.99999 电流环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 91 00 02 04 0D 40 00 03 78 76 DE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 91 00 02 10 25 65 16\n", "Write Result: \n", "0x0091:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 91 00 02 95 E6 05 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 40 00 03 B9 4A E8 16\n", "Parse Result:\n", "0x0091: 2.0 电流环Kp\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 91 00 02 04 0D 41 00 03 29 B6 D0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0091:\t2.00001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 91 00 02 95 E6 05 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 40 00 03 B9 4A E8 16\n", "Parse Result:\n", "0x0091: 2.0 电流环Kp\n" ] } ], "source": [ "addr, dlen = 0x91, 2\n", "vmin, vmax, vacc = 0, 2, 0.00001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 93 00 02 04 FF FF FF FF BB 42 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0093:\t-1e-05\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 93 00 02 34 26 E6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 14 00 00 BA 37 9A 16\n", "Parse Result:\n", "0x0093: 0.0002 电流环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 93 00 02 04 00 00 00 00 BA D6 32 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 93 00 02 B1 E5 C8 16\n", "Write Result: \n", "0x0093:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 93 00 02 34 26 E6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 00 00 FA 33 C2 16\n", "Parse Result:\n", "0x0093: 0.0 电流环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 93 00 02 04 00 01 00 00 EB 16 A4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 93 00 02 B1 E5 C8 16\n", "Write Result: \n", "0x0093:\t1e-05\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 93 00 02 34 26 E6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x0093: 1e-05 电流环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 93 00 02 04 0D 3F 00 03 C8 77 30 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 93 00 02 B1 E5 C8 16\n", "Write Result: \n", "0x0093:\t1.99999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 93 00 02 34 26 E6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 3F 00 03 88 92 FE 16\n", "Parse Result:\n", "0x0093: 1.99999 电流环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 93 00 02 04 0D 40 00 03 F9 AF 9A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 93 00 02 B1 E5 C8 16\n", "Write Result: \n", "0x0093:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 93 00 02 34 26 E6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 40 00 03 B9 4A E8 16\n", "Parse Result:\n", "0x0093: 2.0 电流环Ki\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 93 00 02 04 0D 41 00 03 A8 6F 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0093:\t2.00001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 93 00 02 34 26 E6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 0D 40 00 03 B9 4A E8 16\n", "Parse Result:\n", "0x0093: 2.0 电流环Ki\n" ] } ], "source": [ "addr, dlen = 0x93, 2\n", "vmin, vmax, vacc = 0, 2, 0.00001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 95 FF FF 98 56 7B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0095:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 95 00 02 D4 27 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 05 00 00 EA 32 B6 16\n", "Parse Result:\n", "0x0095: 0x0005 日志级别 \n", "0x0096: 0x0000 日志输出方式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 95 00 00 99 E6 0E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 95 00 00 99 E6 A7 16\n", "Write Result: \n", "0x0095:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 95 00 02 D4 27 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 00 00 FA 33 C2 16\n", "Parse Result:\n", "0x0095: 0x0000 日志级别 \n", "0x0096: 0x0000 日志输出方式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 95 00 01 58 26 0E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 95 00 01 58 26 A7 16\n", "Write Result: \n", "0x0095:\t1\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 95 00 02 D4 27 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 00 00 AB F3 34 16\n", "Parse Result:\n", "0x0095: 0x0001 日志级别 \n", "0x0096: 0x0000 日志输出方式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 95 00 04 98 25 50 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 95 00 04 98 25 E9 16\n", "Write Result: \n", "0x0095:\t4\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 95 00 02 D4 27 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 04 00 00 BB F2 46 16\n", "Parse Result:\n", "0x0095: 0x0004 日志级别 \n", "0x0096: 0x0000 日志输出方式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 95 00 05 59 E5 D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 95 00 05 59 E5 6B 16\n", "Write Result: \n", "0x0095:\t5\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 95 00 02 D4 27 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 05 00 00 EA 32 B6 16\n", "Parse Result:\n", "0x0095: 0x0005 日志级别 \n", "0x0096: 0x0000 日志输出方式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 95 00 06 19 E4 92 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0095:\t6\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 95 00 02 D4 27 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 05 00 00 EA 32 B6 16\n", "Parse Result:\n", "0x0095: 0x0005 日志级别 \n", "0x0096: 0x0000 日志输出方式\n" ] } ], "source": [ "addr, dlen = 0x95, 2\n", "vmin, vmax, vacc = 0, 5, 1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "vscode": { "languageId": "ini" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 96 FF FF 68 56 4C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0096:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 96 00 02 24 27 DA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 03 E8 FA 8D 07 16\n", "Parse Result:\n", "0x0096: 0x0000 日志输出方式 \n", "0x0097: 1.0 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 96 00 00 69 E6 DF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 96 00 00 69 E6 78 16\n", "Write Result: \n", "0x0096:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 96 00 02 24 27 DA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 00 03 E8 FA 8D 07 16\n", "Parse Result:\n", "0x0096: 0x0000 日志输出方式 \n", "0x0097: 1.0 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 96 00 01 A8 26 5F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 96 00 01 A8 26 F8 16\n", "Write Result: \n", "0x0096:\t1\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 96 00 02 24 27 DA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 01 03 E8 AB 4D 79 16\n", "Parse Result:\n", "0x0096: 0x0001 日志输出方式 \n", "0x0097: 1.0 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 96 00 05 A9 E5 23 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 96 00 05 A9 E5 BC 16\n", "Write Result: \n", "0x0096:\t5\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 96 00 02 24 27 DA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 00 05 03 E8 EA 8C FB 16\n", "Parse Result:\n", "0x0096: 0x0005 日志输出方式 \n", "0x0097: 1.0 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 96 00 06 E9 E4 63 16\n", "Error Info: No frame data\n", "Write Result: \n", "0x0096:\t6\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 96 00 02 24 27 DA 16\n", "Error Info: No frame data\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 96 00 07 28 24 E3 16\n", "Error Info: No frame data\n", "Write Result: \n", "0x0096:\t7\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 96 00 02 24 27 DA 16\n", "Error Info: No frame data\n" ] } ], "source": [ "# 日志输出方式测试: 可能会导致调试信息输出到串口,从而影响串口通信\n", "addr, dlen = 0x96, 2\n", "vmin, vmax, vacc = 0, 6, 1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 97 FF FF 39 96 5E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0097:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 97 00 01 35 E6 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x0097: 1.0 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 97 00 00 38 26 EF 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 97 00 00 38 26 88 16\n", "Write Result: \n", "0x0097:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 97 00 01 35 E6 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0097: 0.0 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 97 00 01 F9 E6 71 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 97 00 01 F9 E6 0A 16\n", "Write Result: \n", "0x0097:\t0.001\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 97 00 01 35 E6 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0097: 0.001 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 97 07 CF 7A 42 23 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 97 07 CF 7A 42 BC 16\n", "Write Result: \n", "0x0097:\t1.999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 97 00 01 35 E6 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 CF FA 20 81 16\n", "Parse Result:\n", "0x0097: 1.999 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 97 07 D0 3B 8A 2D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 97 07 D0 3B 8A C6 16\n", "Write Result: \n", "0x0097:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 97 00 01 35 E6 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x0097: 2.0 采样校准volt_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 97 07 D1 FA 4A AD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0097:\t2.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 97 00 01 35 E6 AA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x0097: 2.0 采样校准volt_in_a\n" ] } ], "source": [ "addr, dlen = 0x97, 1\n", "vmin, vmax, vacc = 0, 2, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 98 D8 EF 13 A9 15 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0098:\t-100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 98 00 01 05 E5 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0098: 0.0 采样校准volt_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 98 D8 F0 52 61 0D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 98 D8 F0 52 61 A6 16\n", "Write Result: \n", "0x0098:\t-100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 98 00 01 05 E5 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F0 E2 00 3B 16\n", "Parse Result:\n", "0x0098: -100.0 采样校准volt_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 98 D8 F1 93 A1 8F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 98 D8 F1 93 A1 28 16\n", "Write Result: \n", "0x0098:\t-99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 98 00 01 05 E5 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F1 23 C0 3D 16\n", "Parse Result:\n", "0x0098: -99.99 采样校准volt_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 98 27 0F 53 D1 EC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 98 27 0F 53 D1 85 16\n", "Write Result: \n", "0x0098:\t99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 98 00 01 05 E5 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x0098: 99.99 采样校准volt_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 98 27 10 12 19 F4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 98 27 10 12 19 8D 16\n", "Write Result: \n", "0x0098:\t100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 98 00 01 05 E5 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0098: 100.0 采样校准volt_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 98 27 11 D3 D9 76 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0098:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 98 00 01 05 E5 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x0098: 100.0 采样校准volt_in_b\n" ] } ], "source": [ "addr, dlen = 0x98, 1\n", "vmin, vmax, vacc = -100, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 99 FF FF 58 55 3E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0099:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 99 00 01 54 25 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x0099: 1.0 采样校准volt_out_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 99 00 00 59 E5 D1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 99 00 00 59 E5 6A 16\n", "Write Result: \n", "0x0099:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 99 00 01 54 25 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x0099: 0.0 采样校准volt_out_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 99 00 01 98 25 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 99 00 01 98 25 EA 16\n", "Write Result: \n", "0x0099:\t0.001\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 99 00 01 54 25 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x0099: 0.001 采样校准volt_out_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 99 07 CF 1B 81 05 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 99 07 CF 1B 81 9E 16\n", "Write Result: \n", "0x0099:\t1.999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 99 00 01 54 25 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 CF FA 20 81 16\n", "Parse Result:\n", "0x0099: 1.999 采样校准volt_out_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 99 07 D0 5A 49 0D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 99 07 D0 5A 49 A6 16\n", "Write Result: \n", "0x0099:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 99 00 01 54 25 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x0099: 2.0 采样校准volt_out_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 99 07 D1 9B 89 8F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x0099:\t2.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 99 00 01 54 25 0A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x0099: 2.0 采样校准volt_out_a\n" ] } ], "source": [ "addr, dlen = 0x99, 1\n", "vmin, vmax, vacc = 0, 2, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9A D8 EF B2 69 76 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009a:\t-100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9A 00 01 A4 25 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x009A: 0.0 采样校准volt_out_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9A D8 F0 F3 A1 F0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9A D8 F0 F3 A1 89 16\n", "Write Result: \n", "0x009a:\t-100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9A 00 01 A4 25 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F0 E2 00 3B 16\n", "Parse Result:\n", "0x009A: -100.0 采样校准volt_out_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9A D8 F1 32 61 F0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9A D8 F1 32 61 89 16\n", "Write Result: \n", "0x009a:\t-99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9A 00 01 A4 25 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F1 23 C0 3D 16\n", "Parse Result:\n", "0x009A: -99.99 采样校准volt_out_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9A 27 0F F2 11 CD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9A 27 0F F2 11 66 16\n", "Write Result: \n", "0x009a:\t99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9A 00 01 A4 25 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x009A: 99.99 采样校准volt_out_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9A 27 10 B3 D9 57 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9A 27 10 B3 D9 F0 16\n", "Write Result: \n", "0x009a:\t100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9A 00 01 A4 25 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x009A: 100.0 采样校准volt_out_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9A 27 11 72 19 57 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009a:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9A 00 01 A4 25 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x009A: 100.0 采样校准volt_out_b\n" ] } ], "source": [ "addr, dlen = 0x9A, 1\n", "vmin, vmax, vacc = -100, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9B FF FF F9 95 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009b:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9B 00 01 F5 E5 6D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x009B: 1.0 采样校准curr_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9B 00 00 F8 25 B2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9B 00 00 F8 25 4B 16\n", "Write Result: \n", "0x009b:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9B 00 01 F5 E5 6D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x009B: 0.0 采样校准curr_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9B 00 01 39 E5 B4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9B 00 01 39 E5 4D 16\n", "Write Result: \n", "0x009b:\t0.001\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9B 00 01 F5 E5 6D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x009B: 0.001 采样校准curr_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9B 07 CF BA 41 66 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9B 07 CF BA 41 FF 16\n", "Write Result: \n", "0x009b:\t1.999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9B 00 01 F5 E5 6D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 CF FA 20 81 16\n", "Parse Result:\n", "0x009B: 1.999 采样校准curr_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9B 07 D0 FB 89 F0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9B 07 D0 FB 89 89 16\n", "Write Result: \n", "0x009b:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9B 00 01 F5 E5 6D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x009B: 2.0 采样校准curr_in_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9B 07 D1 3A 49 F0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009b:\t2.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9B 00 01 F5 E5 6D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x009B: 2.0 采样校准curr_in_a\n" ] } ], "source": [ "addr, dlen = 0x9B, 1\n", "vmin, vmax, vacc = 0, 2, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9C D8 EF 52 68 17 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009c:\t-100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9C 00 01 44 24 FC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x009C: 0.0 采样校准curr_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9C D8 F0 13 A0 11 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9C D8 F0 13 A0 AA 16\n", "Write Result: \n", "0x009c:\t-100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9C 00 01 44 24 FC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F0 E2 00 3B 16\n", "Parse Result:\n", "0x009C: -100.0 采样校准curr_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9C D8 F1 D2 60 91 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9C D8 F1 D2 60 2A 16\n", "Write Result: \n", "0x009c:\t-99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9C 00 01 44 24 FC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F1 23 C0 3D 16\n", "Parse Result:\n", "0x009C: -99.99 采样校准curr_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9C 27 0F 12 10 EE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9C 27 0F 12 10 87 16\n", "Write Result: \n", "0x009c:\t99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9C 00 01 44 24 FC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x009C: 99.99 采样校准curr_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9C 27 10 53 D8 F8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9C 27 10 53 D8 91 16\n", "Write Result: \n", "0x009c:\t100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9C 00 01 44 24 FC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x009C: 100.0 采样校准curr_in_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9C 27 11 92 18 78 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009c:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9C 00 01 44 24 FC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x009C: 100.0 采样校准curr_in_b\n" ] } ], "source": [ "addr, dlen = 0x9C, 1\n", "vmin, vmax, vacc = -100, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9D FF FF 19 94 42 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009d:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9D 00 01 15 E4 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x009D: 1.0 采样校准curr_induc_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9D 00 00 18 24 D3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9D 00 00 18 24 6C 16\n", "Write Result: \n", "0x009d:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9D 00 01 15 E4 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x009D: 0.0 采样校准curr_induc_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9D 00 01 D9 E4 55 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9D 00 01 D9 E4 EE 16\n", "Write Result: \n", "0x009d:\t0.001\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9D 00 01 15 E4 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x009D: 0.001 采样校准curr_induc_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9D 07 CF 5A 40 07 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9D 07 CF 5A 40 A0 16\n", "Write Result: \n", "0x009d:\t1.999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9D 00 01 15 E4 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 CF FA 20 81 16\n", "Parse Result:\n", "0x009D: 1.999 采样校准curr_induc_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9D 07 D0 1B 88 11 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9D 07 D0 1B 88 AA 16\n", "Write Result: \n", "0x009d:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9D 00 01 15 E4 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x009D: 2.0 采样校准curr_induc_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9D 07 D1 DA 48 91 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009d:\t2.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9D 00 01 15 E4 8E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x009D: 2.0 采样校准curr_induc_a\n" ] } ], "source": [ "addr, dlen = 0x9D, 1\n", "vmin, vmax, vacc = 0, 2, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9E D8 EF F3 A8 FA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009e:\t-100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9E 00 01 E5 E4 5F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x009E: 0.0 采样校准curr_induc_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9E D8 F0 B2 60 72 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9E D8 F0 B2 60 0B 16\n", "Write Result: \n", "0x009e:\t-100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9E 00 01 E5 E4 5F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F0 E2 00 3B 16\n", "Parse Result:\n", "0x009E: -100.0 采样校准curr_induc_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9E D8 F1 73 A0 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9E D8 F1 73 A0 0D 16\n", "Write Result: \n", "0x009e:\t-99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9E 00 01 E5 E4 5F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F1 23 C0 3D 16\n", "Parse Result:\n", "0x009E: -99.99 采样校准curr_induc_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9E 27 0F B3 D0 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9E 27 0F B3 D0 EA 16\n", "Write Result: \n", "0x009e:\t99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9E 00 01 E5 E4 5F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x009E: 99.99 采样校准curr_induc_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9E 27 10 F2 18 D9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9E 27 10 F2 18 72 16\n", "Write Result: \n", "0x009e:\t100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9E 00 01 E5 E4 5F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x009E: 100.0 采样校准curr_induc_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9E 27 11 33 D8 DB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009e:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9E 00 01 E5 E4 5F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x009E: 100.0 采样校准curr_induc_b\n" ] } ], "source": [ "addr, dlen = 0x9E, 1\n", "vmin, vmax, vacc = -100, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9F FF FF B8 54 A3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009f:\t-0.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9F 00 01 B4 24 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x009F: 1.0 采样校准volt_12V_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9F 00 00 B9 E4 36 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9F 00 00 B9 E4 CF 16\n", "Write Result: \n", "0x009f:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9F 00 01 B4 24 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x009F: 0.0 采样校准volt_12V_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9F 00 01 78 24 36 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9F 00 01 78 24 CF 16\n", "Write Result: \n", "0x009f:\t0.001\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9F 00 01 B4 24 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x009F: 0.001 采样校准volt_12V_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9F 07 CF FB 80 EA 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9F 07 CF FB 80 83 16\n", "Write Result: \n", "0x009f:\t1.999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9F 00 01 B4 24 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 CF FA 20 81 16\n", "Parse Result:\n", "0x009F: 1.999 采样校准volt_12V_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9F 07 D0 BA 48 72 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 9F 07 D0 BA 48 0B 16\n", "Write Result: \n", "0x009f:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9F 00 01 B4 24 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x009F: 2.0 采样校准volt_12V_a\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 9F 07 D1 7B 88 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x009f:\t2.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 9F 00 01 B4 24 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 07 D0 BB E8 0B 16\n", "Parse Result:\n", "0x009F: 2.0 采样校准volt_12V_a\n" ] } ], "source": [ "addr, dlen = 0x9F, 1\n", "vmin, vmax, vacc = 0, 2, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A0 D8 EF 92 64 57 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a0:\t-100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A0 00 01 84 28 44 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A0: 0.0 采样校准volt_12V_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A0 D8 F0 D3 AC E1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A0 D8 F0 D3 AC 7A 16\n", "Write Result: \n", "0x00a0:\t-100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A0 00 01 84 28 44 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F0 E2 00 3B 16\n", "Parse Result:\n", "0x00A0: -100.0 采样校准volt_12V_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A0 D8 F1 12 6C E1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A0 D8 F1 12 6C 7A 16\n", "Write Result: \n", "0x00a0:\t-99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A0 00 01 84 28 44 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 D8 F1 23 C0 3D 16\n", "Parse Result:\n", "0x00A0: -99.99 采样校准volt_12V_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A0 27 0F D2 1C BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A0 27 0F D2 1C 57 16\n", "Write Result: \n", "0x00a0:\t99.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A0 00 01 84 28 44 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 0F E3 B0 5A 16\n", "Parse Result:\n", "0x00A0: 99.99 采样校准volt_12V_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A0 27 10 93 D4 38 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A0 27 10 93 D4 D1 16\n", "Write Result: \n", "0x00a0:\t100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A0 00 01 84 28 44 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x00A0: 100.0 采样校准volt_12V_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A0 27 11 52 14 38 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a0:\t100.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A0 00 01 84 28 44 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 27 10 A2 78 E2 16\n", "Parse Result:\n", "0x00A0: 100.0 采样校准volt_12V_b\n" ] } ], "source": [ "addr, dlen = 0xA0, 1\n", "vmin, vmax, vacc = -100, 100, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A1 FE 0B D9 8F 0C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a1:\t-50.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A1 00 01 D5 E8 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A1: 0.0 温度补偿temp1_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A1 FE 0C 98 4D 8A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A1 FE 0C 98 4D 23 16\n", "Write Result: \n", "0x00a1:\t-50\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A1 00 01 D5 E8 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FE 0C F8 21 B4 16\n", "Parse Result:\n", "0x00A1: -50.0 温度补偿temp1_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A1 FE 0D 59 8D 8C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A1 FE 0D 59 8D 25 16\n", "Write Result: \n", "0x00a1:\t-49.9\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A1 00 01 D5 E8 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FE 0D 39 E1 B6 16\n", "Parse Result:\n", "0x00A1: -49.9 温度补偿temp1_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A1 01 F3 99 FD 25 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A1 01 F3 99 FD BE 16\n", "Write Result: \n", "0x00a1:\t49.9\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A1 00 01 D5 E8 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F3 F9 91 0F 16\n", "Parse Result:\n", "0x00A1: 49.9 温度补偿temp1_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A1 01 F4 D8 3F A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A1 01 F4 D8 3F 40 16\n", "Write Result: \n", "0x00a1:\t50\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A1 00 01 D5 E8 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x00A1: 50.0 温度补偿temp1_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A1 01 F5 19 FF A9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a1:\t50.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A1 00 01 D5 E8 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x00A1: 50.0 温度补偿temp1_b\n" ] } ], "source": [ "addr, dlen = 0xA1, 1\n", "vmin, vmax, vacc = -50, 50, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A2 FE 0B 29 8F 5D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a2:\t-50.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A2 00 01 25 E8 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A2: 0.0 温度补偿temp2_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A2 FE 0C 68 4D 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A2 FE 0C 68 4D F4 16\n", "Write Result: \n", "0x00a2:\t-50\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A2 00 01 25 E8 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FE 0C F8 21 B4 16\n", "Parse Result:\n", "0x00A2: -50.0 温度补偿temp2_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A2 FE 0D A9 8D DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A2 FE 0D A9 8D 76 16\n", "Write Result: \n", "0x00a2:\t-49.9\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A2 00 01 25 E8 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FE 0D 39 E1 B6 16\n", "Parse Result:\n", "0x00A2: -49.9 温度补偿temp2_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A2 01 F3 69 FD F6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A2 01 F3 69 FD 8F 16\n", "Write Result: \n", "0x00a2:\t49.9\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A2 00 01 25 E8 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F3 F9 91 0F 16\n", "Parse Result:\n", "0x00A2: 49.9 温度补偿temp2_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A2 01 F4 28 3F F8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A2 01 F4 28 3F 91 16\n", "Write Result: \n", "0x00a2:\t50\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A2 00 01 25 E8 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x00A2: 50.0 温度补偿temp2_b\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A2 01 F5 E9 FF 7A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a2:\t50.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A2 00 01 25 E8 A7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 01 F4 B8 53 91 16\n", "Parse Result:\n", "0x00A2: 50.0 温度补偿temp2_b\n" ] } ], "source": [ "addr, dlen = 0xA2, 1\n", "vmin, vmax, vacc = -50, 50, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A3 00 01 B8 28 7E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A3 00 01 B8 28 17 16\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A3 00 01 74 28 37 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x00A3: 1 系统工作模式\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 系统工作模式\n", "dev_lamina.frame_write_one(0xA3, 0x01)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0xA3, 1)" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A4 FF FF C9 99 FE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a4:\t-0.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A4 00 01 C5 E9 4A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x00A4: 10.0 电感电流给定值curr_set\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A4 00 00 C8 29 8F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A4 00 00 C8 29 28 16\n", "Write Result: \n", "0x00a4:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A4 00 01 C5 E9 4A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A4: 0.0 电感电流给定值curr_set\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A4 00 01 09 E9 91 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A4 00 01 09 E9 2A 16\n", "Write Result: \n", "0x00a4:\t0.01\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A4 00 01 C5 E9 4A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x00A4: 0.01 电感电流给定值curr_set\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A4 0B B7 8F 6F 5E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A4 0B B7 8F 6F F7 16\n", "Write Result: \n", "0x00a4:\t29.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A4 00 01 C5 E9 4A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 0B B7 FF 02 54 16\n", "Parse Result:\n", "0x00A4: 29.99 电感电流给定值curr_set\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A4 0B B8 CF 6B 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A4 0B B8 CF 6B 34 16\n", "Write Result: \n", "0x00a4:\t30\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A4 00 01 C5 E9 4A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 0B B8 BF 06 19 16\n", "Parse Result:\n", "0x00A4: 30.0 电感电流给定值curr_set\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A4 0B B9 0E AB 1B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a4:\t30.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A4 00 01 C5 E9 4A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 0B B8 BF 06 19 16\n", "Parse Result:\n", "0x00A4: 30.0 电感电流给定值curr_set\n" ] } ], "source": [ "addr, dlen = 0xA4, 1\n", "vmin, vmax, vacc = 0, 30, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A5 00 02 D4 28 9A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 A4 2D B4 AB 97 94 16\n", "Parse Result:\n", "0x00A5: 145.0 抖动频率上限\n", "0x00A6: 117.0 抖动频率下限\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dev_lamina.frame_read(0xA5, 2)" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A5 2D B3 C5 0C 50 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a5:\t116.99\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A5 00 01 94 29 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 38 A4 AA 3F 56 16\n", "Parse Result:\n", "0x00A5: 145.0 抖动频率上限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 2D BE CA 54 88 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 117.1 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A5 2D B4 84 CE D2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A5 2D B4 84 CE 6B 16\n", "Write Result: \n", "0x00a5:\t117\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A5 00 01 94 29 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 2D B4 A5 63 7A 16\n", "Parse Result:\n", "0x00A5: 117.0 抖动频率上限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 2D BE 2D BE 0E 5B D4 16\n", "Parse Result:\n", "0x005E: 117.1 抖动频率上限\n", "0x005F: 117.1 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A5 2D B5 45 0E D4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A5 2D B5 45 0E 6D 16\n", "Write Result: \n", "0x00a5:\t117.01\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A5 00 01 94 29 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 2D B5 64 A3 7A 16\n", "Parse Result:\n", "0x00A5: 117.01 抖动频率上限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 2D BE 2D BE 0E 5B D4 16\n", "Parse Result:\n", "0x005E: 117.1 抖动频率上限\n", "0x005F: 117.1 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A5 38 A3 CA 50 94 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A5 38 A3 CA 50 2D 16\n", "Write Result: \n", "0x00a5:\t144.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A5 00 01 94 29 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 38 A3 EB FD 54 16\n", "Parse Result:\n", "0x00A5: 144.99 抖动频率上限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 2D BE CA 54 88 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 117.1 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A5 38 A4 8B 92 98 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A5 38 A4 8B 92 31 16\n", "Write Result: \n", "0x00a5:\t145\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A5 00 01 94 29 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 38 A4 AA 3F 56 16\n", "Parse Result:\n", "0x00A5: 145.0 抖动频率上限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 2D BE CA 54 88 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 117.1 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A5 38 A5 4A 52 18 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a5:\t145.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A5 00 01 94 29 5A 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 38 A4 AA 3F 56 16\n", "Parse Result:\n", "0x00A5: 145.0 抖动频率上限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 2D BE CA 54 88 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 117.1 抖动频率下限\n" ] } ], "source": [ "addr, dlen = 0xA5, 1\n", "vmin, vmax, vacc = 117, 145, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)\n", " dev_lamina.frame_read(0x5E, 0x02)" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A6 13 87 24 BB 19 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a6:\t49.99\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A6 00 01 64 29 2B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 2D B4 A5 63 7A 16\n", "Parse Result:\n", "0x00A6: 117.0 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 2D BE CA 54 88 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 117.1 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A6 13 88 64 BF 5E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A6 13 88 64 BF F7 16\n", "Write Result: \n", "0x00a6:\t50\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A6 00 01 64 29 2B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 88 B5 12 F3 16\n", "Parse Result:\n", "0x00A6: 50.0 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 13 88 5A 22 96 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 50.0 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A6 13 89 A5 7F 60 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A6 13 89 A5 7F F9 16\n", "Write Result: \n", "0x00a6:\t50.01\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A6 00 01 64 29 2B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 13 89 74 D2 73 16\n", "Parse Result:\n", "0x00A6: 50.01 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 13 8B 1A 23 5A 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 50.03 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A6 38 A3 3A 50 05 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A6 38 A3 3A 50 9E 16\n", "Write Result: \n", "0x00a6:\t144.99\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A6 00 01 64 29 2B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 38 A3 EB FD 54 16\n", "Parse Result:\n", "0x00A6: 144.99 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 38 B2 C4 C1 EE 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 145.14 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A6 38 A4 7B 92 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A6 38 A4 7B 92 22 16\n", "Write Result: \n", "0x00a6:\t145\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A6 00 01 64 29 2B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 38 A4 AA 3F 56 16\n", "Parse Result:\n", "0x00A6: 145.0 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 38 B2 C4 C1 EE 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 145.14 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A6 38 A5 BA 52 89 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a6:\t145.01\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A6 00 01 64 29 2B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 38 A4 AA 3F 56 16\n", "Parse Result:\n", "0x00A6: 145.0 抖动频率下限\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 5E 00 02 A5 D9 D5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 09 01 03 04 38 B2 38 B2 C4 C1 EE 16\n", "Parse Result:\n", "0x005E: 145.14 抖动频率上限\n", "0x005F: 145.14 抖动频率下限\n" ] } ], "source": [ "addr, dlen = 0xA6, 1\n", "vmin, vmax, vacc = 50, 145, 0.01\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)\n", " dev_lamina.frame_read(0x5E, 0x02)" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A7 FF FF 39 99 71 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a7:\t-0.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A7 00 01 35 E9 BD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 02 23 F8 FD AB 16\n", "Parse Result:\n", "0x00A7: 54.7 电池电压判断限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A7 00 00 38 29 02 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A7 00 00 38 29 9B 16\n", "Write Result: \n", "0x00a7:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A7 00 01 35 E9 BD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A7: 0.0 电池电压判断限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A7 00 01 F9 E9 84 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A7 00 01 F9 E9 1D 16\n", "Write Result: \n", "0x00a7:\t0.1\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A7 00 01 35 E9 BD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x00A7: 0.1 电池电压判断限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A7 03 E7 78 93 96 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A7 03 E7 78 93 2F 16\n", "Write Result: \n", "0x00a7:\t99.9\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A7 00 01 35 E9 BD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E7 F8 FE 71 16\n", "Parse Result:\n", "0x00A7: 99.9 电池电压判断限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A7 03 E8 38 97 5B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A7 03 E8 38 97 F4 16\n", "Write Result: \n", "0x00a7:\t100\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A7 00 01 35 E9 BD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x00A7: 100.0 电池电压判断限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A7 03 E9 F9 57 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a7:\t100.1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A7 00 01 35 E9 BD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 03 E8 B8 FA 2E 16\n", "Parse Result:\n", "0x00A7: 100.0 电池电压判断限值\n" ] } ], "source": [ "addr, dlen = 0xA7, 1\n", "vmin, vmax, vacc = 0, 100, 0.1\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A8 00 00 08 2A D4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A8 00 00 08 2A 6D 16\n", "Write Result: \n", "0x00a8:\t0\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A8 00 01 05 EA 8F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A8: 0x0000 MPPT追踪模式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A8 00 01 C9 EA 56 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A8 00 01 C9 EA EF 16\n", "Write Result: \n", "0x00a8:\t1\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A8 00 01 05 EA 8F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 01 79 84 8F 16\n", "Parse Result:\n", "0x00A8: 0x0001 MPPT追踪模式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A8 00 02 89 EB 18 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A8 00 02 89 EB B1 16\n", "Write Result: \n", "0x00a8:\t2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A8 00 01 05 EA 8F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A8: 0x0000 MPPT追踪模式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A8 00 FF 48 6A 53 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A8 00 FF 48 6A EC 16\n", "Write Result: \n", "0x00a8:\t255\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A8 00 01 05 EA 8F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A8: 0x0000 MPPT追踪模式\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A8 FF FF 09 9A 43 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A8 FF FF 09 9A DC 16\n", "Write Result: \n", "0x00a8:\t-1\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A8 00 01 05 EA 8F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 00 00 B8 44 8D 16\n", "Parse Result:\n", "0x00A8: 0x0000 MPPT追踪模式\n" ] } ], "source": [ "addr, dlen = 0xA8, 1\n", "for value in [0, 1, 2, 0xFF, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A9 04 AE DA 96 C5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a9:\t1.19899\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A9 00 01 54 2A 1F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 94 B5 BB A6 16\n", "Parse Result:\n", "0x00A9: 4.5 ADC参考电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A9 04 B0 5A 9E 4F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A9 04 B0 5A 9E E8 16\n", "Write Result: \n", "0x00a9:\t1.2\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A9 00 01 54 2A 1F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 04 B0 BB 30 30 16\n", "Parse Result:\n", "0x00A9: 1.2 ADC参考电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A9 04 B1 9B 5E 51 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A9 04 B1 9B 5E EA 16\n", "Write Result: \n", "0x00a9:\t1.20101\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A9 00 01 54 2A 1F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 04 B1 7A F0 B0 16\n", "Parse Result:\n", "0x00A9: 1.201 ADC参考电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A9 11 92 D4 17 31 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A9 11 92 D4 17 CA 16\n", "Write Result: \n", "0x00a9:\t4.49899\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A9 00 01 54 2A 1F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 92 35 B9 22 16\n", "Parse Result:\n", "0x00A9: 4.498 ADC参考电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A9 11 94 54 15 B1 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A9 11 94 54 15 4A 16\n", "Write Result: \n", "0x00a9:\t4.5\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A9 00 01 54 2A 1F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 94 B5 BB A6 16\n", "Parse Result:\n", "0x00A9: 4.5 ADC参考电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A9 11 95 95 D5 B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00a9:\t4.50101\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 A9 00 01 54 2A 1F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 11 94 B5 BB A6 16\n", "Parse Result:\n", "0x00A9: 4.5 ADC参考电压\n" ] } ], "source": [ "addr, dlen = 0xA9, 1\n", "vmin, vmax, vacc = 1.2, 4.5, 0.00101\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 AA 00 00 A9 EA 37 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00aa:\t0\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 AA 00 01 A4 2A 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF FF B9 F4 3C 16\n", "Parse Result:\n", "0x00AA: 0xFFFF 硬件版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 AA 00 01 68 2A 37 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00aa:\t1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 AA 00 01 A4 2A 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF FF B9 F4 3C 16\n", "Parse Result:\n", "0x00AA: 0xFFFF 硬件版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 AA 00 02 28 2B F9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00aa:\t2\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 AA 00 01 A4 2A 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF FF B9 F4 3C 16\n", "Parse Result:\n", "0x00AA: 0xFFFF 硬件版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 AA 00 03 E9 EB 7B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00aa:\t3\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 AA 00 01 A4 2A 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF FF B9 F4 3C 16\n", "Parse Result:\n", "0x00AA: 0xFFFF 硬件版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 AA 00 04 A8 29 79 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00aa:\t4\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 AA 00 01 A4 2A 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF FF B9 F4 3C 16\n", "Parse Result:\n", "0x00AA: 0xFFFF 硬件版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 AA 00 05 69 E9 FB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00aa:\t5\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 AA 00 01 A4 2A 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF FF B9 F4 3C 16\n", "Parse Result:\n", "0x00AA: 0xFFFF 硬件版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 AA 00 FF E9 AA 36 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00aa:\t255\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 AA 00 01 A4 2A 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF FF B9 F4 3C 16\n", "Parse Result:\n", "0x00AA: 0xFFFF 硬件版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 AA FF FF A8 5A A4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 86 FF 02 20 31 16\n", "Write Result: \n", "0x00aa:\t-1\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 AA 00 01 A4 2A 70 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 07 01 03 02 FF FF B9 F4 3C 16\n", "Parse Result:\n", "0x00AA: 0xFFFF 硬件版本\n" ] } ], "source": [ "addr, dlen = 0xAA, 1\n", "for value in [0, 1, 2, 3, 4, 5, 0xFF, -1]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 00 B0 00 10 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 93 38 D0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 B0 00 10 C0 22 3F 16\n", "Write Result: \n", "176:\tb'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 B0 00 10 45 E1 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C0 B1 2A 16\n", "Parse Result:\n", "0x00B0: SLCP101_250111_0800_V2.03 版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 10 45 FA 47 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C0 B1 2A 16\n", "Parse Result:\n", "0x0100: SLCP101_250111_0800_V2.03 版本(ODM)\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 00 B0 00 10 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9A EA C9 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 B0 00 10 C0 22 3F 16\n", "Write Result: \n", "176:\tb' '\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 B0 00 10 45 E1 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C0 B1 2A 16\n", "Parse Result:\n", "0x00B0: SLCP101_250111_0800_V2.03 版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 10 45 FA 47 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 20 20 20 20 20 20 20 20 20 20 32 5F 30 35 31 31 5F 31 38 30 30 30 56 5F 2E 32 33 30 00 00 00 00 B1 35 1B 16\n", "Parse Result:\n", "0x0100: _250111_0800_V2.03 版本(ODM)\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 00 B0 00 10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 81 32 B8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "176:\tb' '\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 B0 00 10 45 E1 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C0 B1 2A 16\n", "Parse Result:\n", "0x00B0: SLCP101_250111_0800_V2.03 版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 10 45 FA 47 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 20 20 20 20 20 20 20 20 20 20 32 5F 30 35 31 31 5F 31 38 30 30 30 56 5F 2E 32 33 30 00 00 00 00 B1 35 1B 16\n", "Parse Result:\n", "0x0100: _250111_0800_V2.03 版本(ODM)\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 00 B0 00 10 20 41 41 41 41 41 41 41 41 41 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 EC 8D 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 00 B0 00 10 C0 22 3F 16\n", "Write Result: \n", "176:\tb'AAAAAAAAAA'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 B0 00 10 45 E1 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C0 B1 2A 16\n", "Parse Result:\n", "0x00B0: SLCP101_250111_0800_V2.03 版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 10 45 FA 47 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 41 41 41 41 41 41 41 41 41 41 32 5F 30 35 31 31 5F 31 38 30 30 30 56 5F 2E 32 33 30 00 00 00 00 39 33 EB 16\n", "Parse Result:\n", "0x0100: AAAAAAAAAA_250111_0800_V2.03 版本(ODM)\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 00 B0 00 10 20 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E7 40 3C 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "176:\tb'AAAAAAAAAAAAAAAA'\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 B0 00 10 45 E1 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C0 B1 2A 16\n", "Parse Result:\n", "0x00B0: SLCP101_250111_0800_V2.03 版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 10 45 FA 47 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 41 41 41 41 41 41 41 41 41 41 32 5F 30 35 31 31 5F 31 38 30 30 30 56 5F 2E 32 33 30 00 00 00 00 39 33 EB 16\n", "Parse Result:\n", "0x0100: AAAAAAAAAA_250111_0800_V2.03 版本(ODM)\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 00 B0 00 10 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D2 EC B3 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "176:\tb'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 B0 00 10 45 E1 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C0 B1 2A 16\n", "Parse Result:\n", "0x00B0: SLCP101_250111_0800_V2.03 版本\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 10 45 FA 47 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 41 41 41 41 41 41 41 41 41 41 32 5F 30 35 31 31 5F 31 38 30 30 30 56 5F 2E 32 33 30 00 00 00 00 39 33 EB 16\n", "Parse Result:\n", "0x0100: AAAAAAAAAA_250111_0800_V2.03 版本(ODM)\n" ] } ], "source": [ "addr, dlen = 0xB0, 16\n", "for value in [b'\\000'*32, b' '*10, b' '*16, b'A'*10, b'A'*16, b'\\777'*16]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n{addr}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)\n", " dev_lamina.frame_read(0x100, dlen)" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 00 00 10 20 32 31 34 33 36 35 38 37 30 39 42 41 44 43 46 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 41 EF 28 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 05 01 90 FF 0C 40 65 16\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 10 45 FA 47 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C0 B1 2A 16\n", "Parse Result:\n", "0x0100: SLCP101_250111_0800_V2.03 版本(ODM)\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dev_lamina.frame_write_str(0x100, b\"1234567890ABCDEF\")\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x100, 16)" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 10 00 10 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9D 70 73 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 10 00 10 C1 FC 7B 16\n", "Write Result: \n", "272:\tb'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 10 00 10 44 3F 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 56 50 2D 43 38 34 37 2D 30 30 44 2D 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CE 1B C5 16\n", "Parse Result:\n", "0x0110: PVC-48-700-DX 型号\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 10 00 10 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 A2 DC 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 10 00 10 C1 FC 7B 16\n", "Write Result: \n", "272:\tb' '\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 10 00 10 44 3F 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9B A8 50 16\n", "Parse Result:\n", "0x0110: 型号\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 10 00 10 20 41 41 41 41 41 41 41 41 41 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1C A4 B0 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 10 00 10 C1 FC 7B 16\n", "Write Result: \n", "272:\tb'AAAAAAAAAA'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 10 00 10 44 3F 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 41 41 41 41 41 41 41 41 41 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 AE 18 16\n", "Parse Result:\n", "0x0110: AAAAAAAAAA 型号\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 10 00 10 20 FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D2 50 7E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 10 00 10 C1 FC 7B 16\n", "Write Result: \n", "272:\tb'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 10 00 10 44 3F 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DD 5A FA 16\n", "Parse Result:\n", "0x0110: FF FF FF FF FF FF FF FF FF FF 型号\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 10 00 10 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9D 70 73 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 10 00 10 C1 FC 7B 16\n", "Write Result: \n", "272:\tb'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 10 00 10 44 3F 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 56 50 2D 43 38 34 37 2D 30 30 44 2D 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CE 1B C5 16\n", "Parse Result:\n", "0x0110: PVC-48-700-DX 型号\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 10 00 10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 8F 7A 6F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 10 00 10 C1 FC 7B 16\n", "Write Result: \n", "272:\tb' '\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 10 00 10 44 3F 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 70 BD 16\n", "Parse Result:\n", "0x0110: 型号\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 10 00 10 20 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E9 08 67 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 10 00 10 C1 FC 7B 16\n", "Write Result: \n", "272:\tb'AAAAAAAAAAAAAAAA'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 10 00 10 44 3F 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E6 02 C5 16\n", "Parse Result:\n", "0x0110: AAAAAAAAAAAAAAAA 型号\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 10 00 10 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DC A4 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 10 00 10 C1 FC 7B 16\n", "Write Result: \n", "272:\tb'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 10 00 10 44 3F 9B 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D3 AE 3E 16\n", "Parse Result:\n", "0x0110: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 型号\n" ] } ], "source": [ "addr, dlen = 0x110, 16\n", "for value in [b'\\000'*10, b' '*10, b'A'*10, b'\\777'*10, b'\\000'*16, b' '*16, b'A'*16, b'\\777'*16]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n{addr}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 19 01 10 01 30 00 08 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C E8 92 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 30 00 08 C0 3C D2 16\n", "Write Result: \n", "304:\tb'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 30 00 08 45 FF 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 15 01 03 10 6F 74 73 70 6F 63 6D 6D 00 00 00 00 00 00 00 00 37 26 7C 16\n", "Parse Result:\n", "0x0130: topscomm 厂商\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 19 01 10 01 30 00 08 10 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 BA A6 FE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 30 00 08 C0 3C D2 16\n", "Write Result: \n", "304:\tb' '\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 30 00 08 45 FF 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 15 01 03 10 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 12 17 16 16\n", "Parse Result:\n", "0x0130: 厂商\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 19 01 10 01 30 00 08 10 41 41 41 41 41 41 41 41 41 41 00 00 00 00 00 00 D6 C3 81 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 30 00 08 C0 3C D2 16\n", "Write Result: \n", "304:\tb'AAAAAAAAAA'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 30 00 08 45 FF 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 15 01 03 10 41 41 41 41 41 41 41 41 41 41 00 00 00 00 00 00 7E 72 27 16\n", "Parse Result:\n", "0x0130: AAAAAAAAAA 厂商\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 19 01 10 01 30 00 08 10 FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 0D 17 78 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 30 00 08 C0 3C D2 16\n", "Write Result: \n", "304:\tb'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 30 00 08 45 FF 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 15 01 03 10 FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 A5 A6 EE 16\n", "Parse Result:\n", "0x0130: FF FF FF FF FF FF FF FF FF FF 厂商\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 19 01 10 01 30 00 08 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C E8 92 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 30 00 08 C0 3C D2 16\n", "Write Result: \n", "304:\tb'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 30 00 08 45 FF 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 15 01 03 10 6F 74 73 70 6F 63 6D 6D 00 00 00 00 00 00 00 00 37 26 7C 16\n", "Parse Result:\n", "0x0130: topscomm 厂商\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 19 01 10 01 30 00 08 10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2E 13 9F 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 30 00 08 C0 3C D2 16\n", "Write Result: \n", "304:\tb' '\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 30 00 08 45 FF 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 15 01 03 10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 86 A2 D5 16\n", "Parse Result:\n", "0x0130: 厂商\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 19 01 10 01 30 00 08 10 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 51 95 54 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 30 00 08 C0 3C D2 16\n", "Write Result: \n", "304:\tb'AAAAAAAAAAAAAAAA'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 30 00 08 45 FF 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 15 01 03 10 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 F9 24 DA 16\n", "Parse Result:\n", "0x0130: AAAAAAAAAAAAAAAA 厂商\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 19 01 10 01 30 00 08 10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 0C 98 F2 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 30 00 08 C0 3C D2 16\n", "Write Result: \n", "304:\tb'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 30 00 08 45 FF 74 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 15 01 03 10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF A4 29 6A 16\n", "Parse Result:\n", "0x0130: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 厂商\n" ] } ], "source": [ "addr, dlen = 0x130, 8\n", "for value in [b'\\000'*10, b' '*10, b'A'*10, b'\\777'*10, b'\\000'*16, b' '*16, b'A'*16, b'\\777'*16]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n{addr}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 70 00 10 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 F8 50 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 70 00 10 C1 E2 C1 16\n", "Write Result: \n", "0x0170:\tb'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 70 00 10 44 21 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 7A D9 16\n", "Parse Result:\n", "0x0170: SN\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 70 00 10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 F2 38 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 70 00 10 C1 E2 C1 16\n", "Write Result: \n", "0x0170:\tb' '\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 70 00 10 44 21 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 70 BD 16\n", "Parse Result:\n", "0x0170: SN\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 70 00 10 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D3 2C B5 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 70 00 10 C1 E2 C1 16\n", "Write Result: \n", "0x0170:\tb'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 70 00 10 44 21 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D3 AE 3E 16\n", "Parse Result:\n", "0x0170: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF SN\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 70 00 10 20 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 B8 61 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 70 00 10 C1 E2 C1 16\n", "Write Result: \n", "0x0170:\tb'01234567890ABCDEF'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 70 00 10 44 21 DD 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 3A EA 16\n", "Parse Result:\n", "0x0170: 01234567890ABCDEF SN\n" ] } ], "source": [ "addr, dlen = 0x170, 16\n", "list_str = [\n", " b\"\\000\"*16, \n", " b\" \"*16, \n", " b\"\\777\"*16, \n", " b\"01234567890ABCDEF\", \n", "]\n", "for value in list_str:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 80 00 10 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 89 4C AB 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 80 00 10 C1 D1 C0 16\n", "Write Result: \n", "0x0180:\tb'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 80 00 10 44 12 DE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 7A D9 16\n", "Parse Result:\n", "0x0180: MES\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 80 00 10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9B 46 B7 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 80 00 10 C1 D1 C0 16\n", "Write Result: \n", "0x0180:\tb' '\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 80 00 10 44 12 DE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 70 BD 16\n", "Parse Result:\n", "0x0180: MES\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 80 00 10 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C8 98 26 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 80 00 10 C1 D1 C0 16\n", "Write Result: \n", "0x0180:\tb'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 80 00 10 44 12 DE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D3 AE 3E 16\n", "Parse Result:\n", "0x0180: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF MES\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 80 00 10 20 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 0C BE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 80 00 10 C1 D1 C0 16\n", "Write Result: \n", "0x0180:\tb'01234567890ABCDEF'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 80 00 10 44 12 DE 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 3A EA 16\n", "Parse Result:\n", "0x0180: 01234567890ABCDEF MES\n" ] } ], "source": [ "addr, dlen = 0x180, 16\n", "list_str = [\n", " b\"\\000\"*16, \n", " b\" \"*16, \n", " b\"\\777\"*16, \n", " b\"01234567890ABCDEF\", \n", "]\n", "for value in list_str:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 90 00 10 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 8B 10 81 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 90 00 10 C0 14 12 16\n", "Write Result: \n", "0x0190:\tb'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 90 00 10 45 D7 B4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 7A D9 16\n", "Parse Result:\n", "0x0190: Datetime\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 90 00 10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 99 1A 99 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 90 00 10 C0 14 12 16\n", "Write Result: \n", "0x0190:\tb' '\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 90 00 10 45 D7 B4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 70 BD 16\n", "Parse Result:\n", "0x0190: Datetime\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 90 00 10 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CA C4 64 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 90 00 10 C0 14 12 16\n", "Write Result: \n", "0x0190:\tb'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 90 00 10 45 D7 B4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D3 AE 3E 16\n", "Parse Result:\n", "0x0190: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF Datetime\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 29 01 10 01 90 00 10 20 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 50 10 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 10 01 90 00 10 C0 14 12 16\n", "Write Result: \n", "0x0190:\tb'01234567890ABCDEF'\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 90 00 10 45 D7 B4 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 25 01 03 20 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 3A EA 16\n", "Parse Result:\n", "0x0190: 01234567890ABCDEF Datetime\n" ] } ], "source": [ "addr, dlen = 0x190, 16\n", "list_str = [\n", " b\"\\000\"*16, \n", " b\" \"*16, \n", " b\"\\777\"*16, \n", " b\"01234567890ABCDEF\", \n", "]\n", "for value in list_str:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 76, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 00 00 00 00 00 00 40 A2 78 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 05 01 90 FF 0C 40 FA 16\n", "Write Result: \n", "0x0082:\t[0, 0, 0, 0, 0, 0]\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 0B 01 03 06 88 01 88 88 89 88 CE 41 E7 16\n", "Parse Result:\n", "0x0082: 01 88 88 88 88 89 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 02 01 04 03 06 05 4E 13 0C 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 10 00 82 00 03 20 20 F7 16\n", "Write Result: \n", "0x0082:\t[1, 2, 3, 4, 5, 6]\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 06 05 04 03 02 01 68 9F 0B 01 03 06 02 01 04 03 06 05 2F C4 A1 16\n", "Parse Result:\n", "0x0082: 01 02 03 04 05 06 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 AA AA AA AA AA AA BF 97 E8 16\n", "Read Frame: 68 06 05 04 03 02 01 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0082:\t[170, 170, 170, 170, 170, 170]\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 06 05 04 03 02 01 68 9F 0B 01 03 06 02 01 04 03 06 05 2F C4 A1 16\n", "Parse Result:\n", "0x0082: 01 02 03 04 05 06 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 99 99 99 99 99 99 15 FE 3F 16\n", "Read Frame: 68 06 05 04 03 02 01 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0082:\t[153, 153, 153, 153, 153, 153]\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 06 05 04 03 02 01 68 9F 0B 01 03 06 02 01 04 03 06 05 2F C4 A1 16\n", "Parse Result:\n", "0x0082: 01 02 03 04 05 06 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 99 99 99 99 01 99 7E 3E 50 16\n", "Read Frame: 68 06 05 04 03 02 01 68 9F 05 01 90 FF 0C 40 65 16\n", "Write Result: \n", "0x0082:\t[153, 153, 153, 153, 153, 1]\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 06 05 04 03 02 01 68 9F 0B 01 03 06 02 01 04 03 06 05 2F C4 A1 16\n", "Parse Result:\n", "0x0082: 01 02 03 04 05 06 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 99 01 99 99 99 99 34 22 EA 16\n", "Read Frame: 68 06 05 04 03 02 01 68 9F 08 01 10 00 82 00 03 20 20 62 16\n", "Write Result: \n", "0x0082:\t[1, 153, 153, 153, 153, 153]\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 99 99 99 99 99 01 68 9F 0B 01 03 06 99 01 99 99 99 99 55 F5 CA 16\n", "Parse Result:\n", "0x0082: 01 99 99 99 99 99 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 99 01 99 99 98 99 35 B2 7A 16\n", "Read Frame: 68 99 99 99 99 99 01 68 9F 08 01 10 00 82 00 03 20 20 4B 16\n", "Write Result: \n", "0x0082:\t[1, 153, 153, 153, 153, 152]\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 98 99 99 99 99 01 68 9F 0B 01 03 06 99 01 99 99 98 99 54 65 37 16\n", "Parse Result:\n", "0x0082: 01 99 99 99 99 98 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 88 88 88 88 88 88 73 D9 12 16\n", "Read Frame: 68 98 99 99 99 99 01 68 9F 05 01 90 FF 0C 40 4D 16\n", "Write Result: \n", "0x0082:\t[136, 136, 136, 136, 136, 136]\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 98 99 99 99 99 01 68 9F 0B 01 03 06 99 01 99 99 98 99 54 65 37 16\n", "Parse Result:\n", "0x0082: 01 99 99 99 99 98 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 88 88 88 88 01 88 14 49 9C 16\n", "Read Frame: 68 98 99 99 99 99 01 68 9F 05 01 90 FF 0C 40 4D 16\n", "Write Result: \n", "0x0082:\t[136, 136, 136, 136, 136, 1]\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 98 99 99 99 99 01 68 9F 0B 01 03 06 99 01 99 99 98 99 54 65 37 16\n", "Parse Result:\n", "0x0082: 01 99 99 99 99 98 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 88 01 88 88 88 88 AE 06 F3 16\n", "Read Frame: 68 98 99 99 99 99 01 68 9F 08 01 10 00 82 00 03 20 20 4A 16\n", "Write Result: \n", "0x0082:\t[1, 136, 136, 136, 136, 136]\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 88 88 88 88 88 01 68 9F 0B 01 03 06 88 01 88 88 88 88 CF D1 76 16\n", "Parse Result:\n", "0x0082: 01 88 88 88 88 88 载波通信地址\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0F 01 10 00 82 00 03 06 88 01 88 88 89 88 AF 96 85 16\n", "Read Frame: 68 88 88 88 88 88 01 68 9F 08 01 10 00 82 00 03 20 20 F6 16\n", "Write Result: \n", "0x0082:\t[1, 136, 136, 136, 136, 137]\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 82 00 03 A5 E3 04 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 0B 01 03 06 88 01 88 88 89 88 CE 41 E7 16\n", "Parse Result:\n", "0x0082: 01 88 88 88 88 89 载波通信地址\n" ] } ], "source": [ "addr, dlen = 0x82, 3\n", "list_str = [\n", " [0x00]*6, \n", " [1,2,3,4,5,6],\n", " [0xAA]*6,\n", " [0x99]*6, \n", " [0x99, 0x99, 0x99, 0x99, 0x99, 0x01],\n", " [0x01, 0x99, 0x99, 0x99, 0x99, 0x99],\n", " [0x01, 0x99, 0x99, 0x99, 0x99, 0x98],\n", " [0x88]*6,\n", " [0x88, 0x88, 0x88, 0x88, 0x88, 0x01],\n", " [0x01, 0x88, 0x88, 0x88, 0x88, 0x88],\n", " [0x01, 0x88, 0x88, 0x88, 0x88, 0x89],\n", "]\n", "for value in list_str:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(6 if result else 0.5)\n", " dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 参数掉电保存" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 A3 00 01 B8 28 7E 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 A3 00 01 B8 28 17 16\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 60 00 60 45 FC F8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F C5 01 03 C0 00 01 01 2C 01 90 00 C8 03 20 00 C8 03 20 01 F4 02 58 01 E0 02 58 02 BC 02 6C 01 F4 0B B8 13 88 00 64 00 65 03 E8 03 E8 02 58 03 21 03 21 03 20 01 90 02 58 AE 61 00 0A AE 5F 00 0A AE 60 00 0A AE 60 00 0A 05 06 03 04 01 02 27 10 27 0F 27 10 27 0F 00 C8 03 E7 03 E8 03 E8 0D 40 00 03 0D 40 00 03 0D 40 00 03 0D 40 00 03 00 05 00 00 07 D0 27 10 07 D0 27 10 07 D0 27 10 07 D0 27 10 07 D0 27 10 01 F4 01 F4 00 01 0B B8 38 A4 38 A4 03 E8 00 00 11 94 FF FF FF FF FF FF FF FF FF FF FF FF 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 C5 42 39 16\n", "Parse Result:\n", "0x0060: 0x0001 光伏通道使能 \n", "0x0061: 30.0 最小启动输入电压 \n", "0x0062: 40.0 最大启动输入电压 \n", "0x0063: 20.0 最小停止输入电压 \n", "0x0064: 80.0 最大停止输入电压 \n", "0x0065: 20.0 最小MPPT电压 \n", "0x0066: 80.0 最大MPPT电压 \n", "0x0067: 50.0 最小启动输出电压 \n", "0x0068: 60.0 最大启动输出电压 \n", "0x0069: 48.0 最小停止输出电压 \n", "0x006A: 60.0 最大停止输出电压 \n", "0x006B: 70.0 输入过压保护值 \n", "0x006C: 62.0 输出过压保护值 \n", "0x006D: 50.0 输出欠压保护值 \n", "0x006E: 30.0 电感过流保护值 \n", "0x006F: 50.0 输入过流保护值 \n", "0x0070: 1.0 最小电感电流限值 \n", "0x0071: 1.01 最大电感电流限值 \n", "0x0072: 100.0 浮充电压阈值 \n", "0x0073: 100.0 三点法中间阈值 \n", "0x0074: 60.0 恒压充电电压 \n", "0x0075: 80.1 过温故障值 \n", "0x0076: 80.1 过温告警值 \n", "0x0077: 80.0 温度恢复值 \n", "0x0078: 40.0 最低满载电压 \n", "0x0079: 60.0 最高满载电压 \n", "0x007A: 700.001 输入过载保护值 \n", "0x007C: 699.999 最小功率限值 \n", "0x007E: 700.0 最大功率限值 \n", "0x0080: 700.0 最大功率限值存储值 \n", "0x0082: 06 05 04 03 02 01 载波通信地址 \n", "0x0085: 100.0 电压环out_max \n", "0x0086: 99.99 电压环out_min \n", "0x0087: 100.0 电流环out_max \n", "0x0088: 99.99 电流环out_min \n", "0x0089: 2.0 MPPT扰动系数k_d_vin \n", "0x008A: 0.999 dmin \n", "0x008B: 1.0 dmax \n", "0x008C: 100.0 扫描电压偏移scanvolt_offset\n", "0x008D: 2.0 电压环Kp \n", "0x008F: 2.0 电压环Ki \n", "0x0091: 2.0 电流环Kp \n", "0x0093: 2.0 电流环Ki \n", "0x0095: 0x0005 日志级别 \n", "0x0096: 0x0000 日志输出方式 \n", "0x0097: 2.0 采样校准volt_in_a \n", "0x0098: 100.0 采样校准volt_in_b \n", "0x0099: 2.0 采样校准volt_out_a \n", "0x009A: 100.0 采样校准volt_out_b \n", "0x009B: 2.0 采样校准curr_in_a \n", "0x009C: 100.0 采样校准curr_in_b \n", "0x009D: 2.0 采样校准curr_induc_a \n", "0x009E: 100.0 采样校准curr_induc_b \n", "0x009F: 2.0 采样校准volt_12V_a \n", "0x00A0: 100.0 采样校准volt_12V_b \n", "0x00A1: 50.0 温度补偿temp1_b \n", "0x00A2: 50.0 温度补偿temp2_b \n", "0x00A3: 1 系统工作模式 \n", "0x00A4: 30.0 电感电流给定值curr_set \n", "0x00A5: 145.0 抖动频率上限 \n", "0x00A6: 145.0 抖动频率下限 \n", "0x00A7: 100.0 电池电压判断限值 \n", "0x00A8: 0x0000 MPPT追踪模式 \n", "0x00A9: 4.5 ADC参考电压 \n", "0x00AA: 0xFFFF 硬件版本 \n", "0x00AB: 0xFFFF 保留 \n", "0x00AC: 0xFFFF 保留 \n", "0x00AD: 0xFFFF 保留 \n", "0x00AE: 0xFFFF 保留 \n", "0x00AF: 0xFFFF 保留 \n", "0x00B0: SLCP101_250111_0800_V2.03 版本 \n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 38 45 E4 59 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 75 01 03 70 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 54 41 43 32 5F 30 34 32 36 5F 31 31 56 31 2E 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DA C9 00 16\n", "Parse Result:\n", "0x0100: SLCP101_250111_0800_V2.03 版本(ODM)\n", "0x0110: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 型号 \n", "0x0120: TCCA_240621_V1.16 载波芯片地址 \n", "0x0130: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 厂商 \n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 70 00 30 45 F9 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 65 01 03 60 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6E E4 15 16\n", "Parse Result:\n", "0x0170: 01234567890ABCDEF SN \n", "0x0180: 01234567890ABCDEF MES \n", "0x0190: 01234567890ABCDEF Datetime\n", "Write 0x53: 0x01\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 53 00 01 B8 1B 21 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 08 01 06 00 53 00 01 B8 1B BA 16\n", "设备重启完成,开始读取设备参数\n", "Discard Data: b'MICRO MONITOR 1.20.13\\r\\nPlatform: HC32F460\\r\\nCPU: HC32F460\\r\\nBuilt: Oct 31 2024 @ 22:55:07\\r\\nMonitor RAM: 0x1fff8448-0x1fff938c\\r\\nApplication RAM Base: 0x20010000\\r\\njump to app...\\r\\r\\n'\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 60 00 60 45 FC F8 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F C5 01 03 C0 00 01 01 2C 01 90 00 C8 03 20 00 C8 03 20 01 F4 02 58 01 E0 02 58 02 BC 02 6C 01 F4 0B B8 13 88 00 64 00 65 03 E8 03 E8 02 58 03 21 03 21 03 20 01 90 02 58 AE 61 00 0A AE 5F 00 0A AE 60 00 0A AE 60 00 0A 05 06 03 04 01 02 27 10 27 0F 27 10 27 0F 00 C8 03 E7 03 E8 03 E8 0D 40 00 03 0D 40 00 03 0D 40 00 03 0D 40 00 03 00 05 00 00 07 D0 27 10 07 D0 27 10 07 D0 27 10 07 D0 27 10 07 D0 27 10 01 F4 01 F4 00 00 0B B8 38 A4 38 A4 03 E8 00 00 11 94 FF FF FF FF FF FF FF FF FF FF FF FF 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 FA 01 2C 16\n", "Parse Result:\n", "0x0060: 0x0001 光伏通道使能 \n", "0x0061: 30.0 最小启动输入电压 \n", "0x0062: 40.0 最大启动输入电压 \n", "0x0063: 20.0 最小停止输入电压 \n", "0x0064: 80.0 最大停止输入电压 \n", "0x0065: 20.0 最小MPPT电压 \n", "0x0066: 80.0 最大MPPT电压 \n", "0x0067: 50.0 最小启动输出电压 \n", "0x0068: 60.0 最大启动输出电压 \n", "0x0069: 48.0 最小停止输出电压 \n", "0x006A: 60.0 最大停止输出电压 \n", "0x006B: 70.0 输入过压保护值 \n", "0x006C: 62.0 输出过压保护值 \n", "0x006D: 50.0 输出欠压保护值 \n", "0x006E: 30.0 电感过流保护值 \n", "0x006F: 50.0 输入过流保护值 \n", "0x0070: 1.0 最小电感电流限值 \n", "0x0071: 1.01 最大电感电流限值 \n", "0x0072: 100.0 浮充电压阈值 \n", "0x0073: 100.0 三点法中间阈值 \n", "0x0074: 60.0 恒压充电电压 \n", "0x0075: 80.1 过温故障值 \n", "0x0076: 80.1 过温告警值 \n", "0x0077: 80.0 温度恢复值 \n", "0x0078: 40.0 最低满载电压 \n", "0x0079: 60.0 最高满载电压 \n", "0x007A: 700.001 输入过载保护值 \n", "0x007C: 699.999 最小功率限值 \n", "0x007E: 700.0 最大功率限值 \n", "0x0080: 700.0 最大功率限值存储值 \n", "0x0082: 06 05 04 03 02 01 载波通信地址 \n", "0x0085: 100.0 电压环out_max \n", "0x0086: 99.99 电压环out_min \n", "0x0087: 100.0 电流环out_max \n", "0x0088: 99.99 电流环out_min \n", "0x0089: 2.0 MPPT扰动系数k_d_vin \n", "0x008A: 0.999 dmin \n", "0x008B: 1.0 dmax \n", "0x008C: 100.0 扫描电压偏移scanvolt_offset\n", "0x008D: 2.0 电压环Kp \n", "0x008F: 2.0 电压环Ki \n", "0x0091: 2.0 电流环Kp \n", "0x0093: 2.0 电流环Ki \n", "0x0095: 0x0005 日志级别 \n", "0x0096: 0x0000 日志输出方式 \n", "0x0097: 2.0 采样校准volt_in_a \n", "0x0098: 100.0 采样校准volt_in_b \n", "0x0099: 2.0 采样校准volt_out_a \n", "0x009A: 100.0 采样校准volt_out_b \n", "0x009B: 2.0 采样校准curr_in_a \n", "0x009C: 100.0 采样校准curr_in_b \n", "0x009D: 2.0 采样校准curr_induc_a \n", "0x009E: 100.0 采样校准curr_induc_b \n", "0x009F: 2.0 采样校准volt_12V_a \n", "0x00A0: 100.0 采样校准volt_12V_b \n", "0x00A1: 50.0 温度补偿temp1_b \n", "0x00A2: 50.0 温度补偿temp2_b \n", "0x00A3: 0 系统工作模式 \n", "0x00A4: 30.0 电感电流给定值curr_set \n", "0x00A5: 145.0 抖动频率上限 \n", "0x00A6: 145.0 抖动频率下限 \n", "0x00A7: 100.0 电池电压判断限值 \n", "0x00A8: 0x0000 MPPT追踪模式 \n", "0x00A9: 4.5 ADC参考电压 \n", "0x00AA: 0xFFFF 硬件版本 \n", "0x00AB: 0xFFFF 保留 \n", "0x00AC: 0xFFFF 保留 \n", "0x00AD: 0xFFFF 保留 \n", "0x00AE: 0xFFFF 保留 \n", "0x00AF: 0xFFFF 保留 \n", "0x00B0: SLCP101_250111_0800_V2.03 版本 \n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 38 45 E4 59 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 75 01 03 70 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 37 FE 6E 16\n", "Parse Result:\n", "0x0100: SLCP101_250111_0800_V2.03 版本(ODM)\n", "0x0110: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 型号 \n", "0x0120: 载波芯片地址 \n", "0x0130: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 厂商 \n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 70 00 30 45 F9 D6 16\n", "Read Frame: 68 01 02 03 04 05 06 68 9F 65 01 03 60 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6E E4 15 16\n", "Parse Result:\n", "0x0170: 01234567890ABCDEF SN \n", "0x0180: 01234567890ABCDEF MES \n", "0x0190: 01234567890ABCDEF Datetime\n" ] } ], "source": [ "# 写入掉电消失参数\n", "dev_lamina.frame_write_one(0xA3, 0x01)\n", "time.sleep(1.5)\n", "# 读取设备所有参数\n", "dev_lamina.frame_read(0x60, 0x60)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x100, 0x38)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x170, 0x30)\n", "time.sleep(0.5)\n", "\n", "print(\"Write 0x53: 0x01\")\n", "# 重启设备\n", "dev_lamina.frame_write_one(0x53, 0x01)\n", "time.sleep(4.5)\n", "\n", "print(\"设备重启完成,开始读取设备参数\")\n", "# 读取设备所有参数\n", "dev_lamina.frame_read(0x60, 0x60)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x100, 0x38)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x170, 0x30)\n", "time.sleep(0.5)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 参数还原" ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 60 00 60 45 FC F8 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F C5 01 03 C0 00 01 01 2C 01 90 00 C8 03 20 00 C8 03 20 01 F4 02 58 01 E0 02 58 02 BC 02 6C 01 F4 0B B8 13 88 00 64 00 65 03 E8 03 E8 02 58 03 21 03 21 03 20 01 90 02 58 AE 61 00 0A AE 5F 00 0A AE 60 00 0A AE 60 00 0A 88 01 88 88 89 88 27 10 27 0F 27 10 27 0F 00 C8 03 E7 03 E8 03 E8 0D 40 00 03 0D 40 00 03 0D 40 00 03 0D 40 00 03 00 05 00 00 07 D0 27 10 07 D0 27 10 07 D0 27 10 07 D0 27 10 07 D0 27 10 01 F4 01 F4 00 00 0B B8 38 A4 38 A4 03 E8 00 00 11 94 FF FF FF FF FF FF FF FF FF FF FF FF 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 1B AF 25 16\n", "Parse Result:\n", "0x0060: 0x0001 光伏通道使能 \n", "0x0061: 30.0 最小启动输入电压 \n", "0x0062: 40.0 最大启动输入电压 \n", "0x0063: 20.0 最小停止输入电压 \n", "0x0064: 80.0 最大停止输入电压 \n", "0x0065: 20.0 最小MPPT电压 \n", "0x0066: 80.0 最大MPPT电压 \n", "0x0067: 50.0 最小启动输出电压 \n", "0x0068: 60.0 最大启动输出电压 \n", "0x0069: 48.0 最小停止输出电压 \n", "0x006A: 60.0 最大停止输出电压 \n", "0x006B: 70.0 输入过压保护值 \n", "0x006C: 62.0 输出过压保护值 \n", "0x006D: 50.0 输出欠压保护值 \n", "0x006E: 30.0 电感过流保护值 \n", "0x006F: 50.0 输入过流保护值 \n", "0x0070: 1.0 最小电感电流限值 \n", "0x0071: 1.01 最大电感电流限值 \n", "0x0072: 100.0 浮充电压阈值 \n", "0x0073: 100.0 三点法中间阈值 \n", "0x0074: 60.0 恒压充电电压 \n", "0x0075: 80.1 过温故障值 \n", "0x0076: 80.1 过温告警值 \n", "0x0077: 80.0 温度恢复值 \n", "0x0078: 40.0 最低满载电压 \n", "0x0079: 60.0 最高满载电压 \n", "0x007A: 700.001 输入过载保护值 \n", "0x007C: 699.999 最小功率限值 \n", "0x007E: 700.0 最大功率限值 \n", "0x0080: 700.0 最大功率限值存储值 \n", "0x0082: 01 88 88 88 88 89 载波通信地址 \n", "0x0085: 100.0 电压环out_max \n", "0x0086: 99.99 电压环out_min \n", "0x0087: 100.0 电流环out_max \n", "0x0088: 99.99 电流环out_min \n", "0x0089: 2.0 MPPT扰动系数k_d_vin \n", "0x008A: 0.999 dmin \n", "0x008B: 1.0 dmax \n", "0x008C: 100.0 扫描电压偏移scanvolt_offset\n", "0x008D: 2.0 电压环Kp \n", "0x008F: 2.0 电压环Ki \n", "0x0091: 2.0 电流环Kp \n", "0x0093: 2.0 电流环Ki \n", "0x0095: 0x0005 日志级别 \n", "0x0096: 0x0000 日志输出方式 \n", "0x0097: 2.0 采样校准volt_in_a \n", "0x0098: 100.0 采样校准volt_in_b \n", "0x0099: 2.0 采样校准volt_out_a \n", "0x009A: 100.0 采样校准volt_out_b \n", "0x009B: 2.0 采样校准curr_in_a \n", "0x009C: 100.0 采样校准curr_in_b \n", "0x009D: 2.0 采样校准curr_induc_a \n", "0x009E: 100.0 采样校准curr_induc_b \n", "0x009F: 2.0 采样校准volt_12V_a \n", "0x00A0: 100.0 采样校准volt_12V_b \n", "0x00A1: 50.0 温度补偿temp1_b \n", "0x00A2: 50.0 温度补偿temp2_b \n", "0x00A3: 0 系统工作模式 \n", "0x00A4: 30.0 电感电流给定值curr_set \n", "0x00A5: 145.0 抖动频率上限 \n", "0x00A6: 145.0 抖动频率下限 \n", "0x00A7: 100.0 电池电压判断限值 \n", "0x00A8: 0x0000 MPPT追踪模式 \n", "0x00A9: 4.5 ADC参考电压 \n", "0x00AA: 0xFFFF 硬件版本 \n", "0x00AB: 0xFFFF 保留 \n", "0x00AC: 0xFFFF 保留 \n", "0x00AD: 0xFFFF 保留 \n", "0x00AE: 0xFFFF 保留 \n", "0x00AF: 0xFFFF 保留 \n", "0x00B0: SLCP101_250111_0800_V2.03 版本 \n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 38 45 E4 59 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 75 01 03 70 41 41 41 41 41 41 41 41 41 41 32 5F 30 35 31 31 5F 31 38 30 30 30 56 5F 2E 32 33 30 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 54 41 43 32 5F 30 34 32 36 5F 31 31 56 31 2E 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 48 75 75 16\n", "Parse Result:\n", "0x0100: AAAAAAAAAA_250111_0800_V2.03 版本(ODM)\n", "0x0110: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 型号 \n", "0x0120: TCCA_240621_V1.16 载波芯片地址 \n", "0x0130: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 厂商 \n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 70 00 30 45 F9 D6 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 65 01 03 60 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6E E4 AA 16\n", "Parse Result:\n", "0x0170: 01234567890ABCDEF SN \n", "0x0180: 01234567890ABCDEF MES \n", "0x0190: 01234567890ABCDEF Datetime\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 52 00 01 E9 DB 11 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 52 00 01 E9 DB 3F 16\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 60 00 60 45 FC F8 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F C5 01 03 C0 00 01 00 78 02 62 00 5A 02 6C 00 64 02 1C 01 CC 02 3A 01 A4 02 44 02 94 02 58 01 B8 09 60 07 D0 00 0A 08 98 02 3A 02 35 02 21 04 1A 03 B6 03 52 01 5E 02 30 AE 60 00 0A 03 E8 00 00 EB 10 00 09 EB 10 00 09 88 01 88 88 89 88 09 C4 FE 0C 00 64 00 00 00 64 00 0D 03 96 00 96 C3 50 00 00 00 C8 00 00 00 FA 00 00 00 14 00 00 00 02 00 00 03 E8 00 00 03 E8 00 00 03 E8 00 00 03 E8 00 00 03 E8 00 00 00 00 00 00 00 00 03 E8 37 DC 2D B4 02 23 00 01 0C AD FF FF FF FF FF FF FF FF FF FF FF FF 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 71 F5 B9 16\n", "Parse Result:\n", "0x0060: 0x0001 光伏通道使能 \n", "0x0061: 12.0 最小启动输入电压 \n", "0x0062: 61.0 最大启动输入电压 \n", "0x0063: 9.0 最小停止输入电压 \n", "0x0064: 62.0 最大停止输入电压 \n", "0x0065: 10.0 最小MPPT电压 \n", "0x0066: 54.0 最大MPPT电压 \n", "0x0067: 46.0 最小启动输出电压 \n", "0x0068: 57.0 最大启动输出电压 \n", "0x0069: 42.0 最小停止输出电压 \n", "0x006A: 58.0 最大停止输出电压 \n", "0x006B: 66.0 输入过压保护值 \n", "0x006C: 60.0 输出过压保护值 \n", "0x006D: 44.0 输出欠压保护值 \n", "0x006E: 24.0 电感过流保护值 \n", "0x006F: 20.0 输入过流保护值 \n", "0x0070: 0.1 最小电感电流限值 \n", "0x0071: 22.0 最大电感电流限值 \n", "0x0072: 57.0 浮充电压阈值 \n", "0x0073: 56.5 三点法中间阈值 \n", "0x0074: 54.5 恒压充电电压 \n", "0x0075: 105.0 过温故障值 \n", "0x0076: 95.0 过温告警值 \n", "0x0077: 85.0 温度恢复值 \n", "0x0078: 35.0 最低满载电压 \n", "0x0079: 56.0 最高满载电压 \n", "0x007A: 700.0 输入过载保护值 \n", "0x007C: 1.0 最小功率限值 \n", "0x007E: 650.0 最大功率限值 \n", "0x0080: 650.0 最大功率限值存储值 \n", "0x0082: 01 88 88 88 88 89 载波通信地址 \n", "0x0085: 25.0 电压环out_max \n", "0x0086: -5.0 电压环out_min \n", "0x0087: 1.0 电流环out_max \n", "0x0088: 0.0 电流环out_min \n", "0x0089: 1.0 MPPT扰动系数k_d_vin \n", "0x008A: 0.013 dmin \n", "0x008B: 0.918 dmax \n", "0x008C: 15.0 扫描电压偏移scanvolt_offset\n", "0x008D: 0.5 电压环Kp \n", "0x008F: 0.002 电压环Ki \n", "0x0091: 0.0025 电流环Kp \n", "0x0093: 0.0002 电流环Ki \n", "0x0095: 0x0002 日志级别 \n", "0x0096: 0x0000 日志输出方式 \n", "0x0097: 1.0 采样校准volt_in_a \n", "0x0098: 0.0 采样校准volt_in_b \n", "0x0099: 1.0 采样校准volt_out_a \n", "0x009A: 0.0 采样校准volt_out_b \n", "0x009B: 1.0 采样校准curr_in_a \n", "0x009C: 0.0 采样校准curr_in_b \n", "0x009D: 1.0 采样校准curr_induc_a \n", "0x009E: 0.0 采样校准curr_induc_b \n", "0x009F: 1.0 采样校准volt_12V_a \n", "0x00A0: 0.0 采样校准volt_12V_b \n", "0x00A1: 0.0 温度补偿temp1_b \n", "0x00A2: 0.0 温度补偿temp2_b \n", "0x00A3: 0 系统工作模式 \n", "0x00A4: 10.0 电感电流给定值curr_set \n", "0x00A5: 143.0 抖动频率上限 \n", "0x00A6: 117.0 抖动频率下限 \n", "0x00A7: 54.7 电池电压判断限值 \n", "0x00A8: 0x0001 MPPT追踪模式 \n", "0x00A9: 3.245 ADC参考电压 \n", "0x00AA: 0xFFFF 硬件版本 \n", "0x00AB: 0xFFFF 保留 \n", "0x00AC: 0xFFFF 保留 \n", "0x00AD: 0xFFFF 保留 \n", "0x00AE: 0xFFFF 保留 \n", "0x00AF: 0xFFFF 保留 \n", "0x00B0: SLCP101_250111_0800_V2.03 版本 \n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 00 00 38 45 E4 59 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 75 01 03 70 4C 53 50 43 30 31 5F 31 35 32 31 30 31 31 30 5F 30 38 5F 30 32 56 30 2E 00 33 00 00 00 00 00 00 56 50 2D 43 38 34 37 2D 30 30 44 2D 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 54 41 43 32 5F 30 34 32 36 5F 31 31 56 31 2E 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6F 74 73 70 6F 63 6D 6D 00 00 00 00 00 00 00 00 FD 43 D3 16\n", "Parse Result:\n", "0x0100: SLCP101_250111_0800_V2.03 版本(ODM)\n", "0x0110: PVC-48-700-DX 型号 \n", "0x0120: TCCA_240621_V1.16 载波芯片地址 \n", "0x0130: topscomm 厂商 \n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 01 70 00 30 45 F9 D6 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 65 01 03 60 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 30 33 32 35 34 37 36 39 38 41 30 43 42 45 44 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6E E4 AA 16\n", "Parse Result:\n", "0x0170: 01234567890ABCDEF SN \n", "0x0180: 01234567890ABCDEF MES \n", "0x0190: 01234567890ABCDEF Datetime\n" ] } ], "source": [ "# Read device parameters to verify restoration\n", "dev_lamina.frame_read(0x60, 0x60)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x100, 0x38)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x170, 0x30)\n", "time.sleep(0.5)\n", "\n", "# Restore parameters\n", "dev_lamina.frame_write_one(0x52, 0x01)\n", "time.sleep(6.5)\n", "\n", "# Read device parameters to verify restoration\n", "dev_lamina.frame_read(0x60, 0x60)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x100, 0x38)\n", "time.sleep(0.5)\n", "dev_lamina.frame_read(0x170, 0x30)\n", "time.sleep(0.5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 动态参数" ] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 1F 00 02 04 EC 77 FF FF 37 D9 9F 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 05 01 90 FF 0C 40 FA 16\n", "Write Result: \n", "0x001f:\t-5.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 1F 00 02 F5 CD DA 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 09 01 03 04 AE 5F 00 0A 6A CE 79 16\n", "Parse Result:\n", "0x001F: 699.999 并机功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 1F 00 02 04 EC 78 FF FF 07 DA 71 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 05 01 90 FF 0C 40 FA 16\n", "Write Result: \n", "0x001f:\t-5\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 1F 00 02 F5 CD DA 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 09 01 03 04 AE 5F 00 0A 6A CE 79 16\n", "Parse Result:\n", "0x001F: 699.999 并机功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 1F 00 02 04 EC 79 FF FF 56 1A 01 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 10 00 1F 00 02 70 0E D1 16\n", "Write Result: \n", "0x001f:\t-4.999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 1F 00 02 F5 CD DA 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 09 01 03 04 EC 79 FF FF 1E CA 75 16\n", "Parse Result:\n", "0x001F: -4.999 并机功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 1F 00 02 04 AE 5F 00 0A 22 1E 85 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 10 00 1F 00 02 70 0E D1 16\n", "Write Result: \n", "0x001f:\t699.999\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 1F 00 02 F5 CD DA 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 09 01 03 04 AE 5F 00 0A 6A CE 79 16\n", "Parse Result:\n", "0x001F: 699.999 并机功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 1F 00 02 04 AE 60 00 0A 12 12 6A 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 05 01 90 FF 0C 40 FA 16\n", "Write Result: \n", "0x001f:\t700\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 1F 00 02 F5 CD DA 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 09 01 03 04 AE 5F 00 0A 6A CE 79 16\n", "Parse Result:\n", "0x001F: 699.999 并机功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 0D 01 10 00 1F 00 02 04 AE 61 00 0A 43 D2 5C 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 05 01 90 FF 0C 40 FA 16\n", "Write Result: \n", "0x001f:\t700.001\tFail.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 1F 00 02 F5 CD DA 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 09 01 03 04 AE 5F 00 0A 6A CE 79 16\n", "Parse Result:\n", "0x001F: 699.999 并机功率限值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 53 00 01 B8 1B 21 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 53 00 01 B8 1B 4F 16\n", "设备重启完成,开始读取设备参数\n", "Discard Data: b'MICRO MONITOR 1.20.13\\r\\nPlatform: HC32F460\\r\\nCPU: HC32F460\\r\\nBuilt: Oct 31 2024 @ 22:55:07\\r\\nMonitor RAM: 0x1fff8448-0x1fff938c\\r\\nApplication RAM Base: 0x20010000\\r\\njump to app...\\r\\r\\n'\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 1F 00 02 F5 CD DA 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 09 01 03 04 AE 60 00 0A 5A C2 5E 16\n", "Parse Result:\n", "0x001F: 700.0 并机功率限值\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, dlen = 0x1F, 2\n", "vmin, vmax, vacc = -5, 700, 0.001\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)\n", "dev_lamina.frame_write_one(0x53, 0x01)\n", "time.sleep(4.5)\n", "print(\"设备重启完成,开始读取设备参数\")\n", "dev_lamina.frame_read(addr, dlen)" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 67 00 04 F5 D6 2D 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 0D 01 03 08 01 CC 02 3A 01 A4 02 44 C0 BC A2 16\n", "Parse Result:\n", "0x0067: 46.0 最小启动输出电压\n", "0x0068: 57.0 最大启动输出电压\n", "0x0069: 42.0 最小停止输出电压\n", "0x006A: 58.0 最大停止输出电压\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 21 01 A3 98 29 80 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 21 01 A3 98 29 AE 16\n", "Write Result: \n", "0x0021:\t41.9\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 21 00 01 D4 00 ED 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 07 01 03 02 01 A4 B8 6F F2 16\n", "Parse Result:\n", "0x0021: 42.0 输出限功率电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 21 01 A4 D9 EB 84 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 21 01 A4 D9 EB B2 16\n", "Write Result: \n", "0x0021:\t42\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 21 00 01 D4 00 ED 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 07 01 03 02 01 A4 B8 6F F2 16\n", "Parse Result:\n", "0x0021: 42.0 输出限功率电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 21 01 A5 18 2B 04 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 21 01 A5 18 2B 32 16\n", "Write Result: \n", "0x0021:\t42.1\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 21 00 01 D4 00 ED 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 07 01 03 02 01 A5 79 AF F4 16\n", "Parse Result:\n", "0x0021: 42.1 输出限功率电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 21 02 43 99 51 4A 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 21 02 43 99 51 78 16\n", "Write Result: \n", "0x0021:\t57.9\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 21 00 01 D4 00 ED 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 07 01 03 02 02 43 F8 D5 38 16\n", "Parse Result:\n", "0x0021: 57.9 输出限功率电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 21 02 44 D8 93 CC 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 21 02 44 D8 93 FA 16\n", "Write Result: \n", "0x0021:\t58\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 21 00 01 D4 00 ED 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 07 01 03 02 02 44 B9 17 3C 16\n", "Parse Result:\n", "0x0021: 58.0 输出限功率电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 21 02 45 19 53 CE 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 21 02 45 19 53 FC 16\n", "Write Result: \n", "0x0021:\t58.1\tSuccess.\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 21 00 01 D4 00 ED 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 07 01 03 02 02 44 B9 17 3C 16\n", "Parse Result:\n", "0x0021: 58.0 输出限功率电压阈值\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 06 00 53 00 01 B8 1B 21 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 08 01 06 00 53 00 01 B8 1B 4F 16\n", "设备重启完成,开始读取设备参数\n", "Discard Data: b'MICRO MONITOR 1.20.13\\r\\nPlatform: HC32F460\\r\\nCPU: HC32F460\\r\\nBuilt: Oct 31 2024 @ 22:55:07\\r\\nMonitor RAM: 0x1fff8448-0x1fff938c\\r\\nApplication RAM Base: 0x20010000\\r\\njump to app...\\r\\r\\n'\n", "Send Frame: 68 AA AA AA AA AA AA 68 1F 08 01 03 00 21 00 01 D4 00 ED 16\n", "Read Frame: 68 89 88 88 88 88 01 68 9F 07 01 03 02 02 35 79 33 09 16\n", "Parse Result:\n", "0x0021: 56.5 输出限功率电压阈值\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "addr, dlen = 0x21, 1\n", "vmin, vmax, vacc = 42, 58, 0.1\n", "dev_lamina.frame_read(0x67, 0x04)\n", "for value in [vmin-vacc, vmin, vmin+vacc, vmax-vacc, vmax, vmax+vacc]:\n", " time.sleep(0.5)\n", " result = dev_lamina.frame_write(addr, dlen, value)\n", " print(f\"Write Result: \\n0x{addr:04x}:\\t{value}\\t{'Success' if result else 'Fail'}.\")\n", " time.sleep(0.5)\n", " dev_lamina.frame_read(addr, dlen)\n", "dev_lamina.frame_write_one(0x53, 0x01)\n", "time.sleep(4.5)\n", "print(\"设备重启完成,开始读取设备参数\")\n", "dev_lamina.frame_read(addr, dlen)" ] } ], "metadata": { "kernelspec": { "display_name": "test", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.6" } }, "nbformat": 4, "nbformat_minor": 2 }