Realize communication node module method in common on a kind of bus at the scene
Technical field
The present invention relates to the field bus communication technical field, be specifically related to realize on a kind of bus at the scene communication node module method in common.
Background technology
Communication system based on fieldbus (as the CAN bus) has a plurality of communication nodes in bus, above all nodes all are articulated in, each node all has a unique communication identifier ID to be different from other nodes, and the communication on the bus between the node is discerned by this ID.These ID must be distributed when setting up communication system, each node distribute one unique ID number, when node is articulated on the bus like this, just can be normally and other node communications, otherwise can cause the communication bus confusion.
Fieldbus has two characteristics: one is that number of nodes on the bus is a lot.For example in the single network that is made of the CAN bus, can articulate numerous node in theory.In the practical application, interstitial content is limited by the electrical characteristic of the network hardware, when using PhilipsP82C250 as the CAN transceiver, allows to articulate 110 nodes in the consolidated network.
Another characteristics are that the same or analogous node of function is a lot of on the bus, because field bus system generally is to coordinate all node modules by control to reach certain control effect, in laser printer system based on the CAN bus, the node number has 11, and the function of all nodes is about the same---and be exactly the motion of controlling motor.
The method of determining node ID at present generally is to specify in module by hardware or software, in case after determining, revise the hardware or the software of the just necessary update module of ID.Therefore, though the function striking resemblances of two node modules on the bus, because the ID difference, also can't be general between the module.The exploitation complexity that causes system like this safeguards trouble more, and the kind of system module is many, and number is many, and the quantity that spare part needs is big.In the laser printer based on the CAN bus, each node all is a motor movement control module as previously mentioned, comprises two-phase induction motor driving, direct current machine driving, five-phase induction motor driving etc., also has some input/output ports etc.The function of each control module is all very approaching, but owing to its ID specifies in software, so different modules need load different software versions.Cause the module type of whole communication system many, software version is many, and this is all very inconvenient for exploitation and maintenance, and spare part also needs each all to provide one, and spare part quantity is various, and maintenance cost is very high.
Urgently search out a kind of method in this area, can make in the fieldbus each node module general on hardware and software, reduce the maintenance cost and the spare part quantity of system, increase work efficiency.
Summary of the invention
The purpose of this invention is to provide and realize communication node module method in common on a kind of bus at the scene.
Technical scheme of the present invention provides and realizes communication node module method in common on a kind of bus at the scene, may further comprise the steps:
(1) function in the field bus system is identical or close module is merged together, and is integrated into a general module.
(2) marker circuit of a module I D of design on the general module can be provided with logic high/low level by external action, to represent the binary data of its ID.
(3) general module software by reading the data message of marker circuit correspondence, obtains the communication id of this module when initialization, thereby carries out corresponding nodal function.
(4) change marker circuit ID realizes the exchange between the node module.
The described external action of step in the inventive method (2) can be to use toggle switch, also can be to use wire jumper.
The invention has the beneficial effects as follows the software and hardware of node module on the unified fieldbus, reduce type of modules, it is general that the last communication node module of bus is realized, improves the maintainability of system, reduces the system maintenance cost.
Description of drawings
Fig. 1 marker circuit schematic diagram of the present invention
The structural representation of Fig. 2 individual node
Embodiment
Further describe the present invention below in conjunction with the drawings and specific embodiments.
Embodiment 1
(1) function in the field bus system is identical or close module is merged together, and is integrated into a general module, as Fig. 2.
(2) comprise original communication interface, governor circuit on the general module, also designed the marker circuit of a module I D.
Marker circuit 3 is to use the circuit that toggle switch or wire jumper etc. can the distinguishing identifier logic level.Can pass through external action, as stir toggle switch logic high/low level is set, by the high/low binary data of representing its ID of logic level.Fig. 1 is the marker circuit schematic diagram, represents the module I D binary data of 8bit with 8 toggle switchs 4, and switch is dialled when " ON " position, corresponding data are " 1 ", dial when " OFF " position, corresponding data are " 0 ", the different different data of dial-up state representative.
(3) general module software when initialization by reading the data message of marker circuit correspondence, obtain the communication id of this module, and ID carries out the function of this ID corresponding node thus, after general module is articulated on the fieldbus like this, the node module that just is equivalent to this ID correspondence, can with other node communications.
(4) because general module obtains different ID by the ID marker circuit, conflict can not appear so can use on different nodes.Only need to change marker circuit ID between the node module and just can realize exchanging, realized the general function of field bus communication node.