CN107885675A - A kind of program control command handling method of multifunctional measuring instrument - Google Patents
A kind of program control command handling method of multifunctional measuring instrument Download PDFInfo
- Publication number
- CN107885675A CN107885675A CN201711177786.4A CN201711177786A CN107885675A CN 107885675 A CN107885675 A CN 107885675A CN 201711177786 A CN201711177786 A CN 201711177786A CN 107885675 A CN107885675 A CN 107885675A
- Authority
- CN
- China
- Prior art keywords
- command
- order
- program control
- scpi
- function
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/102—Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
- Testing Or Calibration Of Command Recording Devices (AREA)
Abstract
The invention discloses a kind of program control command handling method of multifunctional measuring instrument; belong to Electronic Testing Technology field; the present invention measures the demand of the program control order of function for multi-mode more; propose it is a kind of with expand and compatible SCPI specifications SCPI orders; decompose the SCPI orders of analysis difference in functionality; by multithreading plus critical zone protect seize common command buffering area in a manner of; command analysis speed is at utmost ensure that, while avoids the uncertainty for the instrument state that this mode of the more command buffers of multiport is brought;On the basis of the standard SCPI command syntax formats, the more measurement command function forms of expanded definition, solve the problems, such as to order between more set command sets how to distinguish well;The mode mapped based on menu ID and program control ID, realizes the processing of program control order, the function treatment for solving two kinds of parameter sources.Written in code amount is greatly reduced, has simplified software size.
Description
Technical field
The invention belongs to Electronic Testing Technology field, and in particular to a kind of program control command process side of multifunctional measuring instrument
Method.
Background technology
With modern network test and the continuous development of system integration technology, the application of remote control measurement is gradually extensive,
Programmable function is the essential important interface functional module of all universal testers, such as by taking signal source analyzer as an example,
It possesses six big measurement functions:Frequency power measurement, phase noise measurement, spectrum monitoring, transient response measurement, baseband noise are surveyed
Amount and AM noise measurement, independently, a variety of measurement functions just need supporting realization to cover SCPI command histories to each function more,
Increasing for command history can bring about following problem:How to be distinguished in hundreds and thousands of orders and measure function belonging to program control order
Classification;Each measurement command function collection how from different programmable interface receiving or sending thread linkage works, realize command analysis;And such as
What solves a variety of measurement functions and repeats maintenance menu/command parameter and menu/command process letter at user interface, program control two aspect
A large amount of code redundancies caused by number;
Existing implementation is:
Traditional treatment method:
Traditional processing method is that traditional stored program controlled structure is realized using single thread mode, the transmission of program control message, solution
The passback of analysis, processing and request response is all the serial execution that single performs.
(1) GPIB transmission units transmit program control message character string and be stored in GPIB buffering areas (2) message preprocessor from
Taken out in GPIB buffering areas after program control message character string (3) isolates N bar orders and deliver to command buffer (4) command analysis device
Order is taken out from command buffer one by one, command process unit indexes corresponding command processing function to life according to order ID
Order is handled;If querying command, command processing result will send GPIB transmission units in the form of response character string;
Above-mentioned processing procedure is to perform successively in a serial fashion, and the program control order that function is measured just for single is carried out
Processing is parsed and performed, considers problem of implementation program control under a variety of measurement functions in traditional design.Therefore for more work(
Energy the program control of measuring instrument has certain limitation.
Program serial manner performs easy realization successively, and interaction is got up fairly simple, but is not played more
The advantage of thread multitask, therefore than relatively low in efficiency.In addition, traditional mode for program control design be one closing be
System, the program control order for response need individually designed program control power function, perform program control operation.
The shortcomings that prior art:
The shortcomings that traditional display modes:
(1) traditional program control command process mode is the design for single measurement function, it is desirable in strict conformity with SCPI specifications
Regulation, the compatibility of more measurement functional requirements is not considered, will be unable to identify for the grammer of more measurement functions, therefore for
Follow-up processing is with regard to helpless.
(2) for complete machine software and SCPI orders, traditional approach in realization, typically in order to keep respective
Independent, the loose coupling between code, is typically to realize two sets of call functions, and this method is realized simply, but such case meeting
Code redundancy is caused, and when setting hardware state, easily goes out present condition and inconsistent situation is set, not the secondary work of easy care
With.
(3) traditional program control command process mode is to perform easy realization successively in a serial fashion, and interaction is got up
It is fairly simple, but the advantage of multi thread and multi task is not played, therefore than relatively low in efficiency.
The content of the invention
For above-mentioned technical problem present in prior art, the present invention proposes a kind of program control life of multifunctional measuring instrument
Processing method is made, it is reasonable in design, the deficiencies in the prior art are overcome, there is good effect.
To achieve these goals, the present invention adopts the following technical scheme that:
A kind of program control command handling method of multifunctional measuring instrument, specifically comprises the following steps:
Step 1:In program control working condition, instrument side runs Lan threads, USB line journey, GPIB threads, COM lines simultaneously
Journey, four command process threads persistently detect LAN buses, usb bus, gpib bus, whether there is command number on com server
According to;If order data be present, respective buffering area is put it into, enters line command preanalysis;
Step 2:By order preanalysis from grammer queue by first in first out order extract every order after be put into it is public
Order receives buffering area;
Step 3:Each order in grammer queue is parsed successively by command process thread, by SCPI orders
It is decomposed into generic command and subsystem command;
Step 4:Command functions are directly performed by generic command;
Step 5:Subsystem command is divided into common setting command, querying command and data block storage order, these three sons
System command decomposes to obtain final order ID and command parameter.
Advantageous effects caused by the present invention:
(1) compared to the work in series mode of traditional approach, the present invention adds what critical zone protected to seize public affairs using multithreading
Altogether command buffer mode, at utmost ensure that command analysis speed, at the same avoid the more command buffers of multiport this
The uncertainty for the instrument state that kind mode is brought;
(2) for compared to the measuring command parsing of the simple function of traditional approach, the present invention is based on standard SCPI orders
On the basis of syntax format, the more measurement command function forms of expanded definition, well solve and to order such as between more set command sets
The problem of what is distinguished;
(3) for the design of system that two sets of closings are realized compared to traditional approach menu function and programmable function, this hair
The bright mode mapped based on menu ID and program control ID, realizes the processing of program control order, at the function of solving two kinds of parameter sources
Reason.Written in code amount is greatly reduced, has simplified software size.
Brief description of the drawings
Fig. 1 is more measurement program control analytic method flow charts of function.
Fig. 2 is the schematic diagram of command mapping.
Embodiment
Below in conjunction with the accompanying drawings and embodiment is described in further detail to the present invention:
1st, function SCPI command analysis methods are measured more
How the program control part of multifunctional measuring instrument realizes that more measurement command functions are received and parsed, so as to realize and use
Family interface equity function, user's complete machine state is set, then by further parameter adjustment, it is determined that final overall measurement shape
State.The present invention realizes more program control parsing parts of measurement function using following conceptual design, as shown in Figure 1:
Learnt by accompanying drawing, in program control working condition, instrument side run simultaneously Lan threads, USB line journey, GPIB threads,
COM threads, four threads persistently detect LAN buses, usb bus, gpib bus, whether have order data biography on com server
Send, the information exchange with control person is handled in a manner of interruption, if order data be present, put it into respective buffering area, enter
Line command preanalysis, order preanalysis are extracted every order by first in first out order from grammer queue, are put into after parsing
Common command receives buffering area, and each order that command process thread performs in command queue successively carries out command analysis, will
SCPI orders are decomposed into generic command, subsystem command, and generic command is directly performed, and subsystem command is divided into common setting
Order, querying command, data block storage order, these three subsystem commands decompose to obtain final order ID and command parameter.
(1) order preanalysis
The program control screening and the separation of SCPI command formats to measuring instrument are realized in order preanalysis.Correct parsing is being transmitted across
In journey it is possible that transmission mistake (such as:Keyword mistake, number of parameters, parameter data type mismatch, parameter break bounds
Deng).If measuring instrument can not solve these problems well, it will be unable to realize specified function, in some instances it may even be possible to can cause to measure
The collapse of instrument.Therefore, it is necessary to being parsed by the data received by communication interface and program control command information, it is judged
Legitimacy, extract effective instruction and corresponding parameter.On the other hand, the order that instrument remote control uses, generally all foundations
SCPI Specification Designs.SCPI specification defined orders are by keyword, additional character (colon, branch, blank character etc.) and order
Attribute forms.Accordingly, each SCPI orders can be decomposed progressively in particular manner, obtain all information of order.Life
Order parsing and processing module, using special data structure, realize the parsing and processing of order based on SCPI specifications.
(2) write common command and receive buffering area
After the completion of order preanalysis by lawful order in the way of first in first out (FIFO), common command is arrived in storage successively
Receive buffering area, in order to return to the Query Information of querying command in the future, also simultaneously to deposit the port-mark for sending order in the lump
Storage.Increase critical zone to ensure the independent occupancy to FIFO resources, otherwise can be produced not when multiple programs access FIFO simultaneously
Predictable consequence.In the present invention, all program control threads store order successively by the way of seizing, advantage of this is that:
Realize multiple program control ports while work, at utmost ensure that command analysis speed.This multithreading adds critical zone to protect
The mode for seizing common command buffering area, at utmost ensure that command analysis speed, at the same avoid multiport more order
The uncertainty for the instrument state that this mode of buffering area is brought.
(3) command analysis
The measurement Function Identification obtained according to pre-parsed part, finds corresponding command tree, and according to syntax rule, first area
Point order belongs to generic command (* beginnings), or subsystem command (:Beginning), it is further to be located into different branches
Reason, SCPI code requirements can both be ordered with querying command or data block storage, can also be common setting command.
Generic command:Generic command is defined by IEEE 488.2, is deposited for managing grand, status register, synchronization and data
Storage.They are by an asterisk, therefore it is easy to recognize.Such as * IDN, * OPC, * RST be all generic command.It is general
Order is not belonging to any subsystem, and multifunctional measuring instrument establishes single command tree for generic command, if general life
Order, then directly handled.
Querying command:Conversion output order ID and and command parameter, and return to Query Information to corresponding port.
Common setting command:Common setting command belongs to subsystem command, is parsed according to multi-functional command tree, changes
Output order ID and and command parameter, and mapped according to ID and command parameter, complete machine state be set, work(is realized according to it
Can, two classes are divided into again:Measure related command and measurement Independent Command.Measurement Independent Command refers to, does not influence current measurement ginseng
Number state, is not involved in measurement process, does not influence complete machine hardware state.Measuring related command influences current overall measurement parameter shape
State, after typically receiving this order, to restart new measurement according to the new overall measurement state of the current command setting
Process.
Data block storage order:The data of data block storage order are very big, decomposite the ID and parameter of long data block order
With individually handled.Data block command includes data block setting command and data block storage order.Need according to command analysis
Result handled.Another special circumstances is the Associate Command that a plurality of data block storage command in combination forms.Foundation
SCPI specifications, branch represent the end of an order, in addition, can also be by branch interval between two orders, this two lives
Order is referred to as Associate Command.The processing of Associate Command is command analysis key problems-solving, it is necessary to change order when running into branch
Associated code, the current command is write into buffering area, according to the command parameter of parsing set receive buffering area effective length, then
Continue to read other orders;Then the ID and parameter of long data block order are decomposed, triggers the execution of function interface.
2nd, measurement command function mapping more
According to the discussion of previous section, the input for learning programmable interface part is SCPI orders, and output is solved by order
Obtained order ID and command parameter are analysed, and by front panel/keyboard/mouse, user interface is set, and is finally given
Menu ID and menu parameter, these information all directly determine user's complete machine state.So order ID and command parameter, menu
ID and menu parameter, channel can be received by different information, multifunctional measuring instrument parameter state is set, and the most frequently used is exactly
Standard SCPI orders are received by programmable interface and have just corresponded to one by UI Preferences menu parameter, often an order
Series menu operates obtained menu parameter, and this also explains why programmable interface and user interface are in user interface software module
In be in reciprocity functional location.In brief, Subscriber Interface Module SIM by receive the information from different channels, output order/
Menu ID and order/menu parameter set user's complete machine state, and then new overall measurement state is determined by parameter adjustment,
To start new measurement task.So be achieved that in polymeter device software frame from information reception → state adjustment →
Parameter transmission → implementation measurement, is connected to this complete task.
From the point of view of specific coding, order/menu ID corresponded in order/menu processing function overall situation array some is specific
Power function, by order/menu parameter of acquisition, carry out a series of follow-up tasks since being set user's complete machine state.
Often in practical operation, the function of the order realization in the SCPI command histories in program control handbook, it can be transferred through operating substantially
Interface menu is completed, in short, the code of the order of said function/menu processing function is consistent in realization.If
Each safeguard that a set of power function of oneself is realized in remote control and this control, this certainly simplest solution method, but this is not
It is most effective, because a problem can be brought:Number of commands is bigger, number of menus is more, level is deeper, then can produce big
The code redundancy of amount, then, the program code amount of the user interface part of a variety of measurement functions is well imagined.In order to solve
This problem, solves this problem by the way of command mapping in multifunctional measuring instrument, i.e., only in user interface portion
Safeguard a set of menu function Function Array, by mapping algorithm, will order ID and command parameter be mapped to corresponding to menu ID and
Menu parameter, some specific power function in menu function Function Array is found by menu ID, realizes command process, this
Sample only need to be changed once, just solve the function treatment in two kinds of parameter sources.Actual test achieves good effect, subtracts significantly
Lack written in code amount, simplify software size.The mode of command mapping is as shown in Figure 2:
3rd, function SCPI command sets extensions are measured more
In multifunctional measuring instrument, except generic command as defined in the standards of IEEE 488.2 and each pattern synergic system are ordered
Order, in order to distinguish the SCPI orders of different measurement functions, measurement Function Identification word is expanded on subsystem command normative foundation
Section, following command format:
:Subsystem title:Measure function [1-N]:Command field 1 ...:Command field N [parameter [list]]
Wherein, " measurement function [1-N] " field is the measurement Function Identification field of extension, by the English of measurement function title
The uppercase format and the window label composition of bracket part that text is write a Chinese character in simplified form, measurement of such as mutually making an uproar is " PN [1-1] ", so, multi-functional
Measuring instrument SCPI command syntax formats not only conform with SCPI ordering norms requirements, have also been easily carried out a variety of measurement functions
The differentiation parsing of order.Order illustrates as shown in table 1:
The multifunctional measuring instrument SCPI command specifications of table 1
Illustrate::CALCulate:PN[1-1]:TRACe[1-1]:ALLMarker:ACTive<numeric>.
The order is used for the activity frequency marking for setting the track 1 for measurement of mutually making an uproar.Wherein, CALCulate is computing subsystem, is somebody's turn to do
Class subsystem command is mainly used in completing:The calculating of measurement result data, frequency marking, cursor setting/calculating etc.;PN [1-1] is represented
Mutually make an uproar measurement function;TRACe[1-1]:ALLMarker:ACTive is command functions field, represents the activity frequency of selection track 1
Mark;Parameter<numeric>Scope:1~10, the value deputy activity frequency marking call number.
Certainly, described above is not limitation of the present invention, and the present invention is also not limited to the example above, this technology neck
The variations, modifications, additions or substitutions that the technical staff in domain is made in the essential scope of the present invention, it should also belong to the present invention's
Protection domain.
Claims (1)
- A kind of 1. program control command handling method of multifunctional measuring instrument, it is characterised in that:Specifically comprise the following steps:Step 1:In program control working condition, instrument side runs Lan threads, USB line journey, GPIB threads, COM threads simultaneously, and four Individual command process thread persistently detects LAN buses, usb bus, gpib bus, whether there is order data on com server;If Order data be present, then put it into respective buffering area, enter line command preanalysis;Step 2:Common command is put into after extracting every order by first in first out order from grammer queue by order preanalysis Receive buffering area;Step 3:Each order in grammer queue is parsed successively by command process thread, SCPI orders are decomposed For generic command and subsystem command;Step 4:Command functions are directly performed by generic command;Step 5:Subsystem command is divided into common setting command, querying command and data block storage order, these three subsystems Order decomposition obtains final order ID and command parameter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711177786.4A CN107885675B (en) | 2017-11-23 | 2017-11-23 | Multifunctional measuring instrument program control command processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711177786.4A CN107885675B (en) | 2017-11-23 | 2017-11-23 | Multifunctional measuring instrument program control command processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107885675A true CN107885675A (en) | 2018-04-06 |
CN107885675B CN107885675B (en) | 2019-12-27 |
Family
ID=61774658
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711177786.4A Active CN107885675B (en) | 2017-11-23 | 2017-11-23 | Multifunctional measuring instrument program control command processing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107885675B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110058855A (en) * | 2019-03-26 | 2019-07-26 | 东软医疗系统股份有限公司 | A kind of interface of software and update method, device and the equipment of workflow |
CN111338605A (en) * | 2020-02-17 | 2020-06-26 | 公安部第一研究所 | Method for automatically executing instrument function development and operation flow |
CN113409780A (en) * | 2021-06-09 | 2021-09-17 | 中电科思仪科技股份有限公司 | Voice control system and method applied to measuring instrument |
CN113703836A (en) * | 2021-08-20 | 2021-11-26 | 北京空间飞行器总体设计部 | SCPI instruction management method for spacecraft power system evaluation |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030191866A1 (en) * | 2002-04-03 | 2003-10-09 | Gilbert Wolrich | Registers for data transfers |
CN103593228A (en) * | 2013-11-12 | 2014-02-19 | 中国电子科技集团公司第四十一研究所 | Practical test instrument program control command emulator and application method thereof |
CN103631567A (en) * | 2009-05-28 | 2014-03-12 | 松下电器产业株式会社 | Multithread processor, compiler apparatus, and operating system apparatus |
CN104391190A (en) * | 2014-10-10 | 2015-03-04 | 中国电子科技集团公司第四十一研究所 | Remote diagnosis system for measuring instrument and diagnosis method thereof |
-
2017
- 2017-11-23 CN CN201711177786.4A patent/CN107885675B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030191866A1 (en) * | 2002-04-03 | 2003-10-09 | Gilbert Wolrich | Registers for data transfers |
CN103631567A (en) * | 2009-05-28 | 2014-03-12 | 松下电器产业株式会社 | Multithread processor, compiler apparatus, and operating system apparatus |
CN103593228A (en) * | 2013-11-12 | 2014-02-19 | 中国电子科技集团公司第四十一研究所 | Practical test instrument program control command emulator and application method thereof |
CN104391190A (en) * | 2014-10-10 | 2015-03-04 | 中国电子科技集团公司第四十一研究所 | Remote diagnosis system for measuring instrument and diagnosis method thereof |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110058855A (en) * | 2019-03-26 | 2019-07-26 | 东软医疗系统股份有限公司 | A kind of interface of software and update method, device and the equipment of workflow |
CN110058855B (en) * | 2019-03-26 | 2023-09-05 | 沈阳智核医疗科技有限公司 | Method, device and equipment for updating interface and workflow of software |
CN111338605A (en) * | 2020-02-17 | 2020-06-26 | 公安部第一研究所 | Method for automatically executing instrument function development and operation flow |
CN111338605B (en) * | 2020-02-17 | 2023-09-05 | 公安部第一研究所 | Method for automatically executing instrument function development and operation flow |
CN113409780A (en) * | 2021-06-09 | 2021-09-17 | 中电科思仪科技股份有限公司 | Voice control system and method applied to measuring instrument |
CN113703836A (en) * | 2021-08-20 | 2021-11-26 | 北京空间飞行器总体设计部 | SCPI instruction management method for spacecraft power system evaluation |
Also Published As
Publication number | Publication date |
---|---|
CN107885675B (en) | 2019-12-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107885675A (en) | A kind of program control command handling method of multifunctional measuring instrument | |
CN108667725A (en) | A kind of industrial AnyRouter and implementation method based on a variety of accesses and edge calculations | |
CN101292867B (en) | Physiological multi-parameter remote monitoring system based on B/S structure | |
CN101893662B (en) | Nuclear phase method for digital transformer substation | |
US20070061786A1 (en) | Methods and apparatus for modifying process control data | |
CN104506376B (en) | A kind of multi-channel redundant formula CAN test system with frame starting sensitive control Trigger Function | |
CN102932195B (en) | A kind of business diagnosis method for supervising of protocal analysis Network Based and system | |
CN102867274A (en) | Management and graphical display system for intelligent substation SCL (substation configuration description language) configuration files | |
CN101394267B (en) | Security information management system and method based on general normalized labeling language | |
CN105357077B (en) | The serial data processing unit and method of more equipment | |
CN104184745A (en) | Intelligent front-end equipment communication system | |
CN109298882A (en) | Management method, computer readable storage medium and the terminal device of interface | |
CN112069176B (en) | Database design method, device and equipment of communication protocol and storage medium | |
CN108255837A (en) | A kind of SQL resolvers and method | |
CN102223452A (en) | Method and system for testing text telephone (TTY) of mobile terminals | |
CN110275470A (en) | A kind of configurable remote data collection system being applicable in various working | |
CN201797372U (en) | Nuclear phase system for intelligent digital transformer substation | |
CN202047868U (en) | On-line mine dust monitoring system based on OPC (Organic Photoconductor) | |
CN204288199U (en) | Printing device LPT data virtual system | |
CN110531307A (en) | Adjustment method, device and the electric power acquisition terminal of electric power acquisition terminal | |
CN110535972A (en) | A kind of the coal gas detection equipment centralized management and communication system, equipment and readable storage medium storing program for executing of hardware and software platform | |
CN110073302A (en) | Information processing unit, the control method of information processing unit and control program | |
Qiu et al. | Daq-middleware: Data acquisition middleware based on internet of things | |
Chu et al. | Human Resource Social Insurance Data Dynamic Update System Based on Wireless Communication | |
CN209728823U (en) | A kind of community's supervisory systems based on Internet of Things |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220609 Address after: 266555 No. 98 Xiangjiang Road, Huangdao District, Qingdao City, Shandong Province Patentee after: CLP kesiyi Technology Co.,Ltd. Address before: 266555 No. 98 Xiangjiang Road, Qingdao economic and Technological Development Zone, Shandong Patentee before: THE 41ST INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY Group Corp. |