A kind of node address method to set up being applied in intelligent cabinet bus control system
Technical field
It is specifically a kind of to be applied in intelligent cabinet bus control system the present invention relates to a kind of node address method to set up
Node address method to set up.
Background technology
The more than ten years have been developed in intelligent cabinet industry, and traditional intelligent cabinet product mainly has electronic access tank, intelligence letter
Newspaper box, mobile phone cabinet, with material cabinet etc., recently as the fast development of ecommerce, intelligent cabinet has derived multiple sub-industries, bag
Include intelligent express delivery cabinet, the fresh cabinet of intelligence, intelligent snack bar etc..Different from traditional intelligent cabinet, the intelligence applied to electric business industry
Cabinet typically requires main frame and multiple slaves on tall and big.Pass through the universal serial bus sides such as RS485, CAN between main frame and slave
Formula connects, and forms dcs (such as Fig. 1).Because main frame is generally more expensive, it is necessary to which connecting multiple slaves could reduce always
Body cost.In order to simplify wiring, set expandability is improved, more advanced control method is between each cell inside slave
Connected by universal serial bus such as RS485, CAN, in this way, just constituting one in main frame, slave, slave between cell three
Two-stage distributed control system (such as Fig. 2).
In two kinds of above-mentioned bus distributed control systems, it can all be related to a problem of node address distributes, mesh
Move ahead and be generally configured using toggle switch in the industry.A toggle switch is installed or welded on each node, passes through dial-up
The various combination of position is switched, determines node address.The advantages of this method is simple to operate, and change address is convenient, and shortcoming is also very bright
It is aobvious:
1) each node is required for a toggle switch, and need to take several I/O ports, adds system cost.
2) toggle switch after long-play, there is the risk that loose contact causes address error as a mechanical part.
3) toggle switch is set to adds additional workload.
In the dcs shown in " Fig. 1 ", a main frame generally connects 4~10 slaves, therefore one group of equipment
Need manually to set 4~10 toggle switch, this workload can still receive reluctantly.It is but distributed in the two level shown in " Fig. 2 "
In control system, if main frame cascades 10 slaves, each slave cascades 20 cells, then total conode has 10*20+10=
210 nodes.It will be very big workload once to set more than 200 individual node address, and is easy to visual fatigue occur, is dialled
Wrong address.
The content of the invention
It is an object of the invention to provide it is a kind of be applied to intelligent cabinet bus control system in node address method to set up,
To solve the problems mentioned in the above background technology.
To achieve the above object, the present invention provides following technical scheme:
A kind of node address method to set up being applied in intelligent cabinet bus control system, including main frame and multiple nodes,
Connected between main frame and node by bus, each node includes at least one button and a LED light, and node has extremely
S0, S1 and S2 three states are included less, and after system electrification, all nodes are all in S0 states, and under the state, node performs
Set task, LED light slow flash, now main frame is by sending order A in bus, and order A is broadcasting command, institute
No matter it is what can receive the order to have node address, after node receives the order, switch from normal operating conditions S0
To address state S1 to be set, now all nodes are waiting for main frame and issue specific address information, LED light under the state
Chang Liang, to distinguish S0 states, now main frame is by sending order B to bus, and order B is also broadcast address, and carrying to set
The specific address information put, after the stateful node for S1 receives the address information, state is switched to S2, and now LED is indicated
Lamp quick flashing, the stateful node for S2 all have received identical address, but only one of which node has an opportunity to receive the ground
Location, the chance determined by the button on node, after the nodal test of S2 states to the button, receives new address, raw address
Failure, and the state of oneself is switched back into normal operating conditions S0 from S2.During S2 switches back into S0, the node can be sent
One broadcasting command F is on Bus Wire, and to represent that the address of main frame push has been accepted, it is wide that the nodes of other S2 states receives this
After broadcasting order F, that is, know that the address to be confirmed such as current has been failed, continue waiting for new address so as to switch back into S1 states, arrive
Untill this, a node address can easily be set, and the repeatable order B that sends of main frame pushes different addresses to bus, uses
Family continues to set by button, and up to whole nodes, setting completed, and during this, main frame can pass through the broadcasting command of node feeding back
F, next address to be set is sent automatically.
Preferred scheme as the present invention:The node is in S1, during S2, if not receiving the order of main frame for a long time
Overtime return is understood to working condition S0.
As the preferred scheme of the present invention, the node receive new address from S2 switch back into S0 states when, broadcast can be sent
F is ordered to bus.
Preferred scheme as the present invention:The node receives the broadcasting command C of main frame transmission, all can switchback working condition
S0。
Compared with prior art, the beneficial effects of the invention are as follows:1st, one is replaced with a LED light and a button
Toggle switch, cost are lower;2nd, button replaces toggle switch, takes less cpu port;3rd, coordinate host address setting soft
Part, setting is ultrafast, saves labour turnover;4th, FLASH memory nodes address, there will not be mechanical failure problems.
Brief description of the drawings
Fig. 1 is main slave dcs schematic diagram;
Based on Fig. 2, slave and the two-stage distributed control system of cell plate;
Fig. 3 is the bus network topology figure applied to the node address method to set up in intelligent cabinet bus control system;
Fig. 4 is the node state transition graph applied to the node address method to set up in intelligent cabinet bus control system.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
Refer to Fig. 1-4, a kind of node address method to set up being applied in intelligent cabinet bus control system, including main frame
With multiple nodes, connected between main frame and node by bus, each node includes at least one button and a LED instruction
Lamp, node have three states including at least S0, S1 and S2, and after system electrification, all nodes are all in S0 states, the shape
Under state, node performs set task, and LED light slow flash, now main frame is by sending order A to bus, order A
For broadcasting command, no matter what all node addresses, which are, can receive the order, after node receives the order, from normal work
Make state S0 and be switched to address state S1 to be set, now all nodes are waiting for main frame and issue specific address information, the shape
LED light Chang Liang under state, to distinguish S0 states, now for main frame by sending order B to bus, order B is also broadcast ground
Location, carry the specific address information to be set, after the stateful node for S1 receives the address information, state is switched to
S2, now LED light quick flashing, the stateful node for S2 all have received identical address, but only one of which node
Have an opportunity to receive the address, the chance is determined by the button on node, after the nodal test of S2 states to the button, is received
New address, raw address failure, and the state of oneself is switched back into normal operating conditions S0 from S2.S0 process is switched back into S2
In, the node can send a broadcasting command F to Bus Wire, to represent that the address of main frame push has been accepted, other S2 shapes
After the node of state receives broadcasting command F, that is, know that the address to be confirmed such as current has been failed, continue so as to switch back into S1 states
New address is waited, so far, a node address can easily be set, and repeatable send of main frame orders B push different
Address is in bus, and user continues to set by button, and up to whole nodes, setting completed, and during this, main frame can pass through section
The broadcasting command F of point feedback, sends next address to be set automatically.
The present invention operation principle be:Each node of the system control has a LED light and a button,
LED light is used to indicate the different working condition S0-S2 of node, and button is used to confirm whether the node receives main frame to push
The address come.After system electrification, all nodes in bus are all in S0 states, and under the state, node performs set work
Make task, LED light slow flash.Now main frame can send order A to bus, and order A is broadcasting command, and all nodes are not
It is what can receive the order by address, after node receives the order, is switched to address from normal operating conditions S0 and treats
If state S1, now so node is waiting for main frame and issues specific address information, LED light Chang Liang under the state,
To distinguish S0 states.Now for the transmittable order B of main frame in bus, order B is also broadcast address, carry to be set it is specific
Address information.After the stateful node for S1 receives the address information, state is switched to S2, now LED light quick flashing.Institute
The stateful node for S2 all have received identical address, but only one of which node has an opportunity to receive the address, the chance
It is to be determined by the button on node, user wants to allow which node to receive the address, is just pressed on the button of which node
Once, the nodal test of S2 states is to after the button, receiving new address, raw address failure, and the state of oneself is switched from S2
Return normal operating conditions S0.During S2 switches back into S0, the node can send a broadcasting command F to Bus Wire, with
Represent that the address of main frame push has been accepted, after the nodes of other S2 states receives broadcasting command F, that is, know current etc. to be confirmed
Address failed, continue waiting for new address so as to switch back into S1 states.So far, a node address can be light
Set, now the node of address to be placed has just lacked one in bus, it is assumed that originally there is N number of node to need to set, it is now remaining
N-1 node, which is in S1 states and waited, to be continued to set, and the repeatable order B that sends of main frame pushes different addresses to bus,
User continues to set by button, and up to whole nodes, setting completed.During this, main frame can be ordered by the broadcast of node feeding back
F is made, sends next address to be set automatically, user need to only click button on corresponding node, set simple, side
Just.In addition when node is in S1, during S2, if not receiving the order of main frame for a long time can overtime return to working condition S0.
Any node receives the broadcasting command C of main frame transmission, all can switchback working condition S0.