CN106292515B - A kind of communication instruction executive mode of programmable controller - Google Patents

A kind of communication instruction executive mode of programmable controller Download PDF

Info

Publication number
CN106292515B
CN106292515B CN201610769215.9A CN201610769215A CN106292515B CN 106292515 B CN106292515 B CN 106292515B CN 201610769215 A CN201610769215 A CN 201610769215A CN 106292515 B CN106292515 B CN 106292515B
Authority
CN
China
Prior art keywords
instruction
communication
communication instruction
execute
mark
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.)
Active
Application number
CN201610769215.9A
Other languages
Chinese (zh)
Other versions
CN106292515A (en
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.)
Xiamen Sea Technology Co Ltd
Original Assignee
Xiamen Sea Technology Co 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 Xiamen Sea Technology Co Ltd filed Critical Xiamen Sea Technology Co Ltd
Priority to CN201610769215.9A priority Critical patent/CN106292515B/en
Publication of CN106292515A publication Critical patent/CN106292515A/en
Application granted granted Critical
Publication of CN106292515B publication Critical patent/CN106292515B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Communication Control (AREA)
  • Programmable Controllers (AREA)

Abstract

The invention discloses a kind of communication instruction executive modes of programmable controller, including establishing a communication instruction execution table to communication port, the communication instruction execution table, which is equipped with instruction, to be allowed to execute mark and instruction execution complement mark, PLC program scan procedure A scans PLC program and executes, when communication instruction is arrived in scanning, corresponding communication instruction is searched in the communication instruction executive table, according to the enable end state of the communication instruction in a program, (Yes expression allows the communication instruction to execute, No expression does not allow the communication instruction to execute), the instruction being incorporated in the communication instruction executive table allows to execute mark and whether instruction execution complement mark comprehensive judgement modifies described instruction and allow to execute mark, and read instruction execution result and instruction errors code, it is held simultaneously using an individual communication instruction Communication instruction described in traveling journey B scan round executes table, allows to execute mark according to the instruction in the communication instruction execution table and determines whether to execute the instruction, the PLC program scan procedure A and the communication instruction executive process B asynchronous parallel are run.

Description

A kind of communication instruction executive mode of programmable controller
Technical field
The present invention relates to programmable controller field more particularly to a kind of communication instruction sides of execution of programmable controller Formula.
Background technique
Every kind of programmable controller (PLC) has respective communication instruction, they set dependent on communication instruction with third party Standby communication, the communication instruction executive mode of existing PLC mainly use following executive mode: A is to PLC for PLC program scan procedure Program scanning executes, when scanning is to a communication instruction, if communication port is idle and there is electricity in the communication instruction enable end, Execute the communication instruction;Otherwise, it skips the communication instruction and continues to scan on next instruction of execution.Since the execution of communication instruction is One independence and the longer process that compares, when executing communication instruction, it needs to be ready for sending command frame, it is needed after transmission The response of slave devices is waited, the data etc. of slave devices response are handled, and PLC program is that scan round executes, and works as PLC If scan to a communication instruction and meet executable condition, program does not wait for the entire logical of this communication instruction News process terminates, but then scanning executes next instruction.
The defect of this communication instruction executive mode is:
1, communication efficiency is low, if PLC program scan period 30ms, then may between 2 communication instructions execute Generate the interval time of a scan period;
2, programming is complicated, needs the timing of user's communication control instruction execution in a program, and works as communication instruction When executing unsuccessful, being unable to intuitive judgment is because programmed logic problem or communication instruction itself problem cause;
3, when more slaves communicate (a plurality of communication instruction), it is unable to ensure having equal opportunities for all communication instructions execution, Program scanning period and communication instruction execute in the case that the period couples, there are communication instruction never have chance and held Row.
Summary of the invention
It is an object of the invention to overcome above-mentioned the deficiencies in the prior art, a kind of communication instruction of programmable controller is provided Executive mode.
To achieve the above object, the invention adopts the following technical scheme:
A kind of communication instruction executive mode of programmable controller a, comprising: communication instruction is established to communication port and is executed Table, the communication instruction execution table, which is equipped with instruction, to be allowed to execute mark and instruction execution complement mark, PLC program scan procedure A PLC program is scanned and is executed, when communication instruction is arrived in scanning, searches corresponding communication in the communication instruction executive table Instruction, according to the enable end state of the communication instruction in a program, (Yes expression allows the communication instruction to execute, and No expression is not permitted Perhaps the communication instruction executes), the last time instruction being incorporated in the communication instruction executive table allows to execute mark and instruction is held Whether row complement mark comprehensive judgement, which modifies described instruction, allows to execute mark, while being executed using an individual communication instruction Communication instruction described in process B scan round executes table, allows to execute mark according to the instruction in the communication instruction execution table and sentences Fixed whether to execute the instruction, the PLC program scan procedure A and the communication instruction executive process B asynchronous parallel are run.
Further, PLC program scan procedure A scans PLC program and executes, when communication instruction is arrived in scanning, if The enable end state of the communication instruction in a program is No, if the instruction in the communication instruction executive table allows to execute mark For No, then keeping instruction to allow to execute mark is No;If the instruction in the communication instruction executive table allows to execute mark When Yes and instruction execution complement mark are No, keeping instruction to allow to execute mark is Yes;If the communication instruction executes table When it is Yes that instruction in lattice, which allows to execute and indicate, and instruction execution complement mark is Yes, then modifying instruction allows to execute mark For No.
Further, PLC program scan procedure A scans PLC program and executes, when communication instruction is arrived in scanning, if The enable end state of the communication instruction in a program is Yes, and the instruction modified in the communication instruction executive table allows to execute Mark is Yes.
Further, when the communication instruction executive process B executes table progress scan round to the communication instruction, if institute Stating communication instruction allows running mark to be Yes, then runs the communication instruction and modify the instruction execution after instructing end of run Complement mark is Yes;If the communication instruction allows running mark to be No, then skips and continue to scan on next.
Further, the communication instruction execution table further includes instruction execution result and instruction errors code, the communication Instruction execution result and instruction errors code are filled in after the completion of instruction execution.
Further, when the communication port is multiple communication ports, the instruction execution table of each communication port is combinable at one Total communication instruction executes table.
After adopting the above technical scheme, compared with the background technology, the present invention, having the advantages that
1, communication efficiency is high: executing communication instruction by individual communication instruction executive process B scan round and executes in table Communication instruction, communication instruction execute between without the free time, a communication instruction is finished, automatically scanning lower;
2, programming is simple, and without carrying out timing control to communication instruction, all communication instructions can be on program It is parallel to obtain electric execution, as long as checking whether communication instruction itself is correct when communication instruction executes unsuccessful, with programmed logic It is unrelated;
3, when more slaves communicate (a plurality of communication instruction), it is ensured that all communication instructions executed has equal opportunities;
4, it can correctly be executed in the case where communication instruction requires only that energy edging trigger executes primary.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to embodiments, to the present invention It is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not used to Limit the present invention.
Embodiment
A kind of communication instruction executive mode of programmable controller a, comprising: communication instruction is established to communication port and is executed Table, the communication instruction execution table, which is equipped with instruction, to be allowed to execute mark and instruction execution complement mark, PLC program scan procedure A PLC program is scanned and is executed, when communication instruction is arrived in scanning, searches corresponding communication in the communication instruction executive table Instruction, according to the enable end state of the communication instruction in a program, (Yes expression allows the communication instruction to execute, and No expression is not permitted Perhaps the communication instruction executes), the last time instruction being incorporated in the communication instruction executive table allows to execute mark and instruction is held Whether row complement mark comprehensive judgement, which modifies described instruction, allows to execute mark, and reads instruction execution result and instruction errors generation Code, while table is executed using communication instruction described in an individual communication instruction executive process B scan round, according to the communication Instruction in instruction execution table allows to execute mark and determines whether to execute the instruction, and the PLC program scan procedure A leads to described Interrogate the operation of instruction execution process B asynchronous parallel.
Following table is the communication instruction executive table of certain communication port:
" COMM " indicates free protocol instruction in table, and " MODR " indicates that Modbus agreement reads instruction, " MODW " table Showing indicates Modbus agreement write instruction, when the A sweep of PLC program scan procedure is to the 3rd article of communication instruction MODW, if MODW " instruction allows to execute mark " that instruction enable end has electricity (Yes indicate allow to execute) then to modify the MODW instruction in table be Yes;Need that " instruction allows to execute mark according to original if the instruction enable end MODW is without electricity (No indicate do not allow to execute) Will " is handled, if original " instruction allows to execute mark " is No, that modifies the MODW instruction in table " instructs permission Execute mark " it is No;If " instruction allows to execute mark " originally is Yes and " instruction execution complement mark " is Yes (former To allow to execute and execute completion) then modify in table MODW instruction " instruction allows to execute mark " be No;If former " instruction allows to execute mark " come is Yes and " instruction execution complement mark " is that No (allows to execute still not yet originally Execute) it does not modify then, being kept for " instruction allows to execute mark " of the MODW instruction in table is Yes.
When the communication instruction executive process B is scanned the communication instruction execution table, if the communication instruction is permitted Perhaps running mark is Yes, then executing the communication instruction, (initiating communications mouth sends command frame, slave response, processing is waited to answer Answer returned data etc.), and modifying the instruction execution complement mark after instructing end of run is Yes, fills in instruction execution result With instruction errors code.Communication success or failure can be known according to instruction execution result, i.e. according to instruction errors code The reason of road fails;If the communication instruction allows running mark to be No, then skips and continue to scan on next.
It, also can be combinable total at one by the instruction execution table of each communication port when the communication port is multiple communication ports Communication instruction executes table.
Following table is total communication instruction executive table of all communication ports:
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto, In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by anyone skilled in the art, It should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with scope of protection of the claims Subject to.

Claims (6)

1. a kind of communication instruction executive mode of programmable controller characterized by comprising establish a communication to communication port Instruction execution table, the communication instruction executive table, which is equipped with instruction, to be allowed to execute mark and instruction execution complement mark, PLC journey Sequence scan procedure A scans PLC program and executes, and when communication instruction is arrived in scanning, looks into the communication instruction executive table Corresponding communication instruction is looked for, according to the enable end state of the communication instruction in a program, wherein Yes expression allows the communication to refer to It enables and executing, No expression does not allow the communication instruction to execute, and the instruction being incorporated in the communication instruction executive table allows to execute Whether mark and instruction execution complement mark comprehensive judgement, which modify described instruction, allows to execute mark, while individually using one Communication instruction executive table described in communication instruction executive process B scan round, according to the finger in the communication instruction executive table Order allows to execute mark and determines whether to execute the instruction, the PLC program scan procedure A and the communication instruction executive process B Asynchronous parallel operation.
2. a kind of communication instruction executive mode of programmable controller according to claim 1, it is characterised in that: PLC journey Sequence scan procedure A scans PLC program and executes, when scanning is to communication instruction, if the communication instruction making in a program Energy end state is No, then: if it is No that the instruction in the communication instruction executive table, which allows to execute mark, keeping instructing allows Executing mark is No;If the instruction in the communication instruction executive table allows to execute, mark is Yes and instruction execution is completed When mark is No, keeping instruction to allow to execute mark is Yes;If the instruction in the communication instruction executive table allows to execute mark When will is Yes and instruction execution complement mark is Yes, then modifying instruction to allow to execute mark is No.
3. a kind of communication instruction executive mode of programmable controller according to claim 1, it is characterised in that: PLC journey Sequence scan procedure A scans PLC program and executes, when scanning is to communication instruction, if the communication instruction making in a program Energy end state is Yes, and modifying the instruction in the communication instruction executive table to allow to execute mark is Yes.
4. a kind of communication instruction executive mode of programmable controller according to claim 1, it is characterised in that: described logical When interrogating instruction execution process B to communication instruction executive table progress scan round, if the communication instruction allows to execute mark Will is Yes, then running the communication instruction and modifying the instruction execution complement mark after instructing end of run is Yes;If described It is No that communication instruction, which allows to execute mark, then skips and continue to scan on next.
5. a kind of communication instruction executive mode of programmable controller according to claim 1, it is characterised in that: described logical News instruction execution table further includes instruction execution result and instruction errors code, and the communication instruction fills in instruction after the completion of executing Implementing result and instruction errors code.
6. a kind of communication instruction executive mode of programmable controller according to claim 1, it is characterised in that: when described When communication port is multiple communication ports, the communication instruction executive table of each communication port is combinable to execute table at a total communication instruction Lattice.
CN201610769215.9A 2016-08-30 2016-08-30 A kind of communication instruction executive mode of programmable controller Active CN106292515B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610769215.9A CN106292515B (en) 2016-08-30 2016-08-30 A kind of communication instruction executive mode of programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610769215.9A CN106292515B (en) 2016-08-30 2016-08-30 A kind of communication instruction executive mode of programmable controller

Publications (2)

Publication Number Publication Date
CN106292515A CN106292515A (en) 2017-01-04
CN106292515B true CN106292515B (en) 2019-06-21

Family

ID=57674822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610769215.9A Active CN106292515B (en) 2016-08-30 2016-08-30 A kind of communication instruction executive mode of programmable controller

Country Status (1)

Country Link
CN (1) CN106292515B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1185233A (en) * 1998-07-06 1999-03-30 Mitsubishi Electric Corp Programmable controller
EP1134634A2 (en) * 2000-03-15 2001-09-19 Omron Corporation Programmable controller
CN1620015A (en) * 2003-11-20 2005-05-25 欧姆龙株式会社 Communication interface, network system and programmable controller
CN102540952A (en) * 2010-12-09 2012-07-04 通用电气公司 Programmable controller and operation method thereof
CN105172081A (en) * 2015-09-23 2015-12-23 上海大学 Method for achieving combined control over vacuum casting device based on VB and Mitsubishi FX type PLC programming port communication

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1185233A (en) * 1998-07-06 1999-03-30 Mitsubishi Electric Corp Programmable controller
EP1134634A2 (en) * 2000-03-15 2001-09-19 Omron Corporation Programmable controller
CN1620015A (en) * 2003-11-20 2005-05-25 欧姆龙株式会社 Communication interface, network system and programmable controller
CN102540952A (en) * 2010-12-09 2012-07-04 通用电气公司 Programmable controller and operation method thereof
CN105172081A (en) * 2015-09-23 2015-12-23 上海大学 Method for achieving combined control over vacuum casting device based on VB and Mitsubishi FX type PLC programming port communication

Also Published As

Publication number Publication date
CN106292515A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN103746889B (en) Half competitive mode RS-485 bus multi-master communication system and its working method
CN106506595B (en) Upgrade method based on point-to-point Internet of Things intelligent Community equipment
KR20120099222A (en) Multi-processor based programmable logic controller and method for operating the same
JP2017527912A (en) Method, device and system for invoking a local service assembly by a browser
CN104765641A (en) Job scheduling method and system
CN102223655A (en) Underlying multi-thread data transmission method of mobile communication
CN105245545A (en) Access authorization method based on user terminal and router
CN106292515B (en) A kind of communication instruction executive mode of programmable controller
CN105739464B (en) Master Communications method in intelligent appliance equipment
US20100158019A1 (en) Frame transfer apparatus and frame transfer method
WO2019028572A1 (en) Plc automatic trusted configuration method, apparatus, and computer readable storage medium
CN110266735A (en) Industry communications protocol white list access control based on timing
CN110225423A (en) A kind of method, equipment and the medium of the adaptive optical signal rate of switch system
CN103199990A (en) Method and device for routing protocol authentication transfer
CN108055323A (en) A kind of communications protocol based on data link layer
CN111526094A (en) RSTP state machine scheduling method and system
CN104571962B (en) The implementation method of firmware in a kind of USBKEY equipment of suitable batch production
CN109800202A (en) A kind of data transmission system based on PCIE, method and device
KR101605045B1 (en) Apparatus and method for processing duplicated data of redundancy communication line
CN104461872A (en) Debugging information processing method and system
CN103593309A (en) Method of solving problem that off-line connection occurs between PC and android cellphone
CN109842484A (en) A kind of next-hop chain counter update method, device and equipment
KR102115036B1 (en) Communication stabilization system and the method, When the controller software updating
JP2020512106A (en) Remote control disconnection method in washing machine
CN101931830A (en) Method for upgrading secret key in Gigabit passive optical network and optical line terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant