当前位置:网站首页>RS&FSW测试脚本
RS&FSW测试脚本
2022-08-09 00:47:00 【洪大宇】
# python script created by FSW: 08:08:2022 07:45:32
import pyvisa as visa
def write_command(instrument, command):
instrument.write(command)
return process_system_error(instrument)
def write_query(instrument, command):
buffer = instrument.query(command)
bSuccess = process_system_error(instrument)
return bSuccess, buffer
def process_system_error(instrument):
bSuccess = True
EsrErrorMask = 0x3C
if ((get_esr(instrument) & EsrErrorMask) != 0):
print(instrument.query(":SYST:ERR?"))
instrument.write("*CLS")
bSuccess = False
return bSuccess
def get_esr(instrument):
esr = instrument.query("*ESR?")
return int(esr)
VisaResourceManager = visa.ResourceManager()
# connect to analyzer
Analyzer = VisaResourceManager.open_resource(
"TCPIP::192.168.1.88::inst0::INSTR")
success = write_command(Analyzer, "*RST")
success = write_command(Analyzer, "*CLS")
success = write_command(Analyzer, ":SYST:DISP:UPD ON")
success = write_command(Analyzer, ":INIT:CONT OFF")
success = write_command(Analyzer, ":SENS:FREQ:CENT 3434640000")
success = write_command(Analyzer, ":SENS:FREQ:SPAN 10000000")
success = write_command(Analyzer, ":CALC1:MARK1:STAT ON")
success = write_command(Analyzer, ":INIT:CONT ON")
# back to local mode
success = write_command(Analyzer, "@LOC")
# cleanup
Analyzer.close()
VisaResourceManager.close()
边栏推荐
- 图像超分辨率重建概述
- CondConv--动态卷积思想
- Using MySQL in Ubuntu/Linux environment: Modify the database sql_mode to solve the "this is incompatible with sql_mode=only_full_group_by" problem
- JSON basics, transfer JSON data, and introduce four mainstream frameworks, jackson, gson, fastjson, and json-lib!
- LeetCode每日一题(481. Magical String)
- 2021 icpc 上海 H. Life is a Game
- Node.js:MySQL.js的基本操作增删改查
- 对付流氓软件
- 轻量级CNN网络高效设计准则-ShuffleNet v2学习记录
- 自考成绩总结
猜你喜欢
笔记&代码 | 统计学——基于R(第四版) 第九章一元线性回归
容器运维平台的故障处理-1
Discourse 的关闭主题(Close Topic )和重新开放主题
Using MySQL in Ubuntu/Linux environment: Modify the database sql_mode to solve the "this is incompatible with sql_mode=only_full_group_by" problem
低代码接口开发平台——YesApi(API+数据表单)
对付流氓软件
控件限制总结
Discourse 的关闭主题(Close Topic )和重新开放主题
「复盘」面试 BAMT 回来整理 398 道高频面试题,助你拿高薪 offer
在Ubuntu/Linux环境下使用MySQL:修改数据库sql_mode,可解决“this is incompatible with sql_mode=only_full_group_by”问题
随机推荐
自考成绩总结
Sencha Touch页面跳转创建返回上一级按钮的设计思路
LeetCode每日一题(481. Magical String)
插值拟合——数据处理或预测
bitset和bool哪个更快
Non-major graduates, five-faced Ali: Four rounds of technical + HR have already taken an offer
4-6 Matplotlib库 饼图
Sencha Touch页面跳转创建返回上一级按钮的设计思路
轻量级神经网络SqueezeNext--考虑硬件提速
torch.utils.data.DataLoader
数学模型建立常用方法
2021 icpc 上海 H. Life is a Game
Using MySQL in Ubuntu/Linux environment: Solve the problem of com.mysql.jdbc.PacketTooBigException: Packet for query is too large
一名双非程序媛面试蚂蚁、美团、携程等大厂拿 offer 分享面试过程
动态style定义背景渐变
mysql 批量修改表及字段字符集
轻量级网络SqueezeNet学习记录
Using MySQL in Ubuntu/Linux environment: Modify the database sql_mode to solve the "this is incompatible with sql_mode=only_full_group_by" problem
js中常用方法总结
【科研-学习-pytorch】5-boardcasting、合并分割