PLC supporting coroutine function

A controller and coroutine technology, applied in the control field, can solve the problem that the standard ST language does not contain coroutine functions, and achieve the effect of simplifying programming complexity and improving execution efficiency.

Active Publication Date: 2017-03-22
湖南戈人自动化科技有限公司
View PDF7 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the standard ST language does not contain the coroutine function

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
  • PLC supporting coroutine function

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0017] The IEC61131-3 international standard programming language of the PLC controller includes a graphical programming language and a textual programming language (ST language). The ST language has the characteristics of powerful and efficient programming functions, but the standard ST language does not include the coroutine function.

[0018] To implement the function of supporting coroutines, the ST language compiler must first add the function of supporting coroutines. Therefore, it is first necessary to add the coroutine keyword in the ST language to mark the start and end of the coroutine; at the same time, add the support of the library function for the basic operation of the coroutine in the ST language. When compiling with the ST language compiler, each coroutine segment must be compiled independently, and each coroutine has its own register context and stack.

[0019] The ST language compiler compiles and generates bytecode, which is similar to machine code running...

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 provides a PLC supporting a coroutine function, which comprises a central processing unit, a memory, a power supply module, a program input device, and an input and output circuit. Program coroutine function supports are expanded in the central processing unit. Coroutine key words are added to an ST language for PLC programming for marking starting and ending of the program coroutine; a coroutine basic operation library function support is added to the ST language for PLC programming, the ST language compiler for PLC programming independently compiles each coroutine section, and each coroutine has the self register context and the stack; the ST language compiler for PLC programming compiles and generates byte codes, the byte codes are downloaded to the PLC, and a byte code virtual machine for the PLC executes the byte codes; and a support for a coroutine instruction set is added to the PLC byte code virtual machine. Thus, the process control programming complexity is simplified, and the real-time performance and the execution efficiency for execution of multiple tasks can be greatly enhanced.

Description

technical field [0001] The invention relates to the control field, in particular to a PLC controller supporting the coroutine function. Background technique [0002] In the field of industrial control, there is often a delay between the issuance of the control command and the execution of the control command. Therefore, when an instruction is executed, it is necessary to wait for the instruction to be executed before executing the next instruction. This process is called blocking. Blocking greatly reduces the efficiency and real-time performance of the controller. Therefore, we often adopt a non-blocking programming strategy, that is, after an instruction is executed, it is not necessary to wait for the execution of the instruction to execute the next instruction, but in this case, when executing subsequent instructions, it is necessary to keep checking whether the current instruction is over, otherwise it will cause timing errors. This increases the complexity of program...

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/05
Inventor 胡小春
Owner 湖南戈人自动化科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products