Summary of the invention
In view of this, the present invention provides a kind of meter register method based on intelligent garden, communication processor and system, to solve intelligent garden table and the transmission problem of the meter reading data between main website of checking meter, realizes that meter reading data is in table meter and the transmission between the main website of checking meter.
For realizing above-mentioned purpose, the present invention provides following technical scheme:
A kind of meter register method based on intelligent garden, said method is based on programmable logic controller (PLC) PLC, and said method comprises:
Steps A. confirm the table meter type of said table meter according to the table address of the table meter of want copy reading, draw the data frame number of said table meter;
Step B. sets gradually the frame address of said each Frame and is the address of checking meter, and each Frame of copy reading obtains and the corresponding meter reading data of said table meter successively, and the mode of said copy reading is: the Frame of a cycle copy reading of checking meter;
Step C. confirms that next piece wants the table address of the table meter of copy reading, and repeating said steps A and step B finish until the descending Frame copy readings of going up all table meters of carry of said PLC.
Preferably, among the said step B frame address of said each Frame set gradually and be the address of checking meter, each Frame of copy reading is specially successively:
Check meter the cycle current; With the frame address of Frame of first order in the current not copy reading Frame as the address of checking meter; And carry out the process of checking meter; The said process of checking meter comprises: according to this address copy reading Frame of checking meter, the Frame that second order in the said current not copy reading Frame is set is next corresponding address of checking meter of cycle of checking meter, the Frame copy reading in cycle so that next is checked meter;
Repeat the said process of checking meter, finish until the whole copy readings of said each Frame.
Preferably, said method also comprises:
The buffer memory meter reading data.
Preferably, said method also comprises:
The main website that checks meter reads the meter reading data of said buffer memory through preposition communication subsystem.
Preferably, said method also comprises:
Judge whether the main website that checks meter has issued control command, if, send and forbid meter reading instruction, carry out and the corresponding control action of said control command, be finished until said control action, send the permission meter reading instruction.
Preferably, said method also comprises:
After said control action is finished, when recovering said control action and taking place, the corresponding address of checking meter of cycle of checking meter of living in.
The present invention also provides a kind of communication processor based on intelligent garden, and said communication processor is based on programmable logic controller (PLC) PLC, and said communication processor comprises:
Meter-reading module is used for confirming according to the table address of the table meter of want copy reading the table meter type of said table meter, draws the data frame number of said table meter; The frame address of said each Frame set gradually be the address of checking meter; Each Frame of copy reading obtains and the corresponding meter reading data of said table meter successively, and the mode of said copy reading is: the Frame of a cycle copy reading of checking meter; Confirm that next piece wants the table address of the table meter of copy reading, so that want the table meter of copy reading to carry out the operation of checking meter to said next piece;
Control module is used for judging whether the main website that checks meter has issued control command, if; Send to meter-reading module and to forbid meter reading instruction; Carry out and the corresponding control action of said control command, be finished, send the permission meter reading instruction to meter-reading module until said control action.
Preferably, said meter-reading module comprises:
The unit is confirmed in the address of checking meter; Be used for confirming the table meter type of said table meter according to the table address of the table meter of want copy reading; Draw the data frame number of said table meter; And in the current cycle of checking meter, as the address of checking meter, the Frame of second order is set to the address of checking meter of next cycle correspondence of checking meter in the said current not copy reading Frame with the frame address of Frame of first order in the current not copy reading Frame;
The performance element of checking meter is used for according to the current corresponding address of checking meter of cycle of checking meter, copy reading Frame;
Table meter selected cell is used for confirming that next piece wants the table address of the table meter of copy reading, confirms that said next piece wants the pairing address of checking meter of table meter of copy reading so that the unit is confirmed in the said address of checking meter.
Preferably, said communication processor also comprises:
Data cache module is used for the buffer memory meter reading data.
The present invention also provides a kind of communication system based on intelligent garden, and said communication system comprises: table meter, communication processor, the communication front subsystem and the main website that checks meter;
Said communication processor is specially above-mentioned described communication processor;
Said communication front subsystem; Be used to gather the meter reading data of said communication processor buffer memory; Said meter reading data is transferred to the said main website that checks meter; And receive the control command that the said main website that checks meter issues, send said control command to said communication processor, so that said communication processor is carried out the control corresponding action.
The meter register method based on intelligent garden that the embodiment of the invention provided based on PLC, is confirmed the table meter type of said table meter according to the table address of the table meter of want copy reading; Draw the data frame number of said table meter, the frame address of each Frame of table meter is set gradually be the address of checking meter, thus each Frame of copy reading; Obtain the meter reading data showing to count, and the mode of copy reading is: the Frame of a cycle copy reading of checking meter, confirm the table meter table address of the next copy reading of wanting simultaneously; So that next piece table meter is carried out copy reading; And then realize descending meter reading data collection of going up all table meters of carry to PLC, and utilizing the characteristic of PLC simultaneously, fast and stable ground is with the descending meter reading data of gathering of PLC; Be uploaded to the main website that checks meter, realize that meter reading data is in table meter and the transmission between the main website of checking meter.
Embodiment
The embodiment of the invention aims to provide a kind of meter register method based on intelligent garden, communication processor and communication system, solving in this special applications scene of intelligent garden, and the transmission problem of table meter and the meter reading data between main website of checking meter.
Need explanatorily be that meter register method that the embodiment of the invention provided and communication processor are all based on PLC (Programmable Logic Conroller, codified logic controller) hardware platform; PLC adopts one type of programmable memory, is used for its internally stored program, the actuating logic computing; Sequential control; Regularly, user oriented instructions such as counting and arithmetical operation, and can control various types of machineries or production run through numeral or analog I/O; Ethernet hardware interface that the up employing of PLC carries and up protocol analysis module; Can with any support modbus TCP (Transmission Control Protocol; Transmission control protocol) main website that checks meter of agreement communicates; Descendingly can insert maximum three RS485 modules, carry out issuing of data acquisition and control command through modbus RTU (Remote Terminal Unit, RTU) agreement according to actual conditions.
The inventor can be applicable to intelligent garden well through discovering PLC, realizes intelligent garden table meter and the transmission of the meter reading data between main website of checking meter, even the transmission of control command, is embodied in:
PLC has the control input and output of multichannel, meets the present situation that intelligent garden table meter progressively increases;
PLC carries out data transmission through EtherChannel, meets intelligent garden table counting according to requirement extensive and quick transmission; Mostly the industrial field bus communication protocol of intelligence garden is the modbus agreement, and this point matches with the communication protocol of PLC.
To combine the accompanying drawing in the embodiment of the invention below; To in the embodiment of the invention being the basis with PLC; Realize intelligent garden table meter and the transmission of the meter reading data between main website of checking meter, that the technical scheme of transmission of control command is carried out is clear, intactly describe, obviously; Described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Fig. 1 is the process flow diagram of a kind of meter register method based on intelligent garden of the present invention.With reference to Fig. 1, this method flow can comprise:
Step S100, initialization operation;
Said initialization operation can comprise:
1) time span that this operates the cycle of checking meter is set;
Specifically can realize through the timer initial value that PLC is set.
2) reference position that this operates the copy reading table meter of wanting is set;
First cycle of checking meter specifically can be set wants the table address of the table meter of copy reading, and the frame address of pairing first Frame of this table address is the address of checking meter in first cycle of checking meter; This address of checking meter is the reference position of this operation copy reading table meter of wanting;
Also the final position of copy reading table meter of wanting or the table meter number of the copy reading of wanting can be set, with the order of checking meter of clear and definite this operation.
3) setting of other correlation parameters of checking meter.
Step S200, confirm the table meter type of said table meter, draw the data frame number of said table meter according to the table address of the table meter of want copy reading;
Wherein, Confirm the table meter type of said table meter according to the table address of the table meter of want copy reading; The data frame number that draws said table meter can be specially: through the table meter table address that obtains; Draw this table address and the corresponding relation of showing the meter type, confirm to be somebody's turn to do table meter institute data carried by data frame number through table meter type; Table address and the corresponding relation of showing the meter type, the corresponding relation that reaches table meter type and data frame number can be stored among the PLC in advance, transfers according to actual needs.
Step S300, the frame address of said each Frame set gradually be the address of checking meter, each Frame of copy reading obtains and the corresponding meter reading data of said table meter successively, and the mode of said copy reading is: the Frame of a cycle copy reading of checking meter;
When one of the embodiment of the invention Frame of a cycle copy reading of checking meter, the timer of PLC arrived in each cycle of checking meter, all can trigger once copy reading to the Frame of the descending institute of PLC carry table meter.In each checks meter the cycle; PLC only handles the copy reading of a Frame in the table meter; The copy reading environment of next Frame is set simultaneously; Specifically can be next corresponding address of checking meter of cycle of checking meter through the frame address that next Frame is set, when arriving with the cycle of checking meter at the next one, realization is to the copy reading of said next Frame; Wherein, the acquisition methods of frame address can be with reference to prior art, and the present invention repeats no more.
With reference to Fig. 2, Fig. 2 shows the refinement flow process of step 300.Step S300 can comprise:
Step S310, check meter the cycle current; With the frame address of Frame of first order in the current not copy reading Frame as the address of checking meter; And carry out the process of checking meter; The said process of checking meter comprises: according to this address copy reading Frame of checking meter, the Frame that second order in the said current not copy reading Frame is set is next corresponding address of checking meter of cycle of checking meter;
Step S320, when the cycle of checking meter arrives repeating step S310, each Frame copy reading finishes in the table meter, obtains and the corresponding meter reading data of said table meter;
Wherein, the meter reading data that said table meter is corresponding comprises: each Frame and its are by the corresponding relation of the data of copy reading.
Step S400, confirm that next piece wants the table address of the table meter of copy reading, repeating step S200 and step S300 finish until the descending Frame copy readings of going up all table meters of carry of said PLC.
Wherein, can confirm that next piece wants the table meter of copy reading, according to step S200 and the shown flow process of checking meter of step S300, to said next piece table meter execution operation of checking meter according to the set order of checking meter of step S100 initialization operation;
According to the above-mentioned flow process of checking meter, be last Frame that the table meter of the final position that initialization operation is set is carried until the Frame of last copy reading.
The meter register method based on intelligent garden that the embodiment of the invention provided based on PLC, is confirmed the table meter type of said table meter according to the table address of the table meter of want copy reading; Draw the data frame number of said table meter, the frame address of each Frame of table meter is set gradually be the address of checking meter, thus each Frame of copy reading; Obtain the meter reading data showing to count, and the mode of copy reading is: the Frame of a cycle copy reading of checking meter, confirm the table meter table address of the next copy reading of wanting simultaneously; So that next piece table meter is carried out copy reading; And then realize descending meter reading data collection of going up all table meters of carry to PLC, and utilizing the characteristic of PLC simultaneously, fast and stable ground is with the descending meter reading data of gathering of PLC; Be uploaded to the main website that checks meter, realize that meter reading data is in table meter and the transmission between the main website of checking meter.
Fig. 3 is another process flow diagram of a kind of meter register method based on intelligent garden of the present invention.In conjunction with Fig. 1 and method shown in Figure 3, method shown in Figure 3 also comprises:
Step S500, buffer memory meter reading data;
Wherein, can be provided with a Frame copy reading finish promptly carry out buffer memory, table meter copy reading finish carry out buffer memory or all the copy reading of table meter finish and carry out buffer memory.
Step S600, the main website that checks meter read the meter reading data of said buffer memory through preposition communication subsystem;
The communicating by letter of main website and preposition communication subsystem of checking meter can be repeated no more with reference to prior art here.
Fig. 4 is the another process flow diagram of a kind of meter register method based on intelligent garden of the present invention.In conjunction with Fig. 3 and shown in Figure 4, method shown in Figure 4 also comprises step between step S100 and step S200:
Step S10, judge whether the main website that checks meter has issued control command, if, send and forbid meter reading instruction, carry out and the corresponding control action of said control command, be finished until said control action, send the permission meter reading instruction;
Behind step S100 initialization operation, the control operation flow process shown in can first execution in step S10 when not having control operation or control operation to be finished, then gets into step S200, carries out the operation of checking meter;
The content of control command can comprise: a, whether control command is arranged; B, the corresponding control action of control command; Control action can be tripping operation or combined floodgate etc.; The execution object of c, control action; Carry out object and can be tripping operation or the particular location that closes a floodgate;
Preferably, step S10 can carry out one time in each cycle of checking meter, if in the implementation of operation of checking meter; The judged result of step S10 is then sent and is forbidden meter reading instruction for being, to end to check meter operation; And after control action is finished; Recover the scene before control action takes place, send the permission meter reading instruction simultaneously, so that the operation of checking meter continues to carry out;
Recover before control action takes place the scene specifically can for: when recovering said control action and taking place, the corresponding address of checking meter of cycle of checking meter of living in.
Embodiment illustrated in fig. 1 with respect to the present invention, embodiment illustrated in fig. 4ly also realized table meter and the control command transmission of checking meter between main website, further realized table count and check meter digital communication between the main website.
Fig. 5 is the structured flowchart of a kind of communication processor based on intelligent garden of the present invention.Communication processor of the present invention is based on PLC, and with reference to Fig. 5, said communication processor comprises:
Meter-reading module 100 is used for confirming according to the table address of the table meter of want copy reading the table meter type of said table meter, draws the data frame number of said table meter; The frame address of said each Frame set gradually be the address of checking meter; Each Frame of copy reading obtains and the corresponding meter reading data of said table meter successively, and the mode of said copy reading is: the Frame of a cycle copy reading of checking meter; Confirm that next piece wants the table address of the table meter of copy reading, so that want the table meter of copy reading to carry out the operation of checking meter to said next piece;
Fig. 6 illustrates the structured flowchart of meter-reading module 100, and meter-reading module 100 can comprise:
Unit 110 is confirmed in the address of checking meter; Be used for confirming the table meter type of said table meter according to the table address of the table meter of want copy reading; Draw the data frame number of said table meter; And in the current cycle of checking meter, as the address of checking meter, the Frame of second order is set to the address of checking meter of next cycle correspondence of checking meter in the said current not copy reading Frame with the frame address of Frame of first order in the current not copy reading Frame;
The performance element 120 of checking meter is used for according to the address of checking meter in the said current cycle of checking meter, the Frame that copy reading is corresponding;
Table meter selected cell 130 is used for confirming that next piece wants the table address of the table meter of copy reading, confirms that said next piece wants the pairing address of checking meter of table meter of copy reading so that the unit is confirmed in the said address of checking meter.
Control module 200 is used for judging whether the main website that checks meter has issued control command, if; Send to meter-reading module and to forbid meter reading instruction; Carry out and the corresponding control action of said control command, be finished, send the permission meter reading instruction to meter-reading module until said control command;
With reference to Fig. 7, control module 200 can comprise:
Control judging unit 210 is used for judging whether the main website that checks meter has issued control command, if, send to meter-reading module and to forbid meter reading instruction, if not, send the permission meter reading instruction to meter-reading module;
Control execution unit 220, the judged result that is used at said judging unit is under the situation that is, carries out and the corresponding control action of said control command.
Data cache module 300 is used for the said meter reading data of buffer memory.
Be directed to the situation of communication processor of the present invention based on PLC, the control execution unit 220 of meter-reading module 100 and control module 200 can be arranged on the descending of PLC, with the execution that realizes respectively checking meter with control action.The control judging unit 210 and the data cache module 300 of control module 200 can be arranged on the up of PLC, with the reception of 210 pairs of control commands of realization judging unit and uploading of the meter reading data behind the buffer memory.
Fig. 8 is the structured flowchart of a kind of communication system based on intelligent garden of the present invention.With reference to Fig. 8, this communication system comprises: at least one table meter 01, communication processor 02, the communication front subsystem 03 and the main website 04 that checks meter; Wherein the hardware platform of communication processor 02 is based on PLC.
Communication processor 02 is specially above-mentioned described communication processor, and communication processor 02 descending and at least one table meter 01 link to each other, uply links to each other with the main website 04 that checks meter through the front subsystem 03 of communicating by letter.
Communication front subsystem 03; The meter reading data that is used for collection communication supervisor 02 buffer memory; Said meter reading data is transferred to the main website 04 that checks meter; And receive the control command that the main website 04 that checks meter issues, send said control command to said communication processor 02, so that communication processor 02 is carried out the control corresponding action;
Wherein, communication front subsystem 03 can comprise: the front end processor server.The concrete structure of communication front subsystem 03 is formed and can be repeated no more with reference to prior art here.
Each embodiment adopts the mode of going forward one by one to describe in this instructions, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For the disclosed device of embodiment, because it is corresponding with the embodiment disclosed method, so description is fairly simple, relevant part is partly explained referring to method and is got final product.
The professional can also further recognize; The unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein; Can realize with electronic hardware, computer software or the combination of the two; For the interchangeability of hardware and software clearly is described, the composition and the step of each example described prevailingly according to function in above-mentioned explanation.These functions still are that software mode is carried out with hardware actually, depend on the application-specific and the design constraint of technical scheme.The professional and technical personnel can use distinct methods to realize described function to each certain applications, but this realization should not thought and exceeds scope of the present invention.
The method of describing in conjunction with embodiment disclosed herein or the step of algorithm can be directly with the software modules of hardware, processor execution, and perhaps the combination of the two is implemented.Software module can place the storage medium of any other form known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or the technical field.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments among this paper.Therefore, the present invention will can not be restricted to these embodiment shown in this paper, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.