CN1091269C - Logic controller and its logic control method - Google Patents

Logic controller and its logic control method Download PDF

Info

Publication number
CN1091269C
CN1091269C CN 97116274 CN97116274A CN1091269C CN 1091269 C CN1091269 C CN 1091269C CN 97116274 CN97116274 CN 97116274 CN 97116274 A CN97116274 A CN 97116274A CN 1091269 C CN1091269 C CN 1091269C
Authority
CN
China
Prior art keywords
logic
switch
control
statement
logical
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.)
Expired - Fee Related
Application number
CN 97116274
Other languages
Chinese (zh)
Other versions
CN1181524A (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN 97116274 priority Critical patent/CN1091269C/en
Publication of CN1181524A publication Critical patent/CN1181524A/en
Application granted granted Critical
Publication of CN1091269C publication Critical patent/CN1091269C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

The present invention relates to a novel logic controller used for industrial control, and a control method thereof. The controller is directly connected with tested and controlled points by a single-chip computer or a microcomputer system or a serial communication port. Thus, structure types, such as direct tested and controlled types, or neural network tested and controlled pipe types, etc. are formed. The control method comprises: logical control statements composed of soft logic elements, logic conditions of true '1' and false '0', NOT, AND, XOR or logical operators, an external input/output switch, a start symbol, separating symbols, priority operation parentheses and an ending symbol are designed. The controller executes the real-time control over Boolean true values and designated operation of the switch and the elements in a solution logical arithmetic expression. The present invention is easily learned and used.

Description

A kind of logic control method that is applied on the logic controller
The present invention relates to a kind of Industrial Control Computer, relate to a kind of logic controller and logic control method thereof or rather.
The programmable controller PLC that the sixties come out replaces the hard logic element with the soft logic element, and the logic control unit that tradition is used can be used as the soft-component of logical operation.Logical operation and control as hardware such as auxiliary reclay, the time relay, counters, can replace by the logical operation and the control of the soft logic parts of computing machine, thereby improved the reliability of control system greatly, and replaced traditional logic controller gradually, and become the main type of Industry Control, be successfully used to various industrial sectors, as be used for order or logic start-stop, monitor the operation conditions of the various electromechanical equipments of automated production etc.
Along with electronic technology, the develop rapidly of computer technology and network communications technology, the hardware technology of PLC controller and control function have also obtained very big development, detection control as controller is counted more, built-in communication interface, integrated PID function, floating-point operation instruction etc., but on the software of controller, as controller to great variation does not take place on the programming mode of logical operation and control, still adopt trapezoid logic diagram, the programming of Control Software done in the PLL language, require the programming personnel that the knowledge of electrical control aspect and certain computer literacy are arranged, and understand the logical condition of process equipment control.The symbolic representation of its soft logic element is similar to electric logic element, and trapezoid logic diagram is similar to the circuit connection diagram of electrical equipment.Its major defect is: represent the logic element combination of production process equipment and control requirement with the circuit that electric logic element connects, symbol is many, connection is complicated, and the logic implication that has is represented imprecise, and the beginner is difficult for understanding, also difficult the grasp, and it is many and computing time is long to take calculator memory; Circuit connects complicated, increases programming personnel's design effort amount and difficulty.In addition, because the hardware of PLC controller and the measurement controlling object of industry spot connect into an integral body, it is the detection of industry spot and controlling object and the corresponding one by one setting of digital I/O latch (or claiming passage) of controller hardware, the PLC controller is to the relevant logical operation and the control information of industrial field device, need directly to couple together by the digital I/O passage and the on-the-spot measuring and controlling equipment of umbilical cable with logic controller, cable bar number is between the two heightened, not only increased the hardware investment of control system itself, also increased simultaneously the installation of control system, debugging, put into operation, safeguard, the fund expenditure of aspects such as management, and a large amount of cables have taken big quantity space, both increase the construction investment of new factory, also be unfavorable for the automatic technology transformation of old factory.These have all hindered the further popularization of PLC controller.
The objective of the invention is to design a kind of logic controller and logic control method thereof, particularly find the solution the logic control method (can be called for short the LLK method) of logic switch and element true value and assigned operation, to satisfy the constantly needs of development of Industry Control.
This logic controller and logic control method thereof should satisfy: 1) programming operation is simple, easy learns, grasps well, is convenient to work out out quickly and accurately the logic control program of various complexity and is applied to and produce; 2) can improve the automatization level of programming software, can generate some general controls function program automatically, not need user program,, reduce the programming time to improve the programming quality; 3) digital I/O latch (or passage) in the PLC controller hardware and industry spot are detected, the mode that connects direct transmission information between opertaing device with cable, change into indirect load mode with network (or serial) communication, can detection be set according to on-the-spot needs, control is counted, the restriction of the digital I/O latch quantity of uncontrolled device itself, this information transmission mode replaces the part hardware of logic controller with software, can save the hardware investment of controller and control system, the change of this information transmission mode makes logic controller more be similar to people's cerebral nerve control, can constitute five-star industrial Distributed Control System (DCS) DCS in the world today (higher nerve network mode control system).
The object of the present invention is achieved like this, and new logic controller of the present invention is connected with the detection and the opertaing device of industry spot, it is characterized in that:
Described logic controller is a Single Chip Microcomputer (SCM) system or a microcomputer system.
Described Single Chip Microcomputer (SCM) system comprises: single-chip microcomputer and the memory under program that is connected with single-chip microcomputer by bus, random memory, keyboard and display device that ability to communicate is arranged, with the digital I/O passage of being made up of I/O I/O interface, output/input O/I interface, modulus converter A/D, D/A D/A, digital I/O passage connects one to one by the detection and the opertaing device of cable and described industry spot.
Described microcomputer system comprises cpu motherboard that contains serial port and the memory that is connected with mainboard, hard disk, communication network interface card and the keyboard and the display that are connected with keycoder and connector, is connected with two bars transmission lines between the more than one detection of described microcomputer system and described industry spot and opertaing device.
Described microcomputer system comprises PC microcomputer cpu motherboard and the keyboard that is connected with mainboard, hard disk, floppy disk, display device and communication network card, is connected with two bars transmission lines between described microcomputer system and more than one detection of described industry spot and opertaing device.
The logic control method of new logic controller of the present invention is characterized in that adopting following steps:
A, a kind of logic control language of design, by the soft logic element, true 1 or false 0 logical condition, logical operator, outside input switch, outside output switch and the logic control symbol of statement form;
Output or the soft logic element that stores are determined in B, the logical condition of determining manufacturing technique requirent and logical operation;
C, be that true time requires logic switch or the status condition of storage unit and the end mark of logic control statement exported by the separator of the soft logic combination of elements exclusive disjunction of logic control statement first symbol, equipment of industrial product requirement, logic control statement, production process equipment at operation result, order is write the logic control statement;
D, the logic control statement of writing is imported in the described logic controller, logic control software by logic controller generates the mathematical operation formula and finds the solution logic switch and the true value of element and the operation of appointment in the mathematical operation formula, and control is in real time implemented in more than one detection of industry spot and opertaing device.
Described soft logic element comprises the chronotron of being made up of symbol, sequence number and delay value, the counter of being made up of symbol, sequence number and count value, the state reservoir of being made up of symbol, sequence number; Described logical operator comprises " non-", " with ", distance and " or ", described " non-" logical operation is to specifying the state negate of logical condition or soft logic element or I/O switch, described " with " logical operation is when two or more logical conditions of appointment or logic element or I/O on off state are set up simultaneously, operation result is set up the computing for true 1, described XOR computing is that operation result is the computing of true " 1 " when two logical conditions of appointment or soft logic element or I/O on off state are opposite each other, described " or " logical operation is that operation result is the very computing of " 1 " when having only a condition for true " 1 " in two or more logical conditions of appointment; Described outside input switch is made up of symbol and sequence number; Described outside output switch is made of symbol and sequence number; The described logic control symbol of statement comprises identifier, the end mark that is placed on logic control Statement Completion place that is placed on the logic control statement and begins to locate, bracket symbol and the separator of doing preferential computing, and the logic control condition of separator left side production technology and true, the false results of computing determine the true, false of separator right side soft logic element.
The priority ordering of described logical operator and computing priority ranking are " non-, with, XOR or ".
The operation of the true and false and appointment of logic switch and element in the described mathematical operation formula of finding the solution the logic control statement, comprise true 1, false 0 value of obtaining in the formula expression formula in the preferential computing bracket symbol earlier, remove preferential computing bracket symbol again, constantly repeat the preferential computing bracket symbol in all obtaining and remove the mathematical operation formula; Solve true 1, vacation 0 value of logical combination switch and element before the separator; Find the solution true 1, false 0 value of logic output switch behind the separator or element, true 1, false 0 value of output logic switch or element press logic switch and element before the separator true 1, vacation 0 value is definite.
New logic controller of the present invention has utilized the last word of new and high technologies such as electronic technology, computer technology, mechanics of communication and special Control Software, has overcome the shortcoming of PLC controller, has the significant social economic benefit.Its beneficial effect is:
1, improved the reliability of control system, can constitute Distributed Control System (DCS) DCS-higher nerve network type control system up-to-date in the world today with this new logic controller, the region dispersion of realization control system, function dispersion, scattered risks etc., thereby the raising of acquisition control system global reliability;
2, the hardware investment of control system and relevant fund expenditure thereof have been reduced, because new logic controller hardware price is low, its detection and reference mark to industry spot can be determined as required, replace umbilical cable to transmit relevant controlling information with network communication, thereby reduce a large amount of cables investments and corresponding worker builds, installs, the expense of debugging etc.;
3, in the automatic control of industrial and mining enterprises is transformed, use this logic controller not only can conveniently transform, also can reduce the hardware investment of control system and installation, debugging cost;
4, the logic control of new logic controller programming simple, easily learn, the good grasp, supporting with relevant hardware, can together enter the ordinary people man with the PC computing machine, help improving the whole people's quality of life and to the study of automatic control knowledge.
Further specify technology of the present invention below in conjunction with embodiment and accompanying drawing
Fig. 1, direct test-and-control type logic controller hardware are formed theory diagram;
Fig. 2, neural network observing and controlling cast logic controller hardware are formed theory diagram;
Fig. 3, motor forward and backward control circuit figure;
Fig. 4, motor forward and backward trapezoid logic diagram;
The trapezoid logic diagram program of Fig. 5, electronic lock;
Fig. 6, judgement have or not the program flow chart of square bracket to [];
Fig. 7, separate square bracket [... ] program flow chart;
Fig. 8, inverse program flow chart;
Fig. 9, with, XOR, exclusive disjunction program flow chart;
Figure 10, removal square bracket are to [] program flow chart;
The program flow chart of Figure 11, displacement operation;
Figure 12, the Boolean program flow chart of finding the solution no bracket logic switch and elements combination;
The assigned operation program flow chart of Figure 13, mathematical operation formula.
Because logic controller is different with the detection and the information transmission mode between opertaing device of industry spot, the change of new logic controller performance and the variation of hardware configuration will be had influence on, so press the different of the detection of controller and industry spot and the information transmission mode between opertaing device, the hardware of new logic controller is divided into direct detection control type (as shown in Figure 1), and neural network monitoring keyholed back plate type (as shown in Figure 2) and mixing detect three kinds of versions of control type.
Referring to Fig. 1, direct detection control type new logic controller shown in the figure and industry spot detect and opertaing device between information transmission mode identical with the PLC logic controller, be that the I/O latch (or passage) of controller and on-the-spot detection reference mark are one to one, observing and controlling information directly transmits by umbilical cable, thereby the hardware quantities such as I/O of controller increase with measuring control point and increase.When constituting control system, used cable amount also increases, and if certain part has the observing and controlling functional fault in the system, overhaul recovery, need stop total system, influence is produced, thereby the direct test-and-control type of new logic controller, it is less to be used for measuring control point, and from the industrial site of the close together of controller.
Directly the test-and-control type logic controller adopts bus structure (STD bus or PC bus), the single-chip microcomputer 101 (or miniature PLC control module) of selecting high-performance for use and having ability to communicate, with control signal wire, the I/O port line is divided into signal, the address, control and power bus 102, and on bus 102, expand the external component of single-chip microcomputer 101, comprise program storage 103 (EPROM, EEPROM), random access memory 104 (RAM, DRAM), display device 105 (interfaces, keyboard and CRT monitor), printing equipment 106 (interface and printer), numeral I/O latch (or passage) 107, transwitch (SSR) 108, photoelectricity is isolated input/output device 109 etc.10 is the Single Chip Microcomputer (SCM) system of new logic controller among the figure, and 11 is the switch board of industry spot.Photoelectricity is isolated input/output device 109 and is sent the measurement and control signal of the corresponding measuring control point of industry spot the O/I interface of new logic controller to through cable, and the simulating signal of industry spot switch board 11 respective detection points sends the A/D transducer of new logic controller to through cable.The control signal of new logic controller output sends industry spot switch board 11 respectively through D/A transducer and transwitch 108 to by cable.
The principle of work of this direct test-and-control type controller is: CPU 101 passes through the address, chip selection signal, and the control of external memory storage read-write etc. is directly imported the industry spot transducing signal from umbilical cable from hardware such as data bus input channels; The production information of transmitters sense, (CPU) makes the controlled information of information processing such as logical operation through central processing unit, directly output to on-the-spot topworks by umbilical cable through hardware such as output channels and carry out, thereby realization is to the control of industry spot electromechanical equipment.
The design feature of neural network monitoring keyholed back plate type logic controller is: insert network communication plate (BITBUS) by the serial communication interface of controller hardware or in the isa bus groove of hardware mainboard, mutual transmission information between the detection of usefulness communication modes and industry spot, opertaing device; Workshop and factory's central control room transmit information mutually in insertion MODEM network communication card and the factory, form the industrial information highway.Controller can collect data acquisition, information processing, control automatically (logic control, Direct Digital control, Monitoring and Controlling), optimum management.The variation of information transmission mode makes new controller more be similar to people's brain.The production information that the industry spot various kinds of sensors is gathered, the microprocessor in network communication reaches controller, through the processing such as logical operation of CPU, the control information of generation reaches field controller through network communication again and carries out.
During enforcement, its new logic controller can have two kinds of hardware composition proposals:
1, adopts PC bus industrial standard PC case, motherboard design is helped integrated, high-performance CPU (80486) mainboard, EPROM socket, memory span 1-8MB are arranged on the plate, there are two with 16550 serial port, two IDE hard-disk interfaces, keycoder and connector etc. are arranged, mix keyboard, display etc. and form computer system, insert the communication network interface card again on the ISA socket in cabinet and form the new logic controller.
2, buy high-performance in market, the PC microcomputer mainboard of band ISA and pci bus socket, high-performance CPU (as 80486) is arranged on the plate, and mix keyboard, hard disk, floppy disk, display card, displays etc. are formed microcomputer system, insert communication network card (BITBUS and MODEM) again and just can form neural network monitoring keyholed back plate type new controller on the ISA socket, as shown in Figure 2.
20 is the new logic controller among Fig. 2, and 21 is each single-chip microcomputer or the intelligence instrument of industry spot, is connected with two cables between the two.Controller 20 comprises computer motherboard 201 and the hard disk 202 that is connected with mainboard, floppy drive 203, random memory 204, printing equipment 205 and display device 206.Each single-chip microcomputer of industry spot or intelligence instrument 21 are separately positioned on 1 to several slave stations (CPU1-CPUn), adopt position bus (Bit Bus) contact of serial (CCU is communicationcontYol unity) communication modes and logic controller 20, each slave station is connected with on-the-spot detecting device, switchgear 211 etc. by input, output channel I/O, O/I respectively.New logic controller 20 is connected with the microsystem of central control room (CCR) by MODEM network communication card.
Neural network type monitoring control-management system is the five-star industrial distributing system in the world today (DCS), because system can realize region dispersion, function dispersion, scattered risks etc., thereby the entire system reliability is improved, detecting control information transmits through network, make between the I/O passage (or latch) of new controller hardware and industry spot various kinds of sensors, the actuator and do not have one-to-one relationship, thereby the observing and controlling of controller is counted unrestricted, only definite according to the needs of industry spot.This has not only reduced the hardware price of new controller, has also reduced a large amount of umbilical cable that constitute control system.
Neural network monitoring keyholed back plate type new logic controller, similar people's brain, it transmits information with network communication mode, make no direct corresponding relation between the detection, opertaing device of the hardware of controller and industry spot, so can be with up-to-date, the PC computing machine of peak performance, network communication card, show that the hardware that (CRT) waits is used for the new logic controller, i.e. the controller hardware development that can follow technology closely is easy to that function expands and update.
Computer bus in the neural network monitoring keyholed back plate type hardware is as people's nervous centralis, be data and transmission of Information passage, thereby neural observing and controlling cast new controller can adopt the fastest PC computing machine of present world development to make the information processing centre of controller, adopt the PC bus to transmit information, adopt network communication mode the detection of industry spot, the information processing centre PC computing machine of opertaing device and controller couples together.
Mix and detect control type new logic controller, and industry spot detects and adopts dual mode to transmit information between opertaing device, promptly a part is that I/O passage and the on-the-spot opertaing device that detects by controller hardware self directly transmits, another part information is through serial communication interface or network communication and the transmission of industry spot detection opertaing device, but during forming control system, the influence that its performance is directly transmitted by information mainly is so should be summed up as direct transmission type.
The new logic controller hardware, change the load mode of hardware by software to information, and make the I/O passage of controller and on-the-spot detection opertaing device break away from direct corresponding relation, not only having reduced the hardware of controller forms, also strengthened hardware performance, the detection opertaing device that may command industry spot amount multiaspect is wide, can integrate data acquisition, information processing, control (logic control, supervision and control, DDC control, optimization control etc.) automatically, so the software of new logic controller is the soul of controller.Below in conjunction with the cipher control of control of motor forward and backward and electronic lock, from its ladder logic control chart programming software and new logic controller programming software two aspect comparative descriptions logic control method of the present invention.
True, false logical condition of the present invention, true with " 1 " expression, false with " 0 " expression, " 1 " is that the logical condition of appointment in the statement is set up, and should be shutoff as the logic element or the I/O switch of appointment, testing result then be very " 1 " also when turn-offing; " 0 " is that the logical condition of appointment is false in the statement, should be shutoff as the logical condition or the I/O switch of appointment, but testing result then be vacation " 0 " when connecting.The setting of this true and false logical condition helps the controlled condition and the requirement of production technology are write in the software programming of computing machine to logic control.
Soft logic element used in the present invention comprises chronotron Sn () N, counter Jn () N and status register Rn.Wherein S, J, R are respectively the symbol of chronotron, counter, status register (or internal relay), n is the sequence number of chronotron, counter, status register, N is the count value of the delay value or the counter of chronotron, writes state " 0 " or " 1 " of counterlogic element in the bracket.As Sn () N, expression condition time-delay, trigger during Sn (0) N, " 0 " vacation is closed, and delays time and finishes Sn (1), " very ", connection through the N back of delay time second; When time delay condition was false " 0 ", Sn (0) N resetted, " 0 " vacation.And for example, Jn (0) N is the counter initial state, closes, and when count pulse entered, N reduced one by one, and when N=0, counter Jn (1) connects.Status register Rn (0) expression is closed, and " 0 ", vacation, no store status, Rn (1) expression status register is connected, and " 1 " is true.
Logical operator used in the present invention comprise non-(f), with (t, simultaneously), XOR (b, different) and or (h or), adopt Chinese mark with phonetic symbols initial to represent, be convenient to memory." non-" expression becomes connection to the state negate of the logical condition of appointment, logic element, I/O switch as appointment is closed, or specifies to connect to transfer to and close; " with " expression sets up simultaneously to two or more logical conditions of appointment, or the detection of two or more logic elements, I/O switch all met to specify requires to be " 1 " true time, is output as very, otherwise is output as vacation " 0 "; Distance is represented two logical conditions to appointment, one be that " 1 " is true, another is " 0 " vacation, or two logic elements of appointment or I/O switch, when detected opposite states, promptly close another when connecting for one, be output as true " 1 ", otherwise be output as vacation " 0 "; " or " represent two or more logical conditions to appointment, when wherein any logical condition was set up to true " 1 ", it was true to be output as " 1 ", otherwise is output as " 0 " vacation.
Outside input switch used in the present invention (switching signal that industry spot is sent through conversions such as machinery, photoelectricity) 10 usefulness Xn () expression, X is the symbol of outside input switch, and n is a sequence number, and content in the bracket (0 or 1) is its state.Close " 0 " for false as the outside input switch of Xn (0) expression, it is true that the outside input switch of Xn (1) expression is connected " 1 ".
Outside output switch used in the present invention represents that with yn () y is the symbol of outside output switch, and n is a sequence number, and content in the bracket (0 or 1) is its state.Close " 0 " for false as the outside output of yn (0) expression switch, Yn (1) expression outside output switch connection " 1 " is true.
Logical statement symbol used in the present invention comprises the identifier that is placed on the logic control statement that the logic control statement begins to locate }; Be placed on the Jie Shufu @} of the logic control statement at logic control Statement Completion place; Make a left side (, the right side) the square bracket symbol of preferential computing; With separator #, the separator left side is the logic control condition and the computing of production technology, and true, false (0,1) of separator the right logic element are determined by true, false (0,1) of separator left side operation result.
The logic control method of new logic controller of the present invention comprises to be write the logic control statement, finds the solution boolean's true value of logic switch and element in the logical operation formula and assigned operation etc., wherein writes the logic control statement and mainly comprises two big steps:
The logical condition of a, at first definite manufacturing technique requirent and the logic element of computing and output or storage;
B, write the logic control statement, the logic control statement is with { beginning, then write the logic element combination exclusive disjunction of explained hereafter equipment requirements, in the time of in whole computing, need preferentially carrying out as some computing, need to add in computing [... ], left and right sides bracket must occur in pairs, after logic element combination exclusive disjunction has been write, write separator #, then writing production technology equipment is " 1 " true time at operation result, the logic switch of requirement output and the state " 1 " of storage unit are true, " 0 " vacation, when two or more logic element being arranged as output, need in that per two interelements add "; ", logic control statement Yi @} finishes.
When occurring chronotron Sn () N in the logic control statement, the logical condition exclusive disjunction result on its left side is " 1 " true time, and chronotron enters the delay working state, and Sn (0) represents trigger or delaying time that " 0 " expression is false; Sn (1) expression time-delay finishes, and " 1 " expression is true; Also can represent, be " 0 " vacation as the logical condition exclusive disjunction result on the chronotron left side, and chronotron resets, and Sn (0) is " 0 " vacation.In addition, the value when 0,1 in separator # the right logic element or the storer in the round bracket expressed separator left side operation result for " 1 ", if operation result is " 0 ", the value in the round bracket is tackled value " 1 " or " 0 " negate of former regulation.
Fig. 3 to Fig. 5 illustrates two examples with the step and the method for logic control language braiding logic control program of the present invention, and itself and PLC controller trapezoid logic diagram not existing together in programming is described, from mutual comparison, understand the logic control method of new logic controller of the present invention.
Fig. 3 illustrates the forward and backward control circuit of single phase motor M, and Y1~Y4 is a solid-state relay in the control circuit, and when Y1 and Y3 connected simultaneously, single phase motor just changeed, when Y2 and Y4 connect simultaneously, and the single phase motor counter-rotating.The control of its production technology requires: when input switch X1 (1) connects, when X2 (0) disconnected simultaneously, the motor of delay time after 2 seconds was connected and is just changeed, and when switch X1 (0) disconnects, when X2 (1) connected simultaneously, the motor connection of delay time after 2 seconds was reversed.
Fig. 4 illustrates the trapezoid logic diagram program of single phase motor rotating control, and its first half is represented: contact X1 often opens, when normally closed contact X2 is closed, and S1 gets electric time-delay 2 seconds, the S1 chronotron, and the normally opened contact closure, Y1, Y3 conducting, motor just changes.Its latter half is represented: X1 is normally closed, X2 normally opened contact closure, and S2 gets electric time-delay 2 seconds, S2 chronotron, normally opened contact closure, Y2, the counter-rotating of Y4 conducting motor.
Writing into logic control statement of the present invention is:
{X1(1)TX2(0)TS1(1)2#Y1(1),Y3(1)@}
{X1(0)TX2(1)TS2(1)2#Y2(1),Y4(1)@}
The 1st statement wherein, separator # represents on the left side: connect as switch X1 (1), switch X2 (0) disconnects simultaneously, starting chronotron S1 (1) time-delay 2 seconds, chronotron is initial state S1 (0), does not meet the appointment of statement, be " 0 " vacation, output false " 0 ", the same Y3 of y1 (1) (1) behind the # also should be false at this moment, Y1 (0), Y3 (0) disconnects, when time-delay was arrived in 2 seconds, it is true that chronotron becomes S1 (1), and three logic elements are all eligible to be true, is output as true (1).Separator # the right expression: the same Y3 of Y1 (1) (1) is true, and promptly the output switch connection of controller is connected transwitch Y1 and Y3, and motor just changes.
The 2nd statement is, the direct expression that logical condition of explained hereafter (or elements combination) and control require, be that input switch X1 (0) disconnects, when simultaneously X2 (1) connected, starting chronotron S2 (1) 2 time-delay was delayed time 2 seconds the time, the output switch Y2 (1) of controller, Y4 (1) connects, and transwitch Y2 and Y4 connect simultaneously, the motor counter-rotating.
Fig. 5 illustrates a kind of electronic lock control program of realizing with trapezoid logic diagram, and its control requirement is:
On ten key boards, select for use wherein five to make password, X10 is a reset key, and X0, X3, X5, X6, the arbitrary button of X8 are pressed, and electronic lock will be by locked and warning, X7, X2, X9, X4, X1 must push in proper order and can open electronic lock, will be by locked warning as reversed order.
41,42 expression keying mistakes are by reporting to the police among the figure; 43,44,45,46,47 order of representation are pushed each key; 48 expression button order are not to reporting to the police; 49 expression output alarms; 49 ' expression output electronic lock is opened.
Writing into logic control statement of the present invention is:
1、{X10(0)T[X7(1)HR1(1)]#R1(1)@}
2、{X10(0)T[X2(1)TR1(1)HR2(1)]#R2(1)@}
3、{X10(0)T[X9(1)TR2(1)HR3(1)]#R3(1)@}
4、{X10(0)T[X4(1)TR3(1)HR4(1)]#R4](1)@}
5、{X10(0)T[X1(1)TR4(1)HR5(1)]#R5(1)@}
6、{X10(0)T[X0(1)HX3(1)HX5(1)HX6(1)HX8(1)HX2(1)TR1(0)HX9(1)TR2(0)HX?4(1)TR3(0)HX1(1)TR4(0)]#R0(1),Y0(1)@}
7、{X10(0)TR5(1)TR0(0)#Y1(1)@}
Wherein pressing keys in order represented in the 1st statement, and storer R1, R2, R3, R4, R5 connect in turn, and the 2nd statement represents that then electronic lock resets as long as X10 is pressed; The the 3rd to the 6th statement represent wrong press button or not in order button will send and report to the police and pin electronic lock; The 7th statement represents that in order button and button are errorless, and then electronic lock is opened.
Above-mentioned case representation, when programming with trapezoid logic diagram, at first the various logic switch of production process equipment and element are transformed into often opening of electrical equipment, normally closed contact and coil, and then connect into logical operation and the control that circuit is realized production process equipment with electrical equipment.The major defect of doing like this is scientific, advance, practicality is relatively poor, and its reason is in logic control, logic element mainly uses very " 1 " connection, false " 0 " disconnects, and does logical operation, and ambiguous with coil presentation logic component concept, originally be to do logical operation with advanced computing machine, but connect into circuit with electrical equipment and represent that complex structure is ugly, readability is also poor.According to such situation, in new logic controller software programming to the definition of logic switch and element and statement in scientific, practicality, advanced very tight in conjunction with getting, for example logic switch and element are defined as disconnection, false " 0 " and true " 1 " two states of connection, and give clear and definite expression, be not only tight science but also advanced person like this, meet the modem logic computing.And for example in this statement, be appointed as " pass ", and detection in service also is " pass ", requirement up to specification is then for connecting, and is true, " 1 ", so just and people in a minute the custom of working be connected as a single entity, practical.Can state the programming that finishes and finish as the logic element combination of stating the production process equipment regulation in a minute and control requirement when writing statement.Thereby we can say that the new logic controller is programmed with logic control statement of the present invention, be to save time, save worry, and safe and reliable control of quality is arranged in logic control, use the dramatic change of ladder logic control chart programming for many years, programme always.
The program flow chart of Fig. 6 to Figure 13 illustrates the logic switch and the combination of elements by the production process equipment appointment of writing with the logic control statement, finds the solution true " 1 " or false " 0 "; And according to true " 1 " of solving result change output switch or logic element, the statement implementation of false " 0 ".The Boolean and the assigned operation of finding the solution logic switch and element can be divided into eight kinds of basic operation controls, and be extremely shown in Figure 13 as Fig. 6 respectively, all can work out out with the different language of computing machine.True " 1 ", vacation " 0 " value of each logic output switch after solving, it is number corresponding to adopt direct output method will export switch number and output channel, carries out by output order; Also can adopt the network communication method to transmit, the data word that the output switch is formed is corresponding from station number with network communication.
The general mathematical operation expression formula that changes into behind the input logic controller as the logic control statement is:
a{i}=〔“Xn”&“Rm”!〔“Xn-1”∧/“Rm-1”!…〕&〔……〕…〕……#yQ(1),Sp(1)@
Wherein m, n, Q, P are the maximal values of counterlogic switch or element sequence number, and the priority ordering of logical operator is/, ﹠amp; , ∧,! (non-, with, XOR or), the order of operation of mathematics formula is:
1, obtain the position of paired [] square bracket in the formula, solve true " 1 " of expression formula in the square bracket, false " 0 " is worth, and removes square bracket, the continuous repetition, and before all paired square bracket are all removed and solved # true " 1 " of logical combination switch, false " 0 " is worth;
2, ask true " 1 " of logic output switch behind the # or element, false " 0 " value, true " 1 " of output logic switch or element, false " 0 " value is true " 1 " by logic switch before the # and element, vacation " 0 " is worth next definite.
Logic controller is in the process of finding the solution logical operation formula Boolean and assigned operation, address with parameter in the variable storage mathematical operation formulas such as i, j, K, m, n, as i be used to deposit left square bracket (the address, j is used to deposit right-hand bracket) the address, K is used to deposit logical operator (/, ﹠amp; , ∧,! ) the address, n is used to store the start address of mathematical operation formula, m is used in solution procedure, stores the address of certain parameter, or the difference in address of certain two parameter.In the process of finding the solution the mathematical operation formula,, store logical operator (/, ﹠amp between a, b two Boolean variables with c with the Boolean variable value of a, b variable storage logic switch or element; , ∧,! ), as a=acb, expression is done the c logical operation, and the Boolean of operation result is paid in a a, b two Boolean variables.
Fig. 6 illustrates and has or not the program flow chart (program entry CR1) of square bracket to () in the decision logic arithmetic expression, there is not () bracket pair, procedure turn does not have the Boolean that bracket pair is found the solution logic switch and elements combination, () bracket pair is arranged, and the Boolean of logical operation in the bracket pair is found the solution in procedure turn.
Each frame meaning is as follows among the figure:
1, x, y, s, J initialization are after i=j=K=a=b=c=o-new logic controller powers on, at first to zero clearings such as the variable i that will use in the program, j, K, a, b, c; The first storage address of mathematics fortune volume formula is put into the n addressed memory; The outside input switch Xn zero clearing that program is used, to output switch yn according to the technological requirement zero clearing or put 1; Timer Sn, the timing of counter Jn, count value N that program is required send into corresponding memory;
2, m=(the n)-mathematical operation formula start address value in the n storer is paid in m;
3, a=(m), a=(?-pay a with the address value in the m storer, and the inquiry a whether have left square bracket (;
4, i=m-pays the address variable i if left square bracket is arranged with the left square bracket address value of m;
5, m=m+1, a=(m)-m address value adds 1, pays a with the content of corresponding stored device;
6, a=)? whether-inquiry a has right-hand bracket);
7, a=#? whether-inquiry is # number with a; Outlet CR7;
8, m=m+1-is when a is not #, and the m address adds 1;
9, j=m-is with the right-hand bracket of m] address value pays j, outlet CR2.
Fig. 7 illustrates the program flow chart of finding the solution the interior logical operation Boolean of square bracket (), inlet CR2, and when having only 1 Boolean in the square bracket, square bracket are removed in procedure turn; When logical operator and Boolean variable are arranged in the square bracket, judge in regular turn by the priority level of logical operation to have or not/, ﹠amp; , ∧,! Computing has, then procedure turn corresponding logical operation.Each frame meaning is as follows among the figure:
10, m=j-i, m=2?-the address value that allows m address variable equal right-hand bracket j subtracts the left square bracket [address value of j, and ask that the value of m equals 2, has outlet CR3;
11, m>2? the value of-m is greater than 2;
12, m=i+1-when m greater than 2 the time, the reservoir address that makes m equal i (left square bracket) adds 1;
13, a=[m]-content of address m corresponding stored device is paid in a;
14, a=/?-a equal non-(/) operational symbol/?
15, a=]? does-a equal the storage address of right-hand bracket memory?
16, m=m+1-address variable m adds 1;
17, k=m, c=[m]-a=/time, allow k equal m and pay c the content of m address corresponding stored device;
18, m=m+1, a=[m]-the m address adds 1, and pays a the corresponding memory content in m address;
19, a≤1?-a value is less than or equal to 1, program exit CRS;
20, c=﹠amp;-will with (﹠amp; ) operational symbol pays c;
21, m=j-i, m=2?-allow m equal the right parenthesis storage address to subtract the left parenthesis storage address, when m=2, program is changeed and is removed the bracket program, inlet CR9 is arranged, outlet CR5;
22, m 〉=4-m value is more than or equal to 4, if be not equal to then alarm;
23, the m=i+1-m value allowed m equal the address of left square bracket more than or equal to 4 o'clock;
24, a=[m], a=c?-paying a with m respective memory memory contents, a equals c logical operator (﹠amp; , ∧,! ), outlet CR4 is arranged to process block 28;
25, a=]?-a equals to store the address of right-hand bracket storer;
When 26, m=m+1-a was not equal to right-hand bracket address, address variable m added 1;
27, c=﹠amp;-c operational symbol is and (﹠amp; ) operational symbol?
28, c=∧-pay c, program exit CR9 with XOR (∧) operational symbol;
29, c=∧?-c operational symbol is XOR (∧) operational symbol;
30, c=!-will or (! ) operational symbol pays c, program exit CR9;
Referring to Fig. 8, be non-(/) operation program FB(flow block), program entry CR3, NOT logic arithmetic operation a=/a, pay a with the end value after the Boolean variable a negate, procedure turn turns to displacement program (seeing Figure 11) after end value a being sent into the storer of storage/symbol.Each frame meaning is as follows among the figure:
32, a=Ca-a gets non-and pays a;
33, [k]=a-puts into the storer that the address is k with a value;
34, k=m, b=1-allow the k=m address value.
Referring to Fig. 9, for " with, XOR, exclusive disjunction program flow chart, inlet CR4, its logical expression a=ach, that pay c is Luo Jiyunsuanfu ﹠amp; Or ∧ or! , promptly the c logic operation result of Boolean variable a and b is paid a; Procedure turn turns to the displacement program after end value a being sent into the storer of storage a value.Each frame meaning is as follows among the figure:
35, a=[m-1], b=[m+1]-be that the memory content of m-1 is paid a and is that the memory content of m+1 is paid b with the address with the address;
36, a! , b≤1? does the result of-a or b equal less than 1?
37, the logic operation result of a=acb-a and b is paid a;
38, [m-1]=a-puts into the storer that the address is m-1 with a;
39, k=m, b=2-allow k equal the m address value, and b equals 2, outlet CR6.
Referring to Figure 10, for removing square bracket [] program flow chart, inlet CR5, remove the operation of [], when having only 1 Boolean variable value in the bracket, after Boolean send a in the bracket, again a is sent in the storer of left square bracket address and replace left square bracket, make b=2 and forward the displacement program to.Each frame meaning is as follows among the figure:
40, m=i+1, a=[m]-allow m equal left parenthesis i address value to add 1, be that the content in the storer of m is paid a with the address;
41, a≤1?-a equals less than 1;
42, [i]=a, k=m-puts into the left square bracket [internal memory of address with a;
43, i=j=0, b=2-allow i=j=0, and b equals 2, outlet CR6.
Referring to Figure 11, be the program flow chart of shifting function, inlet CR6.The memory content displacement operation, its operation formula a=[k+b], [k]=a, k is an offset variable in the formula, and b is the displacement parameter, and displacement is to be that content is displaced in the storer that the address is k in the storer of k+b with the address, k of every displacement adds 1, is till the content of k+b storer is up to the address; Displacement operation finishes the back procedure turn, do not separate the bracket sign if having, be i=j=0, make the memory address one formula first address of a=storage #, then ask the assigned operation of formula, if program entry item is removed in a>1 as a=1, if separate the bracket sign, be i ≠ j ≠ 0, remove to separate square bracket, as item going to separate bracket operation in j-i>2 according to the logical operation of c as j-i=2.Each frame meaning is as follows among the figure:
44, a=[k+b], [k]=a-is that the memory content of k+b is paid a with the address, and a is put into the storer that the address is k;
45, a=#?-a equals # number;
When 46, P=k+b-a equaled #, the address P of storage # storer was k+b;
47, a=@?-a equals @;
48, the k=k+1-k address adds 1;
48 ', i=j=0-address variable i, j be zero;
49, k=P-[n], k>1?-i, j are zero, allow k equal # place storage address P and subtract formula first address [n], outlet CR1, CR8;
50, j=j-b, c=/?-i, when j is non-vanishing, allow right-hand bracket j address subtract b, c equals the NOT logic operational symbol, outlet CR2, CR9.
Referring to Figure 12, the Boolean program flow chart of logic switch and elements combination when finding the solution no square bracket, inlet CR7.When formula does not have square bracket, by the right of priority of logical operation/; , ∧,! Check successively to have or not above-mentioned logical operation in the formula before # number, have then to turn to the corresponding logical operation program, till the Boolean that solves combination.Each frame meaning is as follows among the figure:
51, m=[n]-address variable m paid with first storage address [n] in the formula;
52, c=[m], c=/?-be that the memory content of m is paid c with the address, ask that c equals the inverse symbol;
53, c=#?-c equals the # symbol;
54, m=m+1-address variable m adds 1;
55, k=m, m=m+1, a=[m]-k equals the m address value, and address variable m adds 1, pays a with the content of m addressed memory;
56, a≤1?-a exports CR3 smaller or equal to 1;
57, P=m, k=P-[n]-P equals to store the address of # storer, and k equals P address and subtracts formula first address [n];
58, k>1?-k value produces a mouthful CR8 greater than 1 if be not more than 1;
59, c=﹠amp;-k value is greater than 1 o'clock, with Yun Suanfu ﹠amp; Pay in c;
60, m=[n], a=[m]-pay m with the address contents of n storer, pay a with m address corresponding memory content, inlet CR10 is arranged;
61, a=c?-a equals the c logical operator, if a=c produces a mouthful CR4;
62, a=#?-a equals the # symbol;
63, m=m+1, a=[m]-address variable m adds 1, pays a with m address respective memory content;
64, P=m, k=P-[n]-allow P equal address variable m value, k equals the P value and subtracts formula first address [n];
65, k>1?-k value if the k value is not more than 1, then produces a mouthful CR8 greater than 1;
66, c=﹠amp;-c Deng Yu ﹠amp; Operational symbol;
67, c=∧-allow c equal the ∧ operational symbol, program exit CR10;
68, c=∧?-c equals the ∧ operational symbol;
69, c=!-allow c equal! Operational symbol, program exit CR10.
Referring to Figure 13, be assigned operation FB(flow block) behind the formula #, inlet CR8.When finding the solution the assigned operation of formula, if the Boolean that combination is separated before the # in the formula is true " 1 ", then the output logic switch yd () behind the # waits and exports constant by former formula; Be false " 0 " as the Boolean separated of combination before the #, then to wait be to export after the former formula negate to the output logic switch Yd () behind the # again.Each frame meaning is as follows among the figure:
70, m=[n], a=[m]-pay address variable m with the formula first address content of n storer, m addressed memory content is paid a;
71, a=1?-a equals 1;
72, a=0?-a equals 0;
73, Yd ()=/Yd? behind the # ...-combination Boolean is false " 0 ", logic switch and element inverted value behind the #;
74, yd ()=Yd () is behind the # ... the Boolean of-combination be true " 1 ", and the logic switch after # number is pressed designated value with element and exported;
75, End-EOP (end of program).

Claims (2)

1. a logic control method that is applied on the logic controller is characterized in that adopting following steps:
(1) a kind of logic control language of design, by the intelligent logical variable, logical operator, logic control statement symbol is formed;
(2) constitute the basic variable that the intelligent logical switch is made the logic control language with logic switch and condition virtual switch;
Logic switch value when (3) condition virtual switch value is the control procedure realization;
(4) the logic control language appends to logic controller, and with the input of logic controller, direct with the on-the-spot detection opertaing device of output intelligent logical switch connects one to one, and constitutes industrial logic control system;
(5) user directly accurately represents with the logical operation and the intelligent logical switch of a plurality of intelligent logical switches: when explained hereafter or electromechanical equipment are controlled desired electrical control condition and condition and are set up to the value or the operation of logic switch;
(6) with statement initial symbol " { ", the intelligent logical switch, logical operator " T, H ", priority logic operational symbol " [] ", condition separator " # ", switch separator ", ", statement terminator " } " is formed the logic control statement.By serial controlled condition and operation thereof that explained hereafter or electromechanical equipment control procedure are proposed, order is write the logic control statement, uses control end mark " @ " when control procedure finishes;
(7) process control block (PCB) that serial logic control statement is formed is input in the logic controller by the Control Software order of logic controller and finds the solution each logic control statement in the control program one by one until end, reciprocation cycle realizes the detection and the opertaing device of industry spot are implemented control in real time.
2. it is characterized in that according to the described logic control method of claim 1: the logic control language of described logic control method comprises:
A. the intelligent logical switch is made up of hard intelligent logical switch and soft intelligent logical switch;
(a) hard intelligent logical switch comprises input intelligent logical switch and output intelligent logical switch;
Input intelligent logical switch, by symbol, sequence number, the condition virtual switch is formed;
Output intelligent logical switch, by symbol, sequence number, the condition virtual switch is formed;
(b) soft intelligent logical switch comprises time-delay intelligent logical switch, counting intelligent logical switch and memory intelligent logical switch;
Time-delay intelligent logical switch, by symbol, sequence number, the condition virtual switch, delay value is formed;
Counting intelligent logical switch, by symbol, sequence number, the condition virtual switch, count value is formed;
Memory intelligent logical switch, by symbol, sequence number, the condition virtual switch is formed;
B, logical operation comprise with logical operation T and or logical operation H; The right of priority of logical operation " T, H " is that T is greater than H;
C, logic control statement symbol comprises the initial symbol of statement " { ", sentence end mark " } ", priority logic operational symbol " [] ", condition separator " # ", switch separator ", " and control end mark " @ ";
(a) " { " is placed on statement and begins the place the initial symbol of statement;
(b) statement terminator " } " be placed on the Statement Completion place;
(c) priority logic operational symbol " [] " is placed on the initial sum termination place of a plurality of intelligent switchs that need preferentially carry out logical operation, when a statement has a plurality of priority logic operational symbols " [[]] ", solution procedure is from the internal layer to the skin, remove " [] " after obtaining the end value of every pair " [] ", in statement, do not have " [] ";
(d) condition separator " # ", " # " left side are the production technology represented with the logical operation of intelligent logical switch or the electrical control condition of electromechanical equipment, are controlled output intelligent logical switches on the right of " # ", soft intelligent logical switch;
(e) switch separator ", " is placed on two intelligent logical switch rooms on " # " right side;
(f) control end mark " @ " is placed on control procedure end.
CN 97116274 1997-09-08 1997-09-08 Logic controller and its logic control method Expired - Fee Related CN1091269C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 97116274 CN1091269C (en) 1997-09-08 1997-09-08 Logic controller and its logic control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 97116274 CN1091269C (en) 1997-09-08 1997-09-08 Logic controller and its logic control method

Publications (2)

Publication Number Publication Date
CN1181524A CN1181524A (en) 1998-05-13
CN1091269C true CN1091269C (en) 2002-09-18

Family

ID=5173735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 97116274 Expired - Fee Related CN1091269C (en) 1997-09-08 1997-09-08 Logic controller and its logic control method

Country Status (1)

Country Link
CN (1) CN1091269C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8527668B2 (en) * 2010-11-12 2013-09-03 Invensys Systems, Inc. Priority logic module
CN102809936B (en) * 2012-08-08 2015-05-06 四川爱特尔科技有限公司 Multi-switching-value combinational logic state implementation method
CN103558797A (en) * 2013-09-03 2014-02-05 国家电网公司 Off-limit protection realization method of state monitoring device
CN110315763B (en) * 2019-07-03 2022-03-15 天津市津能管业有限公司 Automatic hot-melt welding machine and welding method
CN113093622B (en) * 2021-04-08 2022-06-07 中国人民解放军火箭军士官学校 Interconnection formula simulation training emulation machine

Also Published As

Publication number Publication date
CN1181524A (en) 1998-05-13

Similar Documents

Publication Publication Date Title
CN1154946C (en) Hands-free, user-supported portable computer
CN1658106A (en) Machine management system and message server used for machine management
CN1369834A (en) Voice converter, Voice converting method, its program and medium
CN110050237A (en) Transacter, method of data capture and program
CN101505386B (en) Implementing method for transferability of household electrical appliance user operation interface
JP2005502028A (en) This application is a co-pending provisional application, 60 / 289,116 filed May 8, 2001, 60 / 291,622 filed May 18, 2001, 2002 Claiming the benefit of the filing date of 60 / 354,204 filed on the 6th of the month, all of which are hereby incorporated by reference in their entirety.
CN1484147A (en) System and method for realizing automatic on/off test of computer
CN1656599A (en) Method and apparatus for monitoring tool performance
CN1091269C (en) Logic controller and its logic control method
CN104168477A (en) Automatic TV decoding deck test system and method
CN108351742A (en) Guidance method instructs system, terminal device and information equipment
JP2019040627A (en) Machine maintenance device, machine maintenance method, machine maintenance program, and recording medium
CN1604582A (en) On-site intelligent unit supporting industrial communication protocol and operating method thereof
CN104915244B (en) The method and device of key mouse script playback
JP2004145394A (en) Device for supporting man machine interface design
CN102467372B (en) One kind measurement resource control system and measurement resource control method
US11586946B2 (en) System and method to generate training content based on audio and image feedback data
CN1107227A (en) High-voltage breaker mechanic property testing system and on-line checking method
CN104679337A (en) Touch screen channel controller
CN1143225C (en) Regulating information generator and program development system composed of regulator
CN102467369B (en) Measurement resource control system and measurement resource control method
CN1506824A (en) Diagnosing method and system for error isolation on interconnection bus device layer of external equipment
CN1758236A (en) Management system and device based on embedded operation
CN1194541C (en) PCMCIA MPEG code stream generating, analyzing and recording method and equipment
CN102467090A (en) Measurement resource control method and measurement resource control system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C19 Lapse of patent right due to non-payment of the annual fee
CF01 Termination of patent right due to non-payment of annual fee