CN107450930A - A kind of development approach based on HMI system script - Google Patents

A kind of development approach based on HMI system script Download PDF

Info

Publication number
CN107450930A
CN107450930A CN201710692491.4A CN201710692491A CN107450930A CN 107450930 A CN107450930 A CN 107450930A CN 201710692491 A CN201710692491 A CN 201710692491A CN 107450930 A CN107450930 A CN 107450930A
Authority
CN
China
Prior art keywords
param1
param2
assigned
value
hmi system
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.)
Pending
Application number
CN201710692491.4A
Other languages
Chinese (zh)
Inventor
项天
王攀
李翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Express Mdt Infotech Ltd
Original Assignee
Shanghai Express Mdt Infotech Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Express Mdt Infotech Ltd filed Critical Shanghai Express Mdt Infotech Ltd
Priority to CN201710692491.4A priority Critical patent/CN107450930A/en
Publication of CN107450930A publication Critical patent/CN107450930A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/425Lexical analysis

Abstract

The invention discloses a kind of development approach based on HMI system script, using the language that can be pre-compiled as specific instruction, the script, which is easy to grasp, to be understood, the specific instruction set of generation can be compiled according to demand, and can easily extend new grammer, be suitable for the exploitation of HMI system, by the way that the script is run among specific HMI system, for substituting in HMI exploitations the directly development scheme of writing instruction, using simple, perform efficient.

Description

A kind of development approach based on HMI system script
Technical field
The invention belongs to HMI applied technical fields, are related to a kind of design and realization of HMI scripts, are specifically one kind Development approach based on HMI system script.
Background technology
Man-machine interface (Human-Machine Interface, HMI) is transmitted and interacted between user and machine Medium, the central various internal logics guaranteed replacement of man-machine interaction, can be referred to by a virtual machine to perform a series of inside Make to realize.
But what is instructed writes cumbersome and easily malfunction, and writing for script is simpler, and study is got up also more Add easily, in the development phase, using scripting language's programmed logic code, be then pre-compiled as corresponding instruction, can be significantly Raising development efficiency, and facilitate developer carry out error checking.
The content of the invention
It is an object of the invention to provide a kind of development approach based on HMI system script, use can be pre-compiled as The language of specific instruction, run among specific HMI system, for substituting the exploitation side that directly writing instructs in HMI exploitations Formula, using simple, perform efficient.
The purpose of the present invention can be achieved through the following technical solutions:
A kind of development approach based on HMI system script, comprises the following steps:
Step S1, using specific grammer standard, write HMI system scripted code;
Step S2, morphological analysis is carried out to the HMI system scripted code write in step S1 using lexical analyzer;
Step S3, according to the analysis result in step S2, produce corresponding instruction and be compiled as corresponding instruction set;
Step S4, caused instruction set in step S3 is stored in the memory of HMI system.Step S5, system fortune During row, instruction set compiled in memory is performed on demand.
Further, the specific syntax standard used in the step S1 includes basic statement and control flow statement two Essential part.
Further, the basic statement grammer is as follows:
a.var(param1,param1):A variable param1 is stated, and param1 value is entered as param2;
b.set(param1,parma2):Param1 value is assigned to param2;
c.setTag(param1):Param1 value is assigned to the tag of current component;
d.getTag(param1):The tag values of current component are obtained, and are assigned to param1;
e.print(param1,param2):By param1 and param2 printing displays;
f.add(param1,param1):Param1 value is added into param1, and is assigned to param1;
g.minus(param1,param2):Param1 value is subtracted into param1, and is assigned to param1;
h.multiply(param1,param2):Param1 value is multiplied by param2, and is assigned to param1;
i.divide(param1,param2):By param1 value divided by param2, and it is assigned to variable param1;
j.mod(param1,param2):By param1 to param2 remainders, and it is assigned to variable param1.
Further, the control flow statement grammer is as follows:
k.if(exp){statement1}else{statement2}:Exp is expression formula, and expression formula result is true, is performed Statement1 statement blocks, statement1 statement blocks are otherwise skipped, perform statement2 statement blocks;
l.while(exp){statement1}:Exp is expression formula, first determines whether expression formula, and IF expression result is Very, then loop body statement1 is performed, has performed statement1, program returns to test condition, and expression formula is carried out again Assess, loop body is performed again if result is very, until test result is false, then skip the journey of loop body execution below Sequence.
Beneficial effects of the present invention:The invention provides a kind of development approach based on HMI system script, using can The language of specific instruction is pre-compiled as, the script, which is easy to grasp, to be understood, can compile the specific instruction set of generation according to demand Close, and can easily extend new grammer, be suitable for the exploitation of HMI system, it is specific by the way that the script is run on HMI system among, for substituting in HMI exploitations the directly development scheme of writing instruction, using simple, perform efficient.
Embodiment
The technical scheme in the embodiment of the present invention is clearly and completely described below, it is clear that described embodiment Only part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, the common skill in this area All other embodiment that art personnel are obtained under the premise of creative work is not made, belong to the model that the present invention protects Enclose.
The invention provides a kind of development approach based on HMI system script, comprise the following steps:
Step S1, using specific grammer standard, write HMI system scripted code.
Wherein, specific grammer standard includes two essential parts of basic statement and control flow statement.
Wherein, basic statement grammer is as follows:
a.var(param1,param1):A variable param1 is stated, and param1 value is entered as param2. Param1 is the variable name of statement, and param2 can be integer value or variable name or propertystring.
b.set(param1,parma2):Param1 value is assigned to param2.Param1 can be variable name or attribute Character string, param2 can be integer value or variable name.
c.setTag(param1):Param1 value is assigned to the tag of current component.Param1 can be digital value or change Measure name.
d.getTag(param1):The tag values of current component are obtained, and are assigned to param1.Param1 is variable name.
e.print(param1,param2):By param1 and param2 printing displays.Param1 is variable name, param2 It is character string, as prompt message.
f.add(param1,param1):Param1 value is added into param1, and is assigned to param1.Param1 is variable Name, param2 can be integer value or variable name.
g.minus(param1,param2):Param1 value is subtracted into param1, and is assigned to param1.Param1 is Variable name, param2 can be integer value or variable name.
h.multiply(param1,param2):Param1 value is multiplied by param2, and is assigned to param1.param1 It is variable name, param2 can be integer value or variable name.
i.divide(param1,param2):By param1 value divided by param2, and it is assigned to variable param1. Param1 is variable name, and param2 can be integer value or variable name.
j.mod(param1,param2):By param1 to param2 remainders, and it is assigned to variable param1.Param1 is Variable name, param2 can be integer value or variable name.
Wherein, control flow statement grammer is as follows:
k.if(exp){statement1}else{statement2}:Exp is expression formula, and expression formula result is true, is performed Statement1 statement blocks, statement1 statement blocks are otherwise skipped, perform statement2 statement blocks.
l.while(exp){statement1}:Exp is expression formula, first determines whether expression formula, and IF expression result is Very, then loop body statement1 is performed, has performed statement1, program returns to test condition, and expression formula is carried out again Assess, loop body is performed again if result is very, until test result is false, then skip the journey of loop body execution below Sequence.
Following is the scripted code fragment using the specific grammer Standard compilation:
Its each sentence is explained as follows:
1. stating a variable a, and by mode (pattern) attribute of current component, it is assigned to a.
2. variable a value is arranged to integer 3.
3. a value is judged, if a>=100, then 4 are performed, otherwise performs 5.
4. the first layer layer of current component hidden attributes are arranged into 1, represent to hide the layer.
5. order performs 6.
6. the first layer layer of current component hidden attributes are arranged into 0, represent to show the layer.
7. terminate.
Step S2, morphological analysis is carried out to the HMI system scripted code write in step S1 using lexical analyzer.
Step S3, according to the analysis result in step S2, produce corresponding instruction and be compiled as corresponding instruction set.
A kind of instruction set generated after above-mentioned scripted code fragment compiling is as follows:
1. [temp ', ' a ', (type:' EXP ', value:′this.mode′}]
2. [' set ', (type:' ID ', value:' a ' }, (type:' Int ', value:′3′}]
3. [' lt ', (type:' ID ', value:' a ' }, [type:' Int ', value:′100′}]
4. [' jump ', ", 3]
5. [' set ', (type:' EXP ', value:' thls.layers.1.hidden ' }, { type:' Int ', value:′0′}]
6. [' jump ', ", 2]
7. [' set ', (type:' EXP ', value:' thls.layers.1.hidden ' }, { type:' Int ', value:′1′}]
8. [' end ', ", "]
Wherein, each bar instruction compiles by script.
Step S4, caused instruction set in step S3 is stored in the memory of HMI system.
Step S5, during system operation, instruction set compiled in memory is performed on demand.
The invention provides a kind of development approach based on HMI system script, use can be pre-compiled as specific instruction Language, the script, which is easy to grasp, to be understood, can compile the specific instruction set of generation according to demand, and can be convenient New grammer is extended, is suitable for the exploitation of HMI system, by the way that the script is run among specific HMI system, is used for The directly development scheme of writing instruction is substituted in HMI exploitations, using simple, is performed efficiently.
In the description of this specification, the description of reference term " one embodiment ", " example ", " specific example " etc. means At least one implementation of the present invention is contained in reference to specific features, structure, material or the feature that the embodiment or example describe In example or example.In this manual, identical embodiment or example are not necessarily referring to the schematic representation of above-mentioned term. Moreover, specific features, structure, material or the feature of description can close in any one or more embodiments or example Suitable mode combines.
Above content is only to structure example of the present invention and explanation, affiliated those skilled in the art couple Described specific embodiment is made various modifications or supplement or substituted using similar mode, without departing from invention Structure surmounts scope defined in the claims, all should belong to protection scope of the present invention.

Claims (4)

1. a kind of development approach based on HMI system script, it is characterised in that comprise the following steps:
Step S1, using specific grammer standard, write HMI system scripted code;
Step S2, morphological analysis is carried out to the HMI system scripted code write in step S1 using lexical analyzer;
Step S3, according to the analysis result in step S2, produce corresponding instruction and be compiled as corresponding instruction set;
Step S4, caused instruction set in step S3 is stored in the memory of HMI system.Step S5, during system operation, Instruction set compiled in memory is performed on demand.
A kind of 2. development approach based on HMI system script according to claim 1, it is characterised in that shown step The specific syntax standard used in rapid S1 includes two essential parts of basic statement and control flow statement.
A kind of 3. development approach based on HMI system script according to claim 2, it is characterised in that the base This statement syntax is as follows:
a.var(param1,param1):A variable param1 is stated, and param1 value is entered as param2;
b.set(param1,parma2):Param1 value is assigned to param2;
c.setTag(param1):Param1 value is assigned to the tag of current component;
d.getTag(param1):The tag values of current component are obtained, and are assigned to param1;
e.print(param1,param2):By param1 and param2 printing displays;
f.add(param1,param1):Param1 value is added into param1, and is assigned to param1;
g.minus(param1,param2):Param1 value is subtracted into param1, and is assigned to param1;
h.multiply(param1,param2):Param1 value is multiplied by param2, and is assigned to param1;
i.divide(param1,param2):By param1 value divided by param2, and it is assigned to variable param1;
j.mod(param1,param2):By param1 to param2 remainders, and it is assigned to variable param1.
A kind of 4. development approach based on HMI system script according to claim 2, it is characterised in that the stream Process control statement syntax is as follows:
k.if(exp){statement1}else{statement2}:Exp is expression formula, and expression formula result is true, is performed Statement1 statement blocks, statement1 statement blocks are otherwise skipped, perform statement2 statement blocks;
l.while(exp){statement1}:Exp is expression formula, first determines whether expression formula, IF expression result be it is true, then Loop body statement1 is performed, has performed statement1, program returns to test condition, expression formula is reappraised, Loop body is performed again if result is very, until test result is false, then skips the program of loop body execution below.
CN201710692491.4A 2017-08-14 2017-08-14 A kind of development approach based on HMI system script Pending CN107450930A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710692491.4A CN107450930A (en) 2017-08-14 2017-08-14 A kind of development approach based on HMI system script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710692491.4A CN107450930A (en) 2017-08-14 2017-08-14 A kind of development approach based on HMI system script

Publications (1)

Publication Number Publication Date
CN107450930A true CN107450930A (en) 2017-12-08

Family

ID=60491073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710692491.4A Pending CN107450930A (en) 2017-08-14 2017-08-14 A kind of development approach based on HMI system script

Country Status (1)

Country Link
CN (1) CN107450930A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1527195A (en) * 2003-03-07 2004-09-08 珠海市西山居软件有限公司 Scropt executing method for computer game
CN101145103A (en) * 2007-10-23 2008-03-19 张俊平 Pointing-reading machine system and its script drive method
CN106502640A (en) * 2016-09-19 2017-03-15 芯海科技(深圳)股份有限公司 A kind of method for explaining custom script burning

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1527195A (en) * 2003-03-07 2004-09-08 珠海市西山居软件有限公司 Scropt executing method for computer game
CN101145103A (en) * 2007-10-23 2008-03-19 张俊平 Pointing-reading machine system and its script drive method
CN106502640A (en) * 2016-09-19 2017-03-15 芯海科技(深圳)股份有限公司 A kind of method for explaining custom script burning

Similar Documents

Publication Publication Date Title
CN106371829B (en) Template framework design method and system based on modularization idea
CN103500087B (en) A kind of based on maven plug-in unit and the code generating method of freemarker template and device
CN104965750B (en) Rapidio switch logical simulation verification platforms and method based on Python
CN110187885A (en) A kind of the intermediate code generation method and device of the compiling of quantum program
CN106648662A (en) Engineering cost calculation description language BCL-based report generation device and generation method
CN104503793A (en) Method for running and graphically analyzing codes in code practicing software
CN105117210A (en) WSCN-oriented graphical programming system
CN107704382A (en) Towards Python function call path generating method and system
CN104820393B (en) One kind is based on PLC ladder diagram matrix compiling and interpreting methods
CN108920496A (en) A kind of rendering method and device
CN115080055A (en) Reconfigurable system chip compiler and automatic compiling method for information security
CN107515739A (en) Improve the method and device of code execution performance
CN104484192B (en) A kind of method of complicated multiple-branching construction Code automatic build
Guan et al. Front-end and back-end separation-react based framework for networked remote control laboratory
CN104375932A (en) Method and device for analyzing code coverage rate of Java card
CN112631604B (en) Front-end frame implementation method and device
Lopes et al. A safe-by-design programming language for wireless sensor networks
CN102707934B (en) A kind of realize method and system with what form of scripts represented value-added service flow process
CN107450930A (en) A kind of development approach based on HMI system script
CN103678485B (en) Virtual experiment process node driving and movable packaging system
Suchocki et al. Microscheme: Functional programming for the Arduino
CN106874000A (en) Data analysis set-up and generation method based on construction costs computer description language BCL
CN106970787A (en) A kind of automobile controller rapid prototyping implementation method
CN104899051B (en) Structure loading method, system and the device of Flash program library file
Spinellis Rational metaprogramming

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20171208

RJ01 Rejection of invention patent application after publication