基于Python的SCPI命令解释器设计与优化  被引量:4

Design and Optimization of SCPI Command Interpreter Based on Python

在线阅读下载全文

作  者:潘琦 陈晗 曹炳尧[1] 李迎春[1] Pan Qi

机构地区:[1]上海大学特种光纤与光接入网重点实验室,上海200072

出  处:《工业控制计算机》2020年第6期75-78,共4页Industrial Control Computer

基  金:上海市科委项目(18511103400)。

摘  要:自动化测试系统将众多测试仪表通过统一的软硬件标准接口相连,以简化管理、编写测试用例的复杂过程,对于测试系统的搭建和使用来说是极大的便利,因此将传统的测量仪器转化成为支持可编程仪器标准命令(SCPI)的可程控测量仪器是很有必要的。然而仪表中普遍支持的SCPI命令的集成和实现依赖复杂的语法解析和命令搜索,传统的SCPI解释器设计复杂,开发难度高,通用性差,命令解析的准确性和命令搜索的效率都很低,对仪表开发者带来不便。设计了一款高效且通用的SCPI解释器,该解释器基于Python语言,对SCPI命令使用Lark库进行命令解析,高效且准确。命令搜索使用的命令树则以XML文档的形式呈现,在仪器启动时以Python的字典存储结构加载入内存中,减少查询次数提高查询效率。The automatic test system connects many test instruments through a unified software and hardware standard interface to simplify the complex process of managing and writing test cases.It is a great convenience for the construction and use of the test system.Therefore,the traditional measurement instruments are transformed Programmable measurement instruments that support the Standard Commands for Programmable Instruments(SCPI)are necessary.However,SCPI command support relies on complex syntax parsing and command search.The traditional interpreter design is complex,development is difficult,and the versatility is poor.The accuracy of command parsing and the efficiency of command search are very low.A universal SCPI interpreter,which is based on Python and uses the Lark library to parse SCPI command strings read by the instrument efficiently and accurately.The command tree is presented in the form of an XML document,which is loaded into memory using Python’s dictionary storage structure when the instrument is started up,reducing the number of queries and improving query efficiency.

关 键 词:SCPI PYTHON 命令解析 命令树 

分 类 号:TP311.52[自动化与计算机技术—计算机软件与理论] TP216[自动化与计算机技术—计算机科学与技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象