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

A code generation method and device

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

Active Publication Date: 2021-04-09
CRRC QINGDAO SIFANG CO LTD
View PDF10 Cites 0 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
  • A code generation method and device
  • A code generation method and device
  • A 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 present application discloses a code generation method and device, which are applied to programmable controllers. After obtaining the code to be processed including at least one task code and determining that the code to be processed includes a preset identifier, first according to each For each instruction in the task code, generate the task code storage space and task code execution instruction corresponding to each task code, and then replace the operand in the task code execution instruction corresponding to each task code with the operand corresponding to the operand. value to get the execution code corresponding to each task code. At this time, because the execution code corresponding to each task includes the actual value of the operand that can be used directly, and does not include the operand that requires segment positioning and address resolution, when the programmable controller runs according to the execution code , it is not necessary to re-execute the steps of segment positioning and data address resolution, which reduces the execution steps when the programmable controller runs the code, thereby improving the execution efficiency of the programmable controller.

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 Patents(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