Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Code generation method and device

A code generation and code technology, applied in the field of vehicles, can solve the problems of low code execution efficiency and achieve the effect of improving execution efficiency and reducing execution steps

Active Publication Date: 2019-11-22
CRRC QINGDAO SIFANG CO LTD
View PDF10 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, no matter which method the programmable controller uses to obtain the local code, the code execution efficiency when the programmable controller runs the local code is low

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Code generation method and device
  • Code generation method and device
  • Code generation method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0055] see image 3 , which is a flow chart of the code generation method provided by the first method embodiment of the present application.

[0056] The code generation method applied to the programmable controller provided by the embodiment of the present application includes steps S31-S33:

[0057] S31: Obtain the code to be processed.

[0058] The code to be processed can be an intermediate code or a local code; moreover, the application does not limit the source of the code to be processed, for example, the code to be processed can be downloaded from the host computer, or can be read from the storage space of the PLC. fetched.

[0059] It should be noted that, in this application, the processing process of the intermediate code is the same as that of the local code. Therefore, the code generation method provided by this application can be used to generate the execution code corresponding to the intermediate code, so that the subsequent PLC can use the interpreter The ...

Embodiment approach

[0079] In addition, this application also provides another implementation manner of step S32A1, in this implementation manner, S32A1 specifically includes steps S32A11-S32A12:

[0080] S32A11: Analyzing each instruction of each task code in each operation mode, and obtaining the instruction space requirement value, input parameter space requirement value and initialization parameter space requirement value corresponding to each task code in each operation mode.

[0081] The instruction space requirement value refers to the storage space value required when the code instruction is stored.

[0082] The input parameter space requirement value refers to the storage space value required when the input parameter is stored.

[0083] The initialization parameter space requirement value refers to the storage space value required for initializing parameter storage.

[0084] As an example, when each task code includes a system operation mode, S32A11 may specifically be: analyze each ins...

Embodiment 2

[0133] It should be noted that the code generation method provided by method embodiment 2 is a specific implementation of the code generation method provided by method embodiment 1. For technical details, please refer to method embodiment 1.

[0134] see Figure 7 , which is a flow chart of the code generation method provided by the second method embodiment of the present application.

[0135] The code generation method provided by the embodiment of the present application includes steps S71-S78:

[0136] S71: Download the code to be processed from the host computer or read the code to be processed from the storage space of the PLC; wherein, the code to be processed includes at least one task code, and the code to be processed is an intermediate code or a local code.

[0137] S72: Get the current task code.

[0138] As an implementation manner, S72 may specifically be: select a task code according to a preset task selection method from all untraversed task codes in the code ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a code generation method and device. The method is applied to a programmable controller. The method comprises the steps of: obtaining a to-be-processed code comprising at leastone task code, after determining that the to-be-processed code comprises a preset identifier, generating a task code storage space corresponding to each task code according to each instruction in each task code, and replacing the operand in the task code execution instruction corresponding to each task code with an operand actual value corresponding to the operand to obtain an execution code corresponding to each task code. At the moment, the execution code corresponding to each task comprises the operand actual value which can be directly used without comprising the operand needing segment positioning and address resolution, so that when the programmable logic controller operates according to the execution code, the steps of segment positioning and data address resolution do not need tobe executed again, the execution steps when the programmable logic controller operates the code are reduced, and the execution efficiency of the programmable logic controller is improved.

Description

technical field [0001] The present application relates to the technical field of vehicles, in particular to a code generation method and device. Background technique [0002] As the field of vehicle technology develops, programmable controllers are used more and more frequently. In practical application, at first, the user can generate the source program in the programming system of the upper computer (for example, personal computer) using a preset programming language (for example, programming languages ​​such as ladder diagram); then, in the programming system of the upper computer, the The source program is converted into the code in the instruction list language, and the code in the instruction list language is converted into an intermediate code; at this time, the programmable controller can use the following two methods to obtain the machine-recognizable local code: the first method Yes: The programmable controller directly downloads the intermediate code generated in...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G05B19/05
CPCG05B19/054G05B19/056
Inventor 刘泰王坤飞王强王胜启王瑞
Owner CRRC QINGDAO SIFANG CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products