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

Design of SCPI Command Interpreter Based on Python

在线阅读下载全文

作  者:周子天 叶卫东[1] ZHOU Zi-tian;YE Wei-dong(School of Automation Science and Electrical Engineering,Beihang University,Beijing 100191,China)

机构地区:[1]北京航空航天大学自动化科学与电气工程学院

出  处:《测控技术》2019年第5期62-66,71,共6页Measurement & Control Technology

摘  要:目前可编程仪器标准命令(SCPI)依然被广泛使用,因此设计一个高效通用的SCPI命令解释器很重要。常用的SCPI命令解释器多以C语言开发,采用链式二叉树等存储结构,多有如解析效率低、通用性差、不识别等效命令等缺点。因此提出一种基于Python语言的设计。相比于常用的链式二叉树或顺序存储等结构,本设计提出一种基于Python字典结构的新型存储结构,减少了解析时的查询次数,提高了解析效率。而针对常用SCPI命令解释器通用性差的缺点,本设计提出以XML文档描述SCPI命令树,在启动时动态加载进内存的方式提高了解释器的通用性。同时,由于Python跨平台的特性,所设计的SCPI命令解释器也拥有良好的跨平台特性,适于在各平台下工作。Nowadays, standard commands for programmable instruments(SCPI) is still widely used, so, it is important to design an efficient and general SCPI command interpreter. The commonly used SCPI command interpreters are mostly developed in C language, and adopts the storage structure of chain binary tree. It has many disadvantages such as low resolution efficiency, poor universality and unrecognized equivalent command. Therefore, a design based on Python language is proposed. Compared with the common chained binary tree or sequential storage structure, a new storage structure based on Python dictionary is proposed, which reduces the number of queries in resolution and improves the resolution efficiency. In order to overcome the disadvantage of poor generality of common SCPI command interpreters, the SCPI command tree is described with XML document, and the generality of the interpreter is improved by loading it into memory dynamically at startup. At the same time, due to the cross platform characteristics of Python, the designed SCPI command interpreter also has good cross platform characteristics and is suitable for working under all platforms.

关 键 词:PYTHON SCPI 解释器 可程控仪器 

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

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

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