Novel portable PLC programming device
Technical field:
The present invention relates to a kind of programmer, particularly the programming supervising device of a kind of PLC (Programmable Logic Controller).
Background technology:
Programmer is the important peripheral unit of PLC (Programmable Logic Controller is hereinafter to be referred as PLC), and current PLC programmer mainly contains two classes: a class is the computing machine with special programming software, and another kind of is special portable formula hand-hold programmer; First kind PLC programmer can be edited under off-line mode, insert, revises the PLC user program, but just can edit, insert, revise user program and the operations such as on-site supervision, debugging must connect the fixed telecommunication port of PLC equipment by the special communication cable under on-line mode the time; Equations of The Second Kind portable hand-held programmable device has the advantages that volume is little, lightweight, easy to carry, be fit to the field programming debugging, but this programmer must be connected with the fixed telecommunication port of PLC equipment by private cable and could edit, insert, revise user program and debug on-the-spot PLC equipment; And its working power is provided by the PLC special purpose interface, therefore can not use under off-line mode.On the other hand, owing to being subject to the restriction of programmer internal storage capacity, can only deposit a debugged program in the programmer during each field adjustable, and can not preserve previous user program, the New Consumers program will cover the inner existing program of programmer, when unsuccessful to amended program debug, recover original user program also need to be by other equipments of recording.This two classes programmer can be respectively and the PLC device talk, but can not Direct Communication between them.This two classes programmer all needs the special communication cable to link to each other with the special purpose interface of PLC equipment when operation, can only near operation debugged PLC main process equipment.Because the control assembly of many controlled devices all is in distance P LC main frame position far away on production line, when debugging, can not see the situation of control effect, can only show by other equipment of PLC main frame PLC input and output situation and control effect, make troubles to debugging.
Summary of the invention:
The object of the present invention is to provide a kind of Novel portable PLC programming device based on the embedded-type ARM microprocessor, this device has large memory capacity, can the CAN bus node be set, can carry out the remote monitor debugging, can independently-poweredly realize with the host computer Direct Communication and under off-line mode off line compiling and debugging user PLC program again, to overcome the weak point of above-mentioned prior art the PLC main frame by the CAN bus by the correct position in the controlled device that PLC implements to control.
For solving the problems of the technologies described above, the technical solution adopted in the present invention is: Novel portable PLC programming device comprises main control module I, memory module II, power management module III, human-computer interface module V and CAN interface module VI;
Described main control module I comprises embedded-type ARM microprocessor, real time clock circuit, reset circuit, JTAG debug i/f circuit and charge inside battery, and real time clock circuit, reset circuit, JTAG debug i/f circuit and charge inside battery are connected with the embedded-type ARM microprocessor respectively; The control core of main control module I is embedded microprocessor ARM, and its function is the regulation and control of realizing other ingredients among the main control module I; Reset circuit provides reset signal for circuit system; The JTAG debug i/f circuit provides debugging interface to link to each other with external circuits to realize the debugging to the programmer hardware and software; Real time clock circuit provides time and date information; The charge inside battery provides the 5V power supply to realize off-line working for programmer; Main control module I has for other modules provide and regulates control and the functions such as the running status of break in service, dispatch deal modules of peripheral module and driving hardware module are processed, processed to data, programmer makes up embedded real-time operating system in main control module I, carry out multiple task management and communication management, realize the function of editor, processing PLC user program and monitoring PLC running status.
Described memory module II comprises Nor FLASH storer, Nand FLASH storer and SDRAM storer; Nor FLASH storer, Nand FLASH storer are connected with the SDRAM storer directly and are connected with the embedded-type ARM microprocessor of main control module I, realize that the ARM microprocessor is to the operation control of storer, the embedded software system program of Nor FLASH memory stores both program device, Nand FLASH storer is deposited PLC user program and data, and the SDRAM storer moves for system and the communication data processing provides the space.
Described power management module III realizes that power supply is selected and the main modular of power management, and it has common structure and two kinds of versions of simplified structure:
The common structure of described power management module III comprises: external power source interface, voltage conversion circuit and USB charge controller, USB charge controller are connected with the external power source interface by voltage conversion circuit and are connected with the embedded-type ARM microprocessor of main control module I; Voltage conversion circuit also is connected with the charge inside battery of main control module I, and described power management module III provides the external power source interface, DC voltage changed or obtained power supply to inner rechargeable battery charging or directly change rear for system from the USB interface of host computer.
The simplified structure of described power management module III comprises: external power source interface and voltage conversion circuit, described external power source interface is connected with the embedded-type ARM microprocessor of main control module I by voltage conversion circuit, described voltage conversion circuit also is connected with the charge inside battery of main control module I, described external power source interface provides external dc power input, described voltage conversion circuit with DC voltage change, to inner rechargeable battery charging or directly after the conversion for programmer.
Described human-computer interface module V provides interactive interface for user and programmer.
Described CAN interface module VI provides communication interface with the exchanges data of remote PLC main frame when this programmer on-line working, thereby connect any CAN node of industry spot with access CAN fieldbus, realize in monitoring on-the-spot program debug and operation to remote PLC main frame.
Described main control module I is connected with memory module II, power management module III, human-computer interface module V and CAN interface module VI respectively, power management module III is connected with the PLC main frame, and CAN interface module VI is connected with host computer with the PLC main frame by the CAN bus.
Its further technical scheme is:
This programmer also comprises a communication interface module as the programmer expansion interface, and this communication interface module also has common structure and two kinds of versions of simplified structure:
The first, the communication interface module IV of described common structure comprises universal asynchronous serial interface UART and USB interface, described universal asynchronous serial interface UART is connected respectively the embedded-type ARM microprocessor and is connected with host computer, PLC main frame and main control module I, USB interface is connected respectively the embedded-type ARM microprocessor and is connected with host computer, power management module III and main control module I, realize the data communication of main control module I and PLC main frame, and main control module I is direct and the data communication of host computer.
The second, the communication interface module IVa of described simplified structure only has universal asynchronous serial interface UART interface, described universal asynchronous serial interface UART is connected respectively the embedded-type ARM microprocessor to be connected with host computer, PLC main frame and main control module I, realize the data communication of main control module I and PLC main frame, and main control module I is direct and the data communication of host computer.
Because adopt said structure, the present invention's Novel portable PLC programming device has following beneficial effect:
One, can realize remote-controlled operation to the PLC main frame:
The present invention adopts take the fieldbus pattern of CAN fieldbus as the basis, the user can select suitable position that the CAN bus node is set at controlled device, programmer connects the CAN bus node by CAN interface module VI can access the CAN fieldbus easily, I processes communication data by main control module, realizes that the present invention's portable PLC programmer is in the on-the-spot operation to remote PLC main frame of monitoring.
Two, can realize the off-line working mode:
Power management module III in the programmer of the present invention is selected for the user provides three kinds of electric source modes: the first electric source modes is to obtain DC voltage by the external power source interface from the PLC main frame; In the second electric source modes, programmer obtains working dc power by the USB transceiver by the USB interface of host computer, passes through USB charge controller and voltage conversion circuit for system under this pattern; The third electric source modes then is to provide power supply by programmer 5V charge inside battery, and programmer relies on inner 5V power supply to realize off-line working; Because the present invention can adopt the multiple power sources pattern, can use front two kinds of electric source modes inner rechargeable battery is charged.
Three. function is strong, be convenient for carrying:
The embedded-type ARM microprocessor that adopts among the present invention, making up embedded real-time operating system processes the multitask Real-Time Scheduling, the several functions such as program compilation, file processing and monitoring, debugging not only are provided, and have fast operation, little, lightweight characteristics of system power dissipation, therefore the handled easily person carries, and is fit to the debugging of industry spot.
Four. communication interface is abundant:
The present invention has CAN bus interface, asynchronous serial communication interface UART and USB interface; The CAN bus interface provides communication interface with the exchanges data of remote PLC main frame when the programmer on-line working, thereby connect any CAN node of industry spot with access CAN fieldbus, realize in monitoring on-the-spot program debug and operation to remote PLC main frame; Be connected with UART asynchronous serial communication interface by the CAN bus and directly be connected with host computer, use host computer compiles user program to download in the SDRAM storer of the present invention, the user is saved in the user program among the SDRAM in the FLASH storer by the input instruction; The user also can directly be connected to carry out associative operation with the PLC main frame by the universal asynchronous serial communication interface UART of programmer; The present invention connects host computer with transmission and the storage of realization mass data by USB interface, and obtains power supply for programmer or the charging of charge inside battery from the USB interface of host computer.Various communication interfaces of the present invention so that the user can communicate with host computer and other equipment easily.
Five, system's cost performance is high:
The present invention adopts embedded-type ARM microprocessor and CAN bus module VI, the major function that had both had existing common hand-held PLC programmable device, also support the working methods such as online and off line, and the access of the CAN bus node by industry spot CAN bus realizes remote PLC main frame being operated control is on-the-spot, can also directly communicate by letter with host computer, improve the usable range of the present invention's Novel portable PLC programming device; Owing to can easily software systems of the present invention, particularly process of compilation software be debugged and upgrade at interior application function software by jtag interface, optimized the performance of programmer, the upgrading expansion of realization software systems under original hardware circuit condition, therefore, have higher cost performance and extendability.
Description of drawings:
The system construction drawing of the Novel portable PLC programming device of Fig. 1: embodiment one;
The hardware of the Novel portable PLC programming device of Fig. 2: embodiment one connects block diagram;
The system construction drawing of the Novel portable PLC programming device of the simplification of Fig. 3: embodiment two;
The hardware of the Novel portable PLC programming device of the simplification of Fig. 4: embodiment two connects block diagram;
The system construction drawing of the Novel portable PLC programming device of the simplification of Fig. 5: embodiment three;
The hardware of the Novel portable PLC programming device of the simplification of Fig. 6: embodiment three connects block diagram;
Fig. 7: system's operational flow diagram of the present invention's Novel portable PLC programming device.
Among the figure:
The I-main control module, II-memory module, III-power management module, the power management module of IIIa-simplified structure, IV-communication interface module, the communication interface module of IVa-simplified structure, V-human-computer interface module, VI-CAN interface module;
1-embedded-type ARM microprocessor, 2-real time clock circuit, 3-reset circuit, the 4-JTAG debug i/f circuit, 5-NorFLASH storer, 6-Nand FLASH storer, the 7-SDRAM storer, 8-external power source interface, 9-voltage conversion circuit, the 10-USB charge controller, 11-CAN controller, 12-CAN transceiver, the 13-LCD liquid-crystal display section, the 131-LCD LCDs, 132-LCD controller, 14-keyboard portion, the 141-keyboard controller, the 142-matrix keyboard, 15-universal asynchronous serial interface UART, 151-serial communication control, the 152-RS-232 level translator, the 153-data collector, 16-USB interface, 161-USB device controller, the 162-USB transceiver, the 17-host computer, 18-PLC main frame, 19-charge inside battery.
The abbreviation meaning is as follows in the literary composition:
PLC-Programmable Logical Controller, programmable logic controller (PLC) is called for short Programmable Logic Controller;
CAN-Controller Area Network, controller local area network, a kind of industrial field bus;
ARM-Advanced RISC Machines, a kind of microprocessor;
Nor FLASH-nonvolatile flash memory technology refers to adopt the flash memories of Nor FLASH technology here;
Nand FLASH-nonvolatile flash memory technology refers to adopt the flash memories of Nand FLASH technology here;
SDRAM-Synchronous Dynamic Random Access Memory, Synchronous Dynamic Random Access Memory;
UART-Universal Asynchronous Receiver/Transmitter, general asynchronous receiving-transmitting transmitter;
USB-Universal Serial Bus, USB (universal serial bus);
JTAG-Joint Test Action Group, a kind of international standard test protocol;
LCD-Liquid Crystal Display, liquid crystal display;
SPI-Serial Peripheral Interface, synchronous serial peripheral bus interface.
Embodiment:
Embodiment one:
A kind of Novel portable PLC programming device, as shown in Figure 1, this programmer comprises main control module I, memory module II, power management module III, communication interface module IV, human-computer interface module V and CAN interface module VI; Main control module I have for other modules of system steering order and data are provided process, process peripheral module break in service, dispatch deal modules running status and drive the function such as hardware module, programmer makes up embedded real-time operating system in main control module I, carry out multiple task management and communication management, realize the function of editor, processing PLC user program and monitoring PLC running status; As shown in Figure 2, main control module I comprises embedded-type ARM microprocessor 1, real time clock circuit 2, reset circuit 3, JTAG debug i/f circuit 4 and charge inside battery 19.Real time clock circuit 2, reset circuit 3, JTAG debug i/f circuit 4 and charge inside battery 19 are connected with embedded-type ARM microprocessor 1 respectively; Embedded-type ARM microprocessor 1 is the control core of main control module I, realizes the regulation and control to other ingredients among the main control module I; Reset circuit 3 provides reset signal for embedded-type ARM microprocessor 1; JTAG debug i/f circuit 4 provides debugging interface to link to each other with external circuits to realize the debugging to the programmer hardware and software; Real time clock circuit 3 provides the information such as time and date; Charge inside battery 19 provides the 5V power supply for programmer, and programmer relies on inner 5V power supply to realize off-line working.
Memory module II processes for storage embedded software system, user program and data and for data the dynamic operation space is provided; Memory module II comprises Nor FLASH storer 5, Nand FLASH storer 6 and SDRAM storer 7, described Nor FLASH storer 5, Nand FLASH storer 6 are connected with the SDRAM storer and directly are connected with the embedded-type ARM microprocessor 1 of main control module I respectively, and the operation of 1 couple of memory module II of realization ARM microprocessor is controlled; Wherein, the embedded software system program of Nor FLASH storer 5 storage programmers, Nand FLASH storer 6 is deposited PLC user program and data, and SDRAM storer 7 moves for system and the communication data processing provides the space.PLC user program storage space can be stored a plurality of PLC user programs simultaneously, can store in use program and other programs and the data of current program of editing, the modulated examination of storage; Programmer and CAN bus or be passed to first in the SDRAM storer 7 with the data of host computer 17 communications, the user is written to the data in the SDRAM storer 7 in the Nand FLASH storer 6 by keyboard portion 14 operations, and SDRAM storer 7 moves for system and the communication data processing provides running space.
Power management module III is the main modular of the selection of realization power supply and power management, and its effect provides the external power source interface, DC voltage is changed, obtained power supply to inner rechargeable battery 19 chargings or directly change rear for programmer from the USB interface of host computer 17; Power management module III comprises external power source interface 8, voltage conversion circuit 9 and USB charge controller 10, and USB charge controller 10 is connected with the external power source interface respectively and is connected with the embedded-type ARM microprocessor 1 of main control module I by voltage conversion circuit 9; External power source interface 8 can make this programmer by be connected the function that realizes that power supply obtains with PLC main frame 18, and this function is with special portable formula hand-hold programmer is the same from the function that the PLC main frame obtains power supply by special purpose interface usually; Can obtain DC power supply voltage conversion circuit 9 from the USB interface of host computer 17 by USB charge controller 10 and use, also can the charge inside battery 19 that this programmer carries be charged; Voltage conversion circuit 9 will be converted to by the direct supply that external power source interface 8 obtains different voltage for embedded-type ARM microprocessor 1 and each external connection module; Pass through voltage conversion circuit 9 for system from the DC voltage of external power source interface 8; Pass through USB charge controller 10, voltage conversion circuit 9 for system from the DC voltage of USB transceiver; Voltage conversion circuit 9 has two-way output, and one tunnel output is to inner rechargeable battery 19 chargings, and another road output is as system power supply.Because this programmer inside provides the charge inside battery 19 of 5V, both can provide power supply for programmer when off-line working, also can to inner rechargeable battery 19 chargings when using external power source, improve the applicability of programmer.
Communication interface module IV is as the programmer expansion interface, and its effect is the data communication of realization and main control module I; This communication interface module IV comprises universal asynchronous serial interface UART15 and usb 16, described universal asynchronous serial interface UART15 comprises serial communication control 151, RS-232 level translator 152 and data collector 153, data collector 153 is connected with serial communication control 151 by RS-232 level translator 152, serial communication control 151 is connected with control data transmission with the embedded-type ARM microprocessor 1 of main control module I, RS-232 level translator 152 connects serial communication control 151 to be responsible for level conversion, and data collector 153 is responsible for accepting and sending the transmission of data; Usb 16 comprises USB device controller 161 and USB transceiver 162, USB device controller 161 and USB transceiver 162 interconnect, USB device controller 161 is connected with control data transmission with the embedded-type ARM microprocessor 1 of main control module I, USB transceiver 162 is responsible for transceiving data, and be connected with the USB charge controller 10 of power management module III, universal asynchronous serial interface UART15 is connected with usb 1 also by be connected to realize the data interaction with this host computer 17 with host computer 17, main control module I also can pass through universal asynchronous serial interface UART15 and 18 communications of PLC main frame by Asynchronous Serial Interface UART15 and host computer 17 Direct Communications; Main control module I can also use usb 16 and be connected with the USB interface of host computer 17 and carry out communication.
Human-computer interface module V provides interactive interface for user and programmer, human-computer interface module V comprises LCD liquid-crystal display section 13 and keyboard portion 14, LCD liquid-crystal display section 13 comprises LCD LCDs 131 and lcd controller 132, LCD LCDs 131 is connected with lcd controller 132,132 of lcd controllers link to each other to provide the LCD control signal by the spi bus interface with embedded-type ARM microprocessor 1, support the nearly display mode of 24 data lines; Keyboard portion 14 comprises keyboard controller 141 and matrix keyboard 142, matrix keyboard 142 is connected with keyboard controller 141, keyboard controller 141 links to each other with embedded-type ARM microprocessor 1, for matrix keyboard 142 provides control signal, comprising the system interrupt signals of keyboard portion 14.This programmer provides unified data and control interface, supports TFT, stn liquid crystal display screen under the several data pattern, can show the character display format of 16 characters * 8 row, and the user also can select monochrome or color LCD screen as required.Matrix keyboard 142 is the different pieces such as system key, function key, multiplexing key according to the different demarcation of function; System key is used for systemic-function and pattern are set, and mainly contains electric source modes, operational mode, interface modes, document management mode; The selection of various subsidiary functions included enter key, function key, space key, shift key etc. when function key was used for system's operation; When the user enters the program editing interface, carry out function key and can make things convenient for the user directly to switch in instruction and soft element, carry out different power functions; Multiplexing key represents two kinds of symbols: letter character and numeric character, and system default is got the input of the first symbol when pressing this key assignments, adds the input that corresponding key can obtain the second symbol by the shift key; By matrix keyboard 142, the user can realize the input to function command and soft element symbol.
CAN interface module VI provides communication interface with the exchanges data of remote PLC main frame 18 when this programmer on-line working, thereby connect any CAN node of industry spot with access CAN fieldbus, realize in monitoring on-the-spot program debug and operation to remote PLC main frame 18; CAN interface module VI connects node access fieldbus on the CAN bus, with PLC main frame 18 swap datas on the CAN bus; CAN interface module VI comprises CAN controller 11 and CAN transceiver 12, CAN controller 11 directly links to each other with the embedded-type ARM microprocessor 1 of main control module I by the spi bus interface and realizes data transmission, provides to embedded-type ARM microprocessor 1 and interrupt and status information, and the task that CAN controller 11 is processed comprises interface management, sends and receives buffering, checks and accepts filtering and position processing etc.; CAN controller 11 is by connecting CAN transceiver 12 to explain the addressing of cpu command and control CAN register, this programmer is connected with the PLC main frame with host computer 17 respectively and is connected by CAN interface module VI, and realization is downloaded at a distance, monitored the PLC user program and the several functions such as debugging.
Below, by reference to the accompanying drawings 1, the Novel portable PLC programming device of Fig. 2 and Fig. 7 and embodiment one describes the course of work of the portable PLC programmer of the present invention:
After powering on, this programmer then enters the self check state: if the fail self-test system passes through buzzer warning; If self check success, system's program code read pack into embedded real-time operating system and the operation, enter start picture this moment, by the LCD liquid-crystal display section 13 display system parameter configuration prompting of human-computer interface module V, the user can select electric source modes and interface modes; Then enter the programmer operational mode and select, can select off line or online working method: when entering offline mode, can pass through the function choosing-items such as the management of matrix keyboard 142 select Files, parameter editor's setting, program compilation debugging; When entering on-line mode, the user then can the select File management, the functions such as debugging, data communication and program editing of remote monitoring, user program.
The driver that drives hardware module mainly comprises LCD liquid crystal display 131 display drivers of man-machine interface part V and the driver of matrix keyboard 142, the driver of CAN bus, the driver of universal asynchronous serial interface UART15 and usb 16; Also comprise among the memory module II to Nor FLASH storer 5 driver of Nand FLASH storer 6 and SDRAM storer 7; Embedded OS adopts embedded real-time operating system; The programmable device application program comprises the coding﹠decoding to input PLC instruction, and the communication of CAN bus and to the watchdog routine of PLC state.
Embodiment one is one of preferred forms of Novel portable PLC programming device of the present invention.
Embodiment two:
A kind of Novel portable PLC programming device of simplified structure.
Embodiment two is a kind of simplification mapped structures of the embodiment of the invention one, such as Fig. 3~shown in Figure 4, do not comprise USB charge controller 10 in the power management module of the Novel portable PLC programming device of this simplified structure, do not comprise usb 16 in the described communication interface module, that is: this programmer comprises the communication interface module IVa of power management module IIIa, human-computer interface module V, CAN interface module VI and the simplified structure of main control module I, memory module II, simplified structure;
The power management module IIIa of described simplified structure comprises external power source interface 8 and voltage conversion circuit 9, external power source interface 8 is connected with the embedded-type ARM microprocessor 1 of main control module I by voltage conversion circuit 9, described voltage conversion circuit 9 also is connected with the charge inside battery 19 of main control module I, described external power source interface 8 provides external dc power input, described voltage conversion circuit 9 with DC voltage change, to inner rechargeable battery 19 chargings or directly after the conversion for programmer;
The communication interface module IVa of described simplified structure comprises universal asynchronous serial interface UART15, universal asynchronous serial interface UART15 comprises serial communication control 151, RS-232 level translator 152 and data collector 153, described data collector 153 is connected with serial communication control 151 by RS-232 level translator 152, and described serial communication control 151 is connected with the embedded-type ARM microprocessor 1 of main control module I; Realize the data communication of main control module I and PLC main frame 18, and main control module I is direct and the data communication of host computer 17;
All the other each module connected modes and function, the course of work and embodiment one are similar, repeat no more herein; The difference of the present embodiment and embodiment one is: under this simplified structure, programmer neither can connect host computer 17 to realize transmission and the storage of mass data by usb 16, can not obtain power supply for programmer or 19 chargings of charge inside battery from the USB interface of host computer 17, compare with embodiment one, effect is slightly poor.
Embodiment three:
The Novel portable PLC programming device that does not have communication interface module IV.
Embodiment three is another simplification mapped structure of the embodiment of the invention one, such as Fig. 5-shown in Figure 6, this Novel portable PLC programming device includes only main control module I, memory module II, human-computer interface module V, CAN interface module VI and external power source interface 8 is only arranged and the power management module IIIa of the simplified structure of voltage conversion circuit 9 and do not have communication interface module IV, under this kind version, described main control module I respectively with memory module II, power management module IIIa, human-computer interface module V is connected with CAN interface module VI, described power management module IIIa is connected with PLC main frame 18, and described CAN interface module VI is connected with host computer by CAN bus and PLC main frame 18 and is connected; All the other each module connected modes and function, the course of work and embodiment one are similar, repeat no more herein; Be with the difference of embodiment one: when the Novel portable PLC programming device of this kind simplified structure was worked, the main control module I of programmer was merely able to by CAN interface module VI and host computer 17 and 18 communications of PLC main frame; The power module IIIa of simplified structure can only charge by external direct current power supply interface 8; Compare with embodiment one, effect is slightly poor.
Above three kinds of embodiments can both realize the offline operation of programmer, realize the Direct Communication with host computer 17, also can connect any CAN node of industry spot with access CAN fieldbus, realize in user program debugging, operation and the monitoring of industry spot to remote PLC main frame 18.
As a kind of variation of the embodiment of the invention, other without prejudice to the conversion of the object of the invention also within protection scope of the present invention.