WO2015039628A1 - 可视化步骤编程法 - Google Patents

可视化步骤编程法 Download PDF

Info

Publication number
WO2015039628A1
WO2015039628A1 PCT/CN2014/087113 CN2014087113W WO2015039628A1 WO 2015039628 A1 WO2015039628 A1 WO 2015039628A1 CN 2014087113 W CN2014087113 W CN 2014087113W WO 2015039628 A1 WO2015039628 A1 WO 2015039628A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
programming
jump
target
operation object
Prior art date
Application number
PCT/CN2014/087113
Other languages
English (en)
French (fr)
Inventor
彭武
Original Assignee
彭武
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 彭武 filed Critical 彭武
Publication of WO2015039628A1 publication Critical patent/WO2015039628A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Definitions

  • the present invention relates to the field of computer programming technologies, and in particular, to a visual step programming method.
  • the invention provides a visual step programming method, which is simple, intuitive, has low requirements for technicians, has wide application range, good program stability, convenient operation and is not easy to make mistakes.
  • the invention provides a visualization step programming method, comprising:
  • the editing step program is specifically: defining a plurality of control steps according to a programming purpose; defining a plurality of executed actions and a plurality of jumps for each control step; each action includes an operation object, an action mode, and a plurality of parameters, and the operation object The corresponding action is performed according to the action mode and the parameters.
  • the jump includes a conditional jump and an unconditional jump.
  • the conditional jump includes an operation object, a detection mode, a parameter, and a target step, and if the detected condition is met, jumping to a corresponding target step; performing the next action after completing the previous action in a single step until completion All actions in this step; then all the jumps are detected cyclically in turn, if the condition of a certain conditional jump is detected, then jump to the corresponding step; if the jump is an unconditional jump, jump to the corresponding step immediately. .
  • the operation object can be used for both actions and detection, and the operation object can be hardware.
  • Including input port, output port, buzzer, stepper motor, mouse, keyboard, can also be software, including variables, arrays, characters, text; for computer software or mobile software programming includes: windows, menus, pictures, icons , buttons, files.
  • the operation object is displayed in a specific area of the programming interface for selection, and the action mode and the detection mode are displayed in a drop-down list of the programming interface for selection.
  • the target step is displayed in a specific area on the control panel in the form of a target step list.
  • the description content includes: an operation object, an operation mode, a parameter, a detection mode, and a detection parameter.
  • the programming target is an industrial control board
  • the program execution body is a single chip microcomputer.
  • the application is a C language program, which still retains the original step program text, all step names are replaced with labels, and the action is converted to call the Operate() program, and multiple actions can be converted in turn, and the jump will be performed. Converted to call the Check () program and placed in the if statement, after the if statement is the jump (goto) and the target address; multiple jumps can be converted in turn; unconditional jumps without the if statement, directly jump (goto Statement), put all jump statements into while(1) ⁇ ... ⁇ .
  • the step programming structure is simple and intuitive, and can realize Chinese programming; the selective programming mode is not only easy to operate, but also easy to make mistakes; easy programming, can reduce the technical requirements of programmers, shorten the development cycle; the program structure is simple, compact, and can be improved The stability of the program operation;
  • Embodiment 1 is a step programming diagram of Embodiment 1 of the present invention.
  • FIG. 2 is a schematic diagram of a drop-down list of a step programming diagram of Embodiment 1 of the present invention.
  • the invention provides a visual step programming method, which edits a step program by computer software and compiles it into a single-chip executable file (such as a hex file), and then downloads it into a single-chip microcomputer of the control board. So to implement this programming method, you need to build a computer software that can edit the step program and compile it into a single chip microcomputer. executable file.
  • the overall architecture of the computer software is as follows:
  • the step program generates a C language program according to the imported operation object and method, which is called an application program.
  • Import object Each step program is saved to the computer as a file.
  • the file contains the control panel model corresponding to this step. Whenever you create a new step program, you need to select the control panel model. When you open the step program or create a new step program, the computer program will import all the operation objects into the database according to the board description file.
  • the description file://Object indicates that the following line is the operation object; in each operation object, the first word (#define) represents the definition, the import does not care, the second word represents the operation object's alias, the third The word indicates the value of the operation object, the first word after the double slash // is the name of the operation object, #O: indicates the corresponding action mode (pointing to a set of operation modes), #C: indicates the corresponding detection mode (pointing to a set of detection methods). //O indicates that the following line is the mode of operation, and the word after // is the label of the operation mode of this group. //C indicates that the following line is the detection mode, and the word after //C is the label of the detection mode of this group.
  • the first word indicates the definition, the import does not care, the second word represents the alias, the third word indicates the value, double slash // after The first word is the name of the object, and #V: indicates the corresponding parameter group. Without #V, there is no predetermined parameter, and the parameter can be directly input. //V indicates that the following line is a parameter, and the word after //V is the label of this group parameter.
  • the name of the first operation object is input.
  • the operation object has a set of detection methods (name: C_PX).
  • the detection methods include: on, off, and trigger.
  • Each detection method has a corresponding alias.
  • Each detection method has a corresponding parameter group (name: V_PX), and the parameters include: X0, X1, X2, and X3, and each parameter also has a corresponding alias.
  • the name of the second operation object is output.
  • the operation object has a set of action modes (name: O_PY).
  • the action modes include: on and off, and each action mode has a corresponding alias.
  • Each action has a corresponding parameter group (name: V_PY), the parameters include: Y0, Y1, Y2, Y3, Y4, Y5, Y6, Y7, each parameter also has a corresponding alias.
  • the second box is a drop-down box
  • the drop-down list includes: on, off.
  • the third box is also a drop-down box.
  • the drop-down list includes: Y0, Y1, Y2, Y3, Y4, Y5, Y6, Y7.
  • the description file is imported into the database, then the computer software can be based on the database. It can be found that the operation objects of the step program can be used, and know the batch operation mode and detection method corresponding to each operation object. And a batch of parameters corresponding to each mode.
  • a plurality of control steps are defined according to the purpose of the control, and a plurality of executed actions and a plurality of jumps are defined for each control step.
  • Each action needs to define an operation object, an action mode, and a plurality of parameters, and the operation object performs corresponding actions according to the action mode and the parameters. .
  • Perform the next action after completing the last action in a single step until all actions in the step are completed. Then, all the jumps are cyclically detected from top to bottom. If the condition of a certain conditional jump is detected, the jump to the corresponding step is immediately performed; if the jump is an unconditional jump, the jump to the corresponding target step is immediately performed.
  • a simple function program an input X0 and an output Y0, Y0 is turned off when the power is turned on, Y0 is turned on when X0 is triggered, and Y0 is turned off when X0 is triggered again.
  • the procedure of the step programming is shown in Figure 1.
  • the program is divided into two steps. The first step is executed at boot time. The name of the first step is closed, followed by the action to be performed: Y0 is off. Then one line is to detect the jump. When the condition is met (X0 trigger), it jumps to another step (on). If the condition is not met, the condition will be detected continuously.
  • the second step has the same meaning as the first one.
  • step programming The core feature of step programming is that the program consists of several steps, each of which consists of several actions, and several jumps.
  • Each action consists of an action object, an action mode, and several parameters. Jumps are divided into conditional jumps and direct jumps. Conditional jumps include detection objects, detection methods, and several parameters.
  • target steps are included. Of course, unconditional jumps only have target steps.
  • step programming Another core feature of step programming is selective programming. Different control panels will have different operating objects, and these different objects will appear in a specific area (such as the left sidebar) for selection. The user only needs to select the first item in the step and then go to the specific one. The area selects the corresponding operation object. Each different operation object has a different way. When the mode is selected, a drop-down list will appear, as shown in Figure 2, which lists all the modes of the operation object for the programmer to select. The target step can also be selected through the list of steps on the side.
  • the operation object can be hardware, such as: input port X, output port Y, buzzer, stepper motor, mouse, keyboard, and the like. Also software, such as: variables, arrays, characters, text, and more.
  • the computer program is written in C++, and each operation object imported by the description file is a class. Every A set of methods is a class, and each set of parameters is also a class. Each operation object has an object name, an object alias, a pointer to the action mode group, a pointer to the detection mode group, and a pointer to the parameter group.
  • Each set of methods is a class (method group), and each mode is also a class (method).
  • Each mode group has a mode group name, the number of methods included, and a pointer to the first mode.
  • Each method has a method name, a method alias, a parameter group pointer, and a pointer to the next method.
  • Each set of parameters is a class (parameter group), and each parameter is also a class (parameter).
  • Each parameter group has a parameter group name, the number of parameters included, and a pointer to the first parameter.
  • Each parameter has a parameter name, a parameter alias, a parameter value, and a pointer to the next parameter.
  • the step program is an executable program.
  • Each step is a class, each step should have a name, the step class contains several actions and several jumps, each action has an object mode and several parameters. Jumps also have several ways and parameters and a target step. In addition to the parameter name, each parameter has a parameter value corresponding to the parameter.
  • the computer software interface displays the step program in the form of a table.
  • the computer software interface has four buttons: “New Step”, “New Action”, “New Jump” and “Delete”.
  • a drop-down list will appear listing all the ways of the object.
  • a drop-down list appears, listing all the parameters corresponding to the method of the object.
  • the drop-down list will not appear in the parameter box. In this case, you need to input the data manually.
  • each item of the step program has an alias.
  • the computer program can obtain the alias by the operation object, action mode, and parameter in the imported database. And put it in the alias area of each item. If the parameter is data entered manually, the alias is the input data.
  • step program can be generated as a standard language application is the key to the feasibility of step programming.
  • the main process of compiling is divided into two steps.
  • the step program is compiled into a C language program, called an application program, and then the existing C language compiler (such as C51) is used to compile the application and the underlying program into an executable program.
  • File (Hex file).
  • the first problem in generating a C language application is what kind of C language file is generated.
  • the C language application generated by the above example is as follows:
  • the alias is named L1, and the target steps in all the jumps in the step program are searched.
  • the target step is also named L1 for the target step of the step. Then find the second step, name its alias L2, and find the target steps in all the jumps in the step program.
  • the target step is also named L2 for the target step of this step. This cycle. Until all the steps have been named.
  • step-by-step program line by line and replace it: the application file starts another line (write to /r/n), and then reads in a one-step procedure.
  • the step program can be converted into a C language program.
  • the Operate() program is a program that distinguishes between different operation objects and thus executes the operation object. In this embodiment, there are two operation objects, and the PY and the buzzer Buzzer are output.
  • the program is as follows:
  • the buzzer Operate_Buz() program has nothing to do with this embodiment, and is not introduced.
  • the Operate_PY() method of the Operate() program directly drives the corresponding port according to the action mode and parameters.
  • the program is as follows:
  • the Check() program distinguishes between different operation objects, thereby executing the detection program of the operation object.
  • the procedure is as follows:
  • the specific Check_PX() does not directly detect the port.
  • the direct detection port is PX_1ms().
  • the program is as follows:
  • the PX_1ms() program is executed every 1 millisecond and is called by a timer interrupt. It scans the input port and obtains the variable SPx indicating that the port is turned on/off. And the variable MPx indicating that the port is triggered.
  • Check_PX() does not directly detect the port, but instead detects SPx and MPx. Returns 1 if the detected condition is true, otherwise returns 0. If the detected trigger condition is met, the trigger flag is cleared, thereby The purpose of the detection trigger is reached.
  • the underlying program has a Main() function and a timer interrupt function Timer0Int().
  • the Main() function is very simple, that is, it is initialized first (calling the initialization program Initial()), and the initialization program will perform the necessary initialization settings for all operation objects (input ports, output ports, etc.). Then call the Execute() program, which is to execute the application converted by the step program.
  • Timer0Int is a timer interrupt function, which is set to interrupt every 1 millisecond, to execute the program that needs to be executed every 1 millisecond: PX_1ms();
  • Keil C51 a dedicated compilation development environment
  • the computer program can also directly compile the executable file of the MCU (such as Hex file) through an external compiler (such as C51) and a linker (such as BL51).
  • an external compiler such as C51
  • a linker such as BL51
  • the executable file (such as Hex file) is downloaded to the corresponding microcontroller in the control board, and the control board can execute the step program to achieve the programming purpose.
  • the visual step programming method of the invention has simple and intuitive step programming structure and can realize Chinese programming; Selective programming method is not only easy to operate, but also easy to make mistakes; easy to program, can reduce the technical requirements of programmers, shorten the development cycle; program structure is simple and compact, can improve the stability of program operation; it can be widely used in computers Programming, industrial control programming, robot programming, microcontroller programming, and even CNC numerical control programming, a wide range of applications.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

一种可视化步骤编程法,包括:为不同的编程目标编写不同的目标底层程序,并建立一个说明文件;根据编程目标的说明文件,将操作对象、动作方式以及参数等数据导入到数据库;根据导入的数据编辑步骤程序;将步骤程序根据导入的操作对象及动作方式生成应用程序;调用外部编译器,将所述底层程序和应用程序编译为目标可执行的文件;将目标可执行的文件装载到程序执行体中。该编程法结构简单,直观,可实现中文编程;采用选择式的编程方式,不仅操作方便,且不易出错;编程容易,可降低对编程人员的技术要求,缩短开发周期;程序结构简单,紧凑,可提升程序运行的稳定性;适用范围广。

Description

可视化步骤编程法 技术领域
本发明涉及电脑编程技术领域,尤其涉及一种可视化步骤编程法。
背景技术
当前在工业控制领域,对控制板的编程主要有两种,一种是PLC采用梯形图编程,一种是单片机采用汇编或C语言来编程。汇编和C语言为专业的计算机编程语言,要较高的专业知识。而梯形图则较为简单,但需要专业电气知识。
在实现本发明过程中,发明人发现现有技术中至少存在如下问题:
以上两种编程方法,没有专业背景的人很难使用。
发明内容
本发明提供一种可视化步骤编程法,其简单、直观、对技术人员的要求低、适用范围广、程序稳定性好,操作方便、不易出错。
本发明提供一种可视化步骤编程法,包括:
为不同的编程目标编写不同的目标底层程序,并建立一个说明文件;根据编程目标的说明文件,将操作对象、动作方式以及参数等数据导入到数据库;根据导入的数据编辑步骤程序;将步骤程序根据导入的操作对象及动作方式生成应用程序;调用外部编译器,将所述底层程序和应用程序编译为目标可执行的文件;将目标可执行的文件装载到程序执行体中。
优选地,所述编辑步骤程序具体为:根据编程目的定义若干控制步骤;为每一控制步骤定义若干执行的动作以及若干跳转;每一动作包括操作对象、动作方式以及若干参数,操作对象将根据动作方式以及参数进行相应的动作。
优选地,所述跳转包括条件跳转和无条件跳转。
优选地,所述条件跳转包括操作对象、检测方式、参数以及目标步骤,若检测的条件成立则跳转到相应的目标步骤;在单个步骤内完成上一动作后执行下一动作,直至完成该步骤内所有动作;然后依次循环检测所有跳转,若检测到某一条件跳转的条件成立,则立即跳转到相应到步骤;若跳转为无条件跳转则立即跳转到相应的步骤。
优选地,所述操作对象既可用于动作,也可用于检测,操作对象可以是硬件, 包括输入端口、输出端口、蜂鸣器、步进电机、鼠标、键盘,也可以是软件,包括变量、数组、字符、文本;对于电脑软件或手机软件编程则包括:窗口、菜单、图片、图标、按钮、文件。
优选地,所述操作对象显示在编程界面的特定区域内供选取,动作方式、检测方式显示在编程界面的下拉列表中供选取。
优选地,所述目标步骤以目标步骤列表的方式显示在控制板上的特定区域内。
优选地,所述说明文件记载内容包括:操作对象、动作方式、参数、检测方式、检测参数。
优选地,所述编程目标为工业控制板,程序执行体为单片机。
优选地,所述应用程序为C语言程序,其依然保留有原来的步骤程序文字,所有步骤名全部替换为标号,将动作转换为调用Operate()程序,多个动作可依次转换,将跳转转换为调用Check()程序并放在if语句中,if语句后面则是跳转(goto)及目标地址;多个跳转可依次转化;无条件跳转则没有if语句,直接是跳转(goto语句),将所有跳转语句放入while(1){…}中。
本发明所述可视化步骤编程法,其有益效果是:
步骤编程结构简单,直观,可实现中文编程;选择式的编程方式,不仅操作方便,且不易出错;编程容易,可降低对编程人员的技术要求,缩短开发周期;程序结构简单,紧凑,可提升程序运行的稳定性;
其可广泛应用于电脑编程、工控编程、机器人编程、单片机编程、甚至CNC数控编程领域,适用范围广。
附图说明
附图1为本发明实施例1的步骤编程图;
附图2为本发明实施例1的步骤编程图的下拉列表示意图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,以下实施例用于说明本发明,但不用来限制本发明的范围。
实施例:
本发明提供一种可视化步骤编程法,其通过电脑软件来编辑步骤程序,并编译成单片机可执行文件(如hex文件),然后下载到控制板的单片机中。所以要实现本编程法,就需要建立一款电脑软件,能够来编辑步骤程序,并编译成单片机 可执行文件。该电脑软件的总体架构如下:
1、首先为不同的控制板编写不同的单片机底层程序(如GK0110.c),并建立一个所需要的说明文件(GK0110.h),所有控制板底层程序可放在同一目录供选择。
2、根据控制板型号,将相应的说明文件里的操作对象,动作方式,以及参数导入到数据库中。
3、根据导入的数据:操作对象及方式编辑步骤程序。
4、生成:将步骤程序根据导入的操作对象及方式,生成一个C语言程序,称之为应用程序。
5、调用外部编译器(如C51),将控制板底层程序和应用程序,编译为单片机可执行的文件(如Hex文件)。
导入对象:每个步骤程序按文件的方式保存到电脑里,文件包含了此步骤程序所对应的控制板型号,当每次新建一个步骤程序时需选择控制板型号。而打开步骤程序或新建完成一个步骤程序时,电脑程序将根据该控制板说明文件将所有操作对象导入到数据库。
说明文件://Object表示以下的行是操作对象;而每个操作对象中,第一个词(#define)表示定义,导入时不用理会,第二个词表示操作对象的别名,第三个词表示操作对象的值,双斜线//后的第一个词为操作对象的名称,#O:表示对应的动作方式(指向一组操作方式的标号),#C:表示对应的检测方式(指向一组检测方式的标号)。//O表示以下的行是操作方式,而//O其后的词为此组操作方式的标号。//C表示以下的行是检测方式,而其//C后的词为此组检测方式的标号。而每个操作方式或检测方式中,第一个词(#define)表示定义,导入时不用理会,第二个词表示方式的别名,第三个词表示方式的值,双斜线//后的第一个词为对象的名称,#V:表示对应的参数组。没有#V则表示没有预定的参数,参数可以直接输入。//V表示以下的行是参数,而其//V后的词为此组参数的标号。
例如:
Figure PCTCN2014087113-appb-000001
Figure PCTCN2014087113-appb-000002
上述说明文件表示有个两个操作对象。
第一个操作对象的名称为输入,该操作对象有一组检测方式(名称为:C_PX),检测方式包括:接通、断开、触发,每个检测方式都有相应的别名。每个检测方式都有对应的参数组(名称为:V_PX),参数包括:X0、X1、X2、X3,每个参数也都有对应的别名。这样在编辑步骤程序时,若第一个框为输入,则第二个框为一个下拉框,下拉列表包括:接通、断开、触发。第三个框也为一个下拉框,下拉列表包括:X0、X1、X2、X3。
第二个操作对象的名称为输出,该操作对象有一组动作方式(名称为:O_PY),动作方式包括:开启、关闭,每个动作方式都有相应的别名。每个动作都有对应的参数组(名称为:V_PY),参数包括:Y0、Y1、Y2、Y3、Y4、Y5、Y6、Y7,每个参数也都有对应的别名。这样在编辑步骤程序时,若第一个框为输出,则第二个框为一个下拉框,下拉列表包括:开启、关闭。第三个框也为一个下拉框,下拉列表包括:Y0、Y1、Y2、Y3、Y4、Y5、Y6、Y7。
按照此方式将说明文件导入到数据库中,那么电脑软件就可依据数据库的内 容得出该步骤程序有哪些操作对象可以使用,并且知道每个操作对象所对应的一批操作方式及检测方式。以及每个方式所对应的一批参数。
编辑步骤程序:
根据控制的目的定义若干控制步骤,为每一控制步骤定义若干执行的动作以及若干跳转,每一动作需定义操作对象、动作方式以及若干参数,操作对象将根据动作方式以及参数进行相应的动作。在单个步骤内完成上一动作后执行下一动作,直至完成该步骤内所有动作。然后从上往下依次循环检测所有跳转,若检测到某一条件跳转的条件成立,则立即跳转到相应到步骤;若跳转为无条件跳转则立即跳转到相应到目标步骤。
用户在编程时,只需考虑该程序需要哪些步骤,每个步骤的该执行的动作,以及在什么样的情况下去执行另一步骤,用户不需考虑各个动作的具体实现过程。
例1:
一个简单的功能程序,一个输入X0和一个输出Y0,开机上电时,Y0关闭,当X0被触发则Y0开启,当X0再次被触发则Y0关闭,步骤编程的程序如图1。程序分两个步骤,开机即执行第一个步骤,第一个步骤的名称为关闭,接着是要做的动作:Y0关闭。然后一行是检测跳转,当满足条件(X0触发)就跳转到另一个步骤(开启),如果条件不满足,就会不停的对条件进行检测。第二个步骤的含义和第一个一样。
步骤编程的核心特点是程序由若干个步骤构成,而每个步骤由若干个动作,和若干个跳转构成。每个动作由操作对象,动作方式,以及若干个参数构成。而跳转则分为条件跳转和直接跳转,条件跳转包括检测对象,检测方式,以及若干个参数.此外还包括目标步骤,当然无条件跳转则只有目标步骤。
步骤编程的另一核心特点是选择式编程。不同的控制板会有不同的操作对象,而这些不同的对象会出现在特定的区域(如左边侧边栏)供选择,用户只需先选中步骤里动作的第一项,然后再去特定的区域选择相应的操作对象即可,每个不同的操作对象有不同的方式,当选中方式时,会出现下拉列表,如图2,列出该操作对象所有的方式,供编程人员选择。目标步骤也可通过侧边的步骤列表选择。
操作对象可以是硬件,如:输入端口X,输出端口Y,蜂鸣器,步进马达,鼠标,键盘,等等。也可是软件,如:变量,数组,字符,文本,等等。
电脑程序:
电脑程序采用C++来编写,由说明文件导入的每个操作对象即为一个类。每 一组方式为一个类,每一组参数也为一个类。而每个操作对象则有对象名称,对象别名,动作方式组的指针、检测方式组的指针、以及参数组的指针。
每一组方式为一个类(方式组),每个方式也是一个类(方式)。每个方式组里有方式组名称,所包含的方式个数,首个方式的指针。而每个方式里有方式名称,方式别名,参数组指针,以及下一个方式的指针。
每一组参数为一个类(参数组),每个参数也是一个类(参数)。每个参数组里有参数组名称,所包含的参数个数,首个参数的指针。而每个参数里有参数名称,参数别名,参数值,以及下一个参数的指针。
步骤程序则是可执行的程序。
每个步骤即为一个类,每个步骤都应该有个名称,该步骤类包含若干个动作和若干个跳转,每个动作又有对象方式以及若干个参数。而跳转也有若干个方式和参数以及一个目标步骤。每个参数除了参数名以外,还有该参数所对应的参数值。
在电脑软件界面的左边建立一个侧边栏,里面列出所有的操作对象。
电脑软件界面按表格的方式显示步骤程序。
电脑软件界面有“新建步骤”、“新建动作”、“新建跳转”、“删除”4个按钮。
当点击“新建步骤”时,会在选中的位置所属的步骤后面新建一个步骤,如没有选中任何位置,则会在整个步骤程序的最后新建一个步骤。而选中一个步骤再点击“新建动作”或“新建跳转”则会为该步骤新建一个动作或跳转。点击“删除”按钮则可以删除选中的步骤,动作或跳转。
当选中一个步骤(每个步骤的第一行,名称),即可为该步骤重命名。
当选中一个动作或跳转的对象框(第一个框),则可以再到侧边栏里选取所需的对像。
当选中一个动作或跳转的方式框(第二个框),则会出现下拉列表,列出该对象所有的方式。
当选中一个动作或跳转的参数框(第三个框),则会出现下拉列表,列出该对象该方式所对应的所有参数。当某个对象的某个方式没有预定的参数组时,参数框不会出现下拉列表,此时需手动输入数据,
为了以后转换文件的需要,步骤程序的每一项都有一个别名。当选中操作对象,动作方式,参数时,电脑程序可按导入的数据库里的操作对象,动作方式,参数,来获取别名。并放到每一项的别名区。如参数是手动输入的数据,则别名就是输入的数据。
每个步骤,以及每个跳转里的目标步骤,也有别名。而其别名不需要在编辑 的时候获取。是在编译的时候才获取。
生成C语言应用程序:
步骤程序能否生成为标准的语言应用程序,是步骤编程法是否具有可行性的关键。编译的主要过程分两步,先将步骤程序编译为C语言程序,称之为应用程序,然后用现有的C语言编译器(如:C51),将应用程序和底层程序一起编译为可执行文件(Hex文件)。生成C语言应用程序的首要问题是生成什么样的C语言文件,上述例子生成的C语言应用程序如下:
Figure PCTCN2014087113-appb-000003
为了程序依然具有一定的可读性,便于调试。生成的C语言程序依然保留有原来的步骤程序文字,步骤程序里的所有步骤名因为是中文的,所以这里需全部替换为标号,将动作转换换为调用Operate()程序,多个动作可依次转换,将跳转转换为调用Check()程序并放在if语句中,if语句后面则是跳转(goto)及目标地址。多个跳转可依次转化。无条件跳转则没有if语句,直接是跳转(goto语句),将所有跳转语句放入while(1){…}中。
知道要生成什么样的应用程序后,我们可以按如下的规则进行转换。
1、建立步骤,为跳转里的目标步骤建立别名:首先找到第一个步骤,将
其别名命名为L1,同时查找步骤程序里所有跳转里的目标步骤,将目标步骤为本步骤的目标步骤的别名也都命名为L1。然后找到第二个步骤,将其别名命名为L2,同时查找步骤程序里所有跳转里的目标步骤,将目标步骤为本步骤的目标步骤的别名也都命名为L2。如此循环。直到将所有的步骤都已命名。
2、建立应用程序文件,并写入文件开始部分:建立一个应用程序文件(C
语言),写入以下内容:
void Operate(unsigned int object,unsigned int method,unsigned int parameter);
bit Check(unsigned int object,unsigned int method,unsigned int parameter);
void Execute()
{
3、逐行读入步骤程序,并替换:应用程序文件另起一行(写入/r/n),然后读入一行步骤程序。
如果是步骤:先写入‘}/r/n’(用于结束上一个While(1),如果是第一个步骤则不需要,)然后空一行(‘/r/n’),然后将其别名加上符号“:”(如:L1:),写入应用程序文件中。再空出若干空格,写如符号‘//’,然后将该步骤名写入。如:
L1://关闭
如果是动作,则写入“Operate(‘+对象的别名+’,’+方式的别名+’,’+参数的别名+’);”。再空出若干空格,写如符号‘//’,然后将该动作的对象,方式,参数依次写入。如:
Operate(DA_PY,DO_Close,VY0);//输出关闭Y0
如果是跳转:(如果是在一个步骤内首次检测到跳转:则需先写入:‘while(1)/r/n’)。写入”if(Check(‘+对象的别名+’,’+方式的别名+’,’+参数的别名+’))goto’+目标步骤的别名”,,然后将该跳转的对象,方式,参数,目标步骤依次写入。如:
while(1)
{
if(Check(DA_PX,DC_Trigger,VX0))goto L1;//输入触发接通X0关闭
如果是无条件跳转,则直接写入“goto+目标步骤的别名”。然后将该跳转目标步骤写入如:goto L1;//关闭
4、添加最后花括号:逐行读入步骤程序,当读完整个步骤程序后,再将应用程序文件另起一行(写入/r/n)。然后写入两个‘}’。一个是While循环的,一个是Execute()程序的。
依照上述方式,可以将步骤程序转换为C语言程序。而转换后的C语言程序,需要调用以下两个程序:
void Operate(unsigned int object,unsigned int method,unsigned int parameter);
bit Check(unsigned int object,unsigned int method,unsigned int parameter);
这两个程序位于于底层程序中.如:GK0110.C。应用程序就是靠它们来实现具体动作和检测的。其参数包括object,method,parameter。Operate()和Check()根据这些来实现具体的动作和检测。
Operate()程序就是区分不同的操作对象,从而执行该操作对象的动作程序。本实施例中有两个操作对象,输出PY和蜂鸣器Buzzer,程序如下:
Figure PCTCN2014087113-appb-000004
蜂鸣器Operate_Buz()程序与本实施例无关,不作介绍,而Operate()程序调用的Operate_PY()则根据动作方式,以及参数直接驱动相应的端口,程序如下:
Figure PCTCN2014087113-appb-000005
Figure PCTCN2014087113-appb-000006
Check()程序区分不同的操作对象,从而执行该操作对象的检测程序,本实施例只有一个操作对象Check_PX。程序如下:
Figure PCTCN2014087113-appb-000007
而具体的Check_PX()并没有直接检测端口,直接检测输入端口的是PX_1ms(),程序如下:
Figure PCTCN2014087113-appb-000008
Figure PCTCN2014087113-appb-000009
PX_1ms()程序每1毫秒执行一次,由定时中断调用。其扫描输入端口,并获得表示端口接通/断开的变量SPx。以及表示端口被触发的变量MPx。
Figure PCTCN2014087113-appb-000010
Check_PX()并没有直接检测端口,而是检测SPx和MPx。当检测的条件成立就会返回1,否则返回0。若检测的触发条件成立,则会清除触发标志,从而 达到检测触发的目地。
Operate和Check程序根据object的值来执行相应的程序。DA_PY的值是多少,在说明文件中有定义。所以需在底层程序的开始处包含说明文件,如:#include"GK0110.h"
另外,底层程序有个Main()函数和定时中断函数Timer0Int()。
Figure PCTCN2014087113-appb-000011
Main()函数很简单,就是先进行初始化(调用初始化程序Initial()),初始化程序会对所有操作对象(输入端口,输出端口,等等)进行必要的初始化设置。然后就调用Execute()程序,也就是去执行由步骤程序转换的应用程序。
而Timer0Int为定时中断函数,其设定为每1毫秒中断一次,去执行需要每1毫秒执行一次的程序:PX_1ms();
至此,可得出3个文件,说明文件(如:GK0110.h),底层程序(如:GK0110.c)以及生成的应用程序(如:任务.c)。
用户得到这3个文件后,即可放入专用的编译开发环境中(如:Keil C51),进行编译,模拟,以及仿真。
电脑程序也可通过外部编译器(如:C51),链接器(如:BL51),直接编译出单片机可执行的文件(如:Hex文件)。
将可执行的文件(如:Hex文件)下载到对应的控制板里的单片机中,控制板就可执行该步骤程序,从而达到编程目的。
工业实用性
本发明所述可视化步骤编程法,步骤编程结构简单,直观,可实现中文编程; 选择式的编程方式,不仅操作方便,且不易出错;编程容易,可降低对编程人员的技术要求,缩短开发周期;程序结构简单,紧凑,可提升程序运行的稳定性;其可广泛应用于电脑编程、工控编程、机器人编程、单片机编程、甚至CNC数控编程领域,适用范围广。
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。

Claims (10)

  1. 可视化步骤编程法,其特征在于,包括:
    为不同的编程目标编写不同的目标底层程序,并建立一个说明文件;
    根据编程目标的说明文件,将操作对象、动作方式以及参数等数据导入到数据库;
    根据导入的数据编辑步骤程序;
    将步骤程序根据导入的操作对象及动作方式生成应用程序;
    调用外部编译器,将所述底层程序和应用程序编译为目标可执行的文件;
    将目标可执行的文件装载到程序执行体中。
  2. 根据权利要求1所述的可视化步骤编程法,其特征在于,所述编辑步骤程序具体为:
    根据编程目的定义若干控制步骤;
    为每一控制步骤定义若干执行的动作以及若干跳转;
    每一动作包括操作对象、动作方式以及若干参数,操作对象将根据动作方式以及参数进行相应的动作。
  3. 根据权利要求2所述的可视化步骤编程法,其特征在于:
    所述跳转包括条件跳转和无条件跳转。
  4. 根据权利要求3所述的可视化步骤编程法,其特征在于:
    所述条件跳转包括操作对象、检测方式、参数以及目标步骤,若检测的条件成立则跳转到相应的目标步骤;在单个步骤内完成上一动作后执行下一动作,直至完成该步骤内所有动作;然后依次循环检测所有跳转,若检测到某一条件跳转的条件成立,则立即跳转到相应到步骤;若跳转为无条件跳转则立即跳转到相应的步骤。
  5. 根据权利要求1或2所述的可视化步骤编程法,其特征在于:
    所述操作对象既可用于动作,也可用于检测,操作对象可以是硬件,包括输入端口、输出端口、蜂鸣器、步进电机、鼠标、键盘,也可以是软件,包括变量、数组、字符、文本;对于电脑软件或手机软件编程则包括:窗口、菜单、图片、图标、按钮、文件。
  6. 根据权利要求1或2所述的可视化步骤编程法,其特征在于:
    所述操作对象显示在编程界面的特定区域内供选取,动作方式、检测方式显示在编程界面的下拉列表中供选取。
  7. 根据权利要求1所述的可视化步骤编程法,其特征在于:
    所述目标步骤以目标步骤列表的方式显示在控制板上的特定区域内。
  8. 根据权利要求1所述的可视化步骤编程法,其特征在于,包括:
    所述说明文件记载内容包括:操作对象、动作方式、参数、检测方式、检测参数。
  9. 根据权利要求1所述的可视化步骤编程法,其特征在于,包括:
    所述应用程序为C语言程序,其依然保留有原来的步骤程序文字,所有步骤名全部替换为标号,将动作转换为调用Operate()程序,多个动作可依次转换,将跳转转换为调用Check()程序并放在if语句中,if语句后面则是跳转及目标地址;多个跳转可依次转化;无条件跳转则没有if语句,直接是跳转,将所有跳转语句放入while(1){…}中。
  10. 根据权利要求1所述的可视化步骤编程法,其特征在于:
    所述编程目标为工业控制板,所述程序执行体为单片机。
PCT/CN2014/087113 2013-09-23 2014-09-22 可视化步骤编程法 WO2015039628A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310431630.X 2013-09-23
CN201310431630XA CN103472743A (zh) 2013-09-23 2013-09-23 可视化步骤编程法

Publications (1)

Publication Number Publication Date
WO2015039628A1 true WO2015039628A1 (zh) 2015-03-26

Family

ID=49797634

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/087113 WO2015039628A1 (zh) 2013-09-23 2014-09-22 可视化步骤编程法

Country Status (2)

Country Link
CN (1) CN103472743A (zh)
WO (1) WO2015039628A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338619A (zh) * 2020-02-21 2020-06-26 中科新松有限公司 一种图形化算法编程交互系统、编程方法和可读存储介质

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103472743A (zh) * 2013-09-23 2013-12-25 彭武 可视化步骤编程法
CN103984539B (zh) * 2014-04-14 2018-04-27 美的集团股份有限公司 一种家电设备运行方法及系统
CN105354023B (zh) * 2015-10-20 2019-05-14 四川华控图形科技有限公司 可视化逻辑编辑运行引擎系统
CN105975280B (zh) * 2016-05-13 2019-06-18 苏州乐派特机器人有限公司 一种实物化编程装置及其实现方法
CN107918359A (zh) * 2016-10-09 2018-04-17 兰州交通大学 一款外露半椭球体的数控加工宏程序及自动生成软件
CN106681740A (zh) * 2017-01-12 2017-05-17 合肥杰美电子科技有限公司 一种可视化配置指令的方法及系统
CN108182062A (zh) * 2017-12-12 2018-06-19 上海葡萄纬度科技有限公司 一种反向编程的方法及系统
CN108459552B (zh) * 2018-01-31 2021-07-23 南京拓控信息科技股份有限公司 一种智能化面向对象的可编程的自动化控制方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043980A (zh) * 2004-10-20 2007-09-26 Abb研究有限公司 一种对工业机器人进行编程的系统和方法
CN101354571A (zh) * 2008-08-01 2009-01-28 北京印刷学院 一种控制系统自动生成平台及其方法
WO2013041590A1 (de) * 2011-09-19 2013-03-28 Schneider Electric Automation Gmbh Verfahren zur generierung und handhabung von applikationen für komponenten eines verteilten steuerungssystems sowie engineering-system zur durchführung des verfahrens
CN103116500A (zh) * 2013-03-11 2013-05-22 北京首钢自动化信息技术有限公司 一种结构体定义和结构输出的方法及装置
CN103472743A (zh) * 2013-09-23 2013-12-25 彭武 可视化步骤编程法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5553227A (en) * 1994-08-26 1996-09-03 International Business Machines Corporation Method and system for visually programming state information using a visual switch
DE19880536B4 (de) * 1997-03-11 2004-08-05 Mitsubishi Denki K.K. Visuelles Programmierverfahren und dieses Verfahren anwendendes Pogrammiersystem
CN101110022A (zh) * 2007-08-30 2008-01-23 济南卓信智能科技有限公司 一种工作流模型的软件实现方法
CN102135888A (zh) * 2011-03-26 2011-07-27 陈永胜 一种用描述语言编程的编程平台系统
CN103136406B (zh) * 2011-12-03 2015-12-16 南京南瑞继保电气有限公司 可视化应用程序自动生成仿真用函数代码的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043980A (zh) * 2004-10-20 2007-09-26 Abb研究有限公司 一种对工业机器人进行编程的系统和方法
CN101354571A (zh) * 2008-08-01 2009-01-28 北京印刷学院 一种控制系统自动生成平台及其方法
WO2013041590A1 (de) * 2011-09-19 2013-03-28 Schneider Electric Automation Gmbh Verfahren zur generierung und handhabung von applikationen für komponenten eines verteilten steuerungssystems sowie engineering-system zur durchführung des verfahrens
CN103116500A (zh) * 2013-03-11 2013-05-22 北京首钢自动化信息技术有限公司 一种结构体定义和结构输出的方法及装置
CN103472743A (zh) * 2013-09-23 2013-12-25 彭武 可视化步骤编程法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338619A (zh) * 2020-02-21 2020-06-26 中科新松有限公司 一种图形化算法编程交互系统、编程方法和可读存储介质
CN111338619B (zh) * 2020-02-21 2023-06-23 中科新松有限公司 一种图形化算法编程交互系统、编程方法和可读存储介质

Also Published As

Publication number Publication date
CN103472743A (zh) 2013-12-25

Similar Documents

Publication Publication Date Title
WO2015039628A1 (zh) 可视化步骤编程法
Deitel Java how to program
Shaer et al. A specification paradigm for the design and implementation of tangible user interfaces
Rödiger et al. RKWard: a comprehensive graphical user interface and integrated development environment for statistical analysis with R
Fritzson et al. The OpenModelica modeling, simulation, and development environment
Horton Ivor Horton's Beginning Visual C++ 2013
US20180173503A1 (en) System and method for graphical programming
US6518979B1 (en) Automatically-maintained customizable user interfaces
Craig et al. Learn android studio: build android apps quickly and effectively
Asenov et al. Envision: A fast and flexible visual code editor with fluid interactions (overview)
Wielenga Beginning netbeans ide: For java developers
Williams et al. A visual language for image processing
Aghaee et al. Live mashup tools: challenges and opportunities
Chaudhary Tkinter GUI Application Development Blueprints
Baka Getting Started with Qt 5: Introduction to programming Qt 5 for cross-platform application development
Doran et al. Unreal Engine 4. x Scripting with C++ Cookbook: Develop quality game components and solve scripting problems with the power of C++ and UE4
CN114518875A (zh) 一种图形化编程系统及其编程方法
Mayo C# 3.0 Unleashed: With the. NET Framework 3.5
Gotti et al. A Model Driven approach for multi-platform execution of interactive UIS designed with IFML
Samoylov Learn Java 12 Programming: A step-by-step guide to learning essential concepts in Java SE 10, 11, and 12
Davis et al. C# 2005 for Dummies
EP3106980A1 (en) A processing unit, software and method for controlling interactive components
JP2011165051A (ja) 開発支援装置及び方法並びにプログラム
Lei et al. Design of the instrument soft panel using windows presentation foundation
Gerber et al. Android Studio

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14845169

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT RO RULE 112(1) EPC (EPO FORM 1205A DATED 01.09.2016)

122 Ep: pct application non-entry in european phase

Ref document number: 14845169

Country of ref document: EP

Kind code of ref document: A1