APP下载

基于静态链表SCPI解析系统设计

2016-01-13赵云

电子科技 2015年12期

基于静态链表SCPI解析系统设计

赵云

(桂林电器科学研究院有限公司 研发中心,广西 桂林541004)

摘要针对传统的SCPI解释方式占用过多内存,制约了在嵌入式系统上的应用,文中设计了一种方便移植和扩展的SCPI语言解析方法。该种方法用静态链表的结构来保存SCPI命令集,通过这种方法建立的SCPI解析模块,占用内存少,且方便移植和扩展。利用文中方法设计的SCPI解析模块可方便应于各种智能程控仪器,并适用在嵌入式系统下工作。

关键词SCPI;静态链表;程控仪器

收稿日期:2015-04-22

作者简介:赵云(1982—),男,硕士,工程师。研究方向:嵌入式测控。E-mali:26532401@qq.com

doi:10.16180/j.cnki.issn1007-7820.2015.12.031

中图分类号TN314文献标识码A

SCPI Parsing Based on Static Linked List

ZHAO Yun

(R & D Center,Guilin Electric Apparatus Research Institute Co.,Ltd.,Guilin 541004,China)

AbstractThis paper designs a convenient transplantation and extension of SCPI language parsing method.This method saves the SCPI command set with static chain table structure.The SCPI parsing module established by this method,enjoys little memory consumption and convenient transplant and extension.This method can be applied to various intelligent programmable instruments and work under the applicable in embedded systems.

KeywordsSCPI;static linked list;programmable instruments

SCPI(The Standard Commands for Programmable Instruments)是一种标准化的控制仪器语言,但传统的SCPI解释方式占用太多的内存资源,制约了在嵌入式系统上的应用。因此,减少SCPI解析系统占用的资源,是降低通用仪器实现智能化和可编程化成本的关键[1]。本文针对程控仪器的SCPI命令集,设计和研究了一种新的SCPI解释方法,采用静态链表方式来构建SCPI命令树,减少了SCPI生成树对系统内存的占用,并提供了一种直观的修改和扩展SCPI命令集的设计方法。

1SCPI控制指令

SCPI基于IEEE488.2标准,但不局限于GPIB接口,其也可用于RS232C等总线,在与通讯物理连接成硬件无关的高层次上定义的程控语言[2-3]。可以缩短自动测试设备程序开发时间,保护设备制造者和使用者双方的软硬件投资,为一起控制和数据利用提供广泛兼容的编码环境。

2基于静态链表SCPI解析器的设计

SCPI解析器的功能是对接收到的命令字符串进行解析,将命令字符串翻译成为仪器可以识别的代码,一般分成两部分[4-6]:(1)SCPI命令集的建立和储存。……

登录APP查看全文