CN109245979A - A kind of CANopen master-salve station Control for Dependability method and its overall management device - Google Patents

A kind of CANopen master-salve station Control for Dependability method and its overall management device Download PDF

Info

Publication number
CN109245979A
CN109245979A CN201811303119.0A CN201811303119A CN109245979A CN 109245979 A CN109245979 A CN 109245979A CN 201811303119 A CN201811303119 A CN 201811303119A CN 109245979 A CN109245979 A CN 109245979A
Authority
CN
China
Prior art keywords
slave station
main website
heartbeat
starting
module
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.)
Granted
Application number
CN201811303119.0A
Other languages
Chinese (zh)
Other versions
CN109245979B (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.)
Hefei Baode Industrial Automation Co Ltd
Original Assignee
Hefei Baode Industrial Automation Co Ltd
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 Hefei Baode Industrial Automation Co Ltd filed Critical Hefei Baode Industrial Automation Co Ltd
Priority to CN201811303119.0A priority Critical patent/CN109245979B/en
Publication of CN109245979A publication Critical patent/CN109245979A/en
Application granted granted Critical
Publication of CN109245979B publication Critical patent/CN109245979B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/403Bus networks with centralised control, e.g. polling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Abstract

The invention discloses a kind of CANopen master-salve station Control for Dependability method and its overall management device, the multiple equipments being applied in CAN bus, and one of equipment is main website, and other equipment are slave station;When the main website starts the slave station, the main website configures the heartbeat or life cycle of the slave station.The Control for Dependability method includes: so that the slave station is sent heartbeat packet to the main website, or so that the main website is sent life and guard message to the slave station;All slave stations are arranged by node sequence and form starting chain;It is removed from the starting chain and starts successful slave station or the slave station without being again started up, starting is failed and the slave station that need to be again started up moves to the last-of-chain for starting chain;When the main website does not receive by a preset time heartbeat packet of slave station or the main website sends life cycle monitoring message and do not receive the reply of the slave station repeatedly and, corresponding error handle is carried out according to the type of the slave station.

Description

A kind of CANopen master-salve station Control for Dependability method and its overall management device
Technical field
The present invention relates to a kind of Control for Dependability method of communication technique field and its manager, more particularly to it is a kind of CANopen master-salve station Control for Dependability method and its overall management device.
Background technique
CAN is the abbreviation of Controller Area Network, is the serial communication protocol of ISO International standardization.CAN Belong to the scope of fieldbus, it is a kind of serial communication network for effectively supporting distributed AC servo system or real-time control.Meanwhile The high-performance and reliability of CAN is accepted extensively, and is widely used in industrial automation, ship, Medical Devices, industry Equipment etc..
There is multiple equipment in one CAN bus based network, equipment is likely to occur unexpected failure in the process of running, When certain part cisco unity malfunctions in a distributed system, the normal operation of whole system can be destroyed.When some It is which equipment failure to detect, and after the specific equipment for generating failure of locking when equipment goes wrong Need it is certain remedy recovery measure, this needs a Control for Dependability mechanism to realize.
Summary of the invention
For the failure problems of single module in the operation that may cause in the distributed system of more equipment combination, the present invention A kind of CANopen master-salve station Control for Dependability method and its overall management device are provided, realize the fault detection of more equipment, and root It is pre-configured with according to the type and system of more equipment and carries out selectable recovery processing, processing includes stopping whole network, or reset All devices, or individual equipment is resetted, and restarting and configuration flow are carried out after resetting.
The present invention is implemented with the following technical solutions: a kind of CANopen master-salve station Control for Dependability method is applied to Multiple equipment in CAN bus, and one of equipment is main website, other equipment are slave station;The main website starts the slave station When, the main website configures the heartbeat or life cycle of the slave station;
The Control for Dependability method includes:
So that the slave station is sent heartbeat packet to the main website, or make the main website send life guard message to it is described from It stands;
All slave stations are arranged by node sequence and form starting chain;
It is removed from the starting chain and starts successful slave station or the slave station without being again started up, by starting failure and needed again The slave station of secondary starting moves to the last-of-chain of the starting chain;
The heartbeat packet of slave station is not received by a preset time one in the main website or the main website sends life When period guards message repeatedly and do not receive the reply of the slave station, corresponding configuration is carried out according to the type of the slave station Error handle.
As a further improvement of the foregoing solution, the main website includes a heartbeat consumer module, and each slave station includes One heartbeat producer's module;
One heartbeat consumer module includes the HBC table that multiple list items are arranged, and each heartbeat producer module is one corresponding The list item of communication object table;
The list item of the corresponding communication object table of one list item of the HBC table, and each list item of the HBC table is corresponding The heartbeat message of one slave station;
Each heartbeat producer module judges whether the time interval of a preceding sending time and current time is greater than one Default heart time, and when time interval is greater than the default heart time, heartbeat packet is sent to the main website;
All list items of heartbeat consumer module's poll HBC table judge that last heartbeat receiving time is with current time More than one preset time two of no generation, is to carry out the error handle.
As a further improvement of the foregoing solution, the main website includes a NMTM module, and the NMTM module includes one Multiple NMTM list items, the corresponding slave station of each NMTM list item is arranged in a NMTM module table, the NMTM module table;
Wherein, two COB list items of the corresponding communication object table of each NMTM list item, and the two of the communication object table The list item of one communication object table of the corresponding slave station of a COB list item.
Further, the slave station includes a NMTS module, and the NMTS module corresponds to a communication object table List item;
The NMTM module is polled, and is guarded time transmission life according to the life of NMTM list item and guarded message to institute State slave station;The NMTS module receives readjustment, and replys message to main website;In the poll of the NMTM module, the NMTM Module carries out the error handle when waiting the slave station to reply more than a preset time three.
As a further improvement of the foregoing solution, all slave stations are arranged by node sequence and forms the method packet of starting chain It includes:
Successively start all slave stations, whether the slave station before the slave station inspection of subsequent starting starts success, and opens existing It moves forward when moving successful slave station.
As a further improvement of the foregoing solution, starting is failed and the slave station that need to be again started up moves to the starting chain The method of last-of-chain includes:
Increase a copy of starting failure and the slave station that need to be again started up in the last-of-chain, and using former part as needing to remove Node, start chain end of polling(EOP) when removed.
As a further improvement of the foregoing solution, the Control for Dependability method further include:
The slave station is repeatedly started;
Wherein, after starting the slave station failure for the first time, the slave station is first resetted, then carry out second of starting, and After second of starting failure, the slave station is resetted again, removes the slave station of starting failure at least twice.
As a further improvement of the foregoing solution, the method for error handle includes:
Judge whether node is located in control list;
It when the node is located in the control list, determines whether to stop all nodes, is then to stop owning Node, and terminate error handle, it otherwise determines whether to reset all nodes;
When the node is not located in the control list, terminate error handle;
When allowing to reset all nodes, all nodes are resetted;When not allowing to reset all nodes, single section is first resetted Point restarts the equipment of individual node, after terminate error handle.
As a further improvement of the foregoing solution, when the slave station sends heartbeat packet to the main website, the slave station is every The reply for losing the primary heartbeat packet, carries out a corresponding error handle;
When the main website sends life monitoring message to the slave station, the slave station is every to lose a life monitoring message Reply, carry out a corresponding error handle;After carrying out an error handle, the slave station is abandoned checking the life monitoring Message.
The present invention also provides a kind of overall management device, be used to manage be arranged in the multiple equipment in CAN bus it is multiple Module;When the overall management device manages multiple modules, CANopen master-salve station reliability control described in above-mentioned any one is realized Method processed.
CANopen master-salve station Control for Dependability method and its overall management device of the invention, can solve between master-salve station Dead connectivity problem, improve the reliability of distributed system, and realize the starting to the multiple equipment in CAN bus, raising is set The flexibility connected between standby.
Detailed description of the invention
Fig. 1 is the flow chart of the start command of multiple equipment, event, agreement and state in the embodiment of the present invention 1;
Fig. 2 is the flow chart that starting processing is carried out to master-salve station in Fig. 1;
Fig. 3 is the corresponding diagram of the main website and multiple slave stations in the embodiment of the present invention 1 under heartbeat mechanism;
Fig. 4 is the corresponding diagram of main website and multiple slave stations under life cycle mechanism in the embodiment of the present invention 1;
Fig. 5 is the organization chart of NMTM table in the embodiment of the present invention 1;
Fig. 6 is the function structure chart of the overall management device of the embodiment of the present invention 3;
First part's flow chart when Fig. 7 is the overall management device starting main website of the embodiment of the present invention 3;
Second part flow chart when Fig. 8 is the overall management device starting main website of the embodiment of the present invention 3;
Fig. 9 is the module polls figure of the overall management device in Fig. 6;
Figure 10 is the functional block diagram of the first part of the state machine of the overall management device in Fig. 6;
Figure 11 is the functional block diagram of the second part of the state machine of the overall management device in Fig. 6;
Figure 12 is the flow chart that the overall management device in Fig. 6 starts to process starting NMT slave station;
Figure 13 is the flow chart of the first part of the starting method of the CANopen slave station of the embodiment of the present invention 3;
Figure 14 is the flow chart of the second part of the starting method of the CANopen slave station of the embodiment of the present invention 3;
Figure 15 is the flow chart of the Part III of the starting method of the CANopen slave station of the embodiment of the present invention 3;
Figure 16 is the flow chart of the overall management device inspection configuration in Fig. 6;
Figure 17 is the flow chart of the overall management device inspection NMT state in Fig. 6;
Figure 18 starts the flow chart of error control for the overall management device in Fig. 6;
Figure 19 makes the flow chart of the first part of slave station starting state machine for the overall management device in Fig. 6;
Figure 20 makes the flow chart of the second part of slave station starting state machine for the overall management device in Fig. 6;
Figure 21 makes the flow chart of the Part III of slave station starting state machine for the overall management device in Fig. 6;
Figure 22 makes the flow chart of the Part IV of slave station starting state machine for the overall management device in Fig. 6;
Figure 23 is the functional block diagram of the AutoHb module configuration status machine of the embodiment of the present invention 3.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.
Embodiment 1
Fig. 1-5 is please referred to, a kind of CANopen master-salve station Control for Dependability method is present embodiments provided, is applied to CAN Multiple equipment in bus, and one of equipment is main website, other equipment are slave station.When main website starts slave station, main website configuration The heartbeat or life cycle of slave station.
Main website includes a heartbeat consumer module, and each slave station includes heartbeat producer's module.One heartbeat disappears Expense person's module includes the HBC table that multiple list items are arranged, the list item of the corresponding communication object table of each heartbeat producer module. The list item of the corresponding communication object table of one list item of HBC table, and the heartbeat letter of the corresponding slave station of each list item of HBC table Breath.
Main website includes a NMTM module, and NMTM module includes a NMTM module table, and each NMTM module table is arranged Multiple NMTM list items, the corresponding slave station of each NMTM list item;Wherein, the two of the corresponding communication object table of each NMTM list item A COB list item, and the list item of a communication object table of the corresponding slave station of two COB list items of communication object table.Slave station packet Include a NMTS module, and the list item of the corresponding communication object table of NMTS module.
Wherein, Control for Dependability method includes:
(1) so that slave station is sent heartbeat packet to main website, or so that main website is sent life and guard message to slave station;Specifically, each Heartbeat producer's module judges whether the time interval of a preceding sending time and current time is greater than a default heart time, And when time interval is greater than default heart time, heartbeat packet is sent to main website.
(2) all slave stations are arranged by node sequence and forms starting chain;Aligning method are as follows: successively start all slave stations, after Whether the slave station before the slave station inspection of continuous starting starts success, and moves forward when existing and starting successful slave station.
(3) it is removed from starting chain and starts successful slave station and the slave station without being again started up, by starting failure and needed The slave station being again started up moves to the last-of-chain of starting chain.Here, the one of the slave station that last-of-chain increases starting failure and need to be again started up A copy, and using former part as the node that need to be removed, it is removed when starting the end of polling(EOP) of chain.
(4) slave station is repeatedly started;Wherein, after first time starting slave station failure, slave station is first resetted, then carry out the Restarting, and after second of starting failure, slave station is resetted again, removes the slave station of starting failure at least twice.
(5) heartbeat packet of slave station is not received by a preset time one in main website or main website sends life cycle When guarding message repeatedly and not receiving the reply of slave station, the error handle of corresponding configuration is carried out according to the type of slave station.
All list items of heartbeat consumer module's poll HBC table judge that last heartbeat receiving time is with current time More than one preset time two of no generation, is to carry out error handle.NMTM module is polled, and according to the life of NMTM list item The life monitoring time sends life and guards message to slave station.NMTS module receives readjustment, and replys message to main website.In NMTM module Poll in, NMTM module wait slave station reply more than a preset time three when, progress error handle.
In the present embodiment, the method for error handle includes:
(a) judge whether node is located in control list;
(b) it when node is located in control list, determines whether to stop all nodes, is to stop all nodes, And terminate error handle, it otherwise determines whether to reset all nodes;
(c) when node is not located in control list, terminate error handle;
(d) when allowing to reset all nodes, all nodes are resetted;When not allowing to reset all nodes, first reset single A node restarts the equipment of individual node, after terminate error handle.
When slave station sends heartbeat packet to main website, when not receiving the heartbeat packet reply of slave station, corresponding primary mistake is carried out Accidentally handle;When main website sends life monitoring message to slave station, when not receiving the life monitoring message of slave station and replying, carry out pair The error handle answered;After carrying out an error handle, the inspection that message is guarded to slave station life is abandoned.
The CANopen master-salve station Control for Dependability method of the present embodiment and its overall management device, can solve master-salve station it Between dead connectivity problem, improve the reliability of distributed system, and realize the starting to the multiple equipment in CAN bus, improve The flexibility connected between equipment.
Embodiment 2
Present embodiments provide a kind of overall management device, be used to manage be arranged in the multiple equipment in CAN bus it is more A module.When the overall management device manages multiple modules, the CANopen master-salve station Control for Dependability side in embodiment 1 is realized The step of method.
Embodiment 3
Referring to Fig. 6, present embodiments providing a kind of overall management device, it is used to manage the multiple equipment in CAN bus Multiple modules of middle setting.
In order to realize the modularization and configurableization of equipment, need to carry out modularized processing, modularization to different function Processing includes the monofile and configurableization of individual module.In description in the case where connecing, overall management device is indicated with CopMgr, And manage all modules as a whole.
It is communication object table (COB) in the bottom, main superstructure relevant to bottom CAN driving.
It is modules on COB, PDO is data simultaneous module, is responsible for what data synchronized.
SDOS, SDOC are communication for service objects services end and client respectively, are primarily used to transmission SDO message and remotely read Object dictionary, the processing data object module that PDO carries out data transmission are write, and SDO is used for the service number of remote parameter setting According to object module, and it just will do it data transmission when needing to be arranged.
NMT, NMTM, NMTS are mainly responsible for two parts of processing, and one is that life cycle monitoring is relevant, another is Device events when starting.
HBP, HBC are responsible for handling heartbeat mechanism, and EMCP, EMCC are responsible for handling emergency.
SRD, SDOM on this are responsible for dynamic service request, and establish on the basis of SDOS, SDOC, and AutoHb is Automatically configure the module of heartbeat and life cycle.CfgMa is configuration manager, can use device description file to configure slave station Function.
Overall management device manages all modules and realizes starting and Control for Dependability.
Above-mentioned starting is the error handle of the starting to all slave stations, configuration and possibility generation in the process, reliably Property control be starting after potential mistake is handled in run mode.Main website starting include main station side oneself starting and The starting of each slave station of main website parallel processing, main website starting need to wait all slave stations start successfully or unsuccessful progress accordingly Processing.
Fig. 7 and Fig. 8 is please referred to, the present embodiment additionally provides the starting method of CANopen main website, and it is total to be applied to CAN Multiple equipment on line, and one of equipment is main website, other equipment are slave station.
Starting method includes:
Step S1 judges whether equipment is configured as NMT main website after device power.
When equipment is not configured as NMT main website, judge whether equipment allows initiate by its own, be, equipment jumps to automatically MNT operating status enters NMT slave station mode afterwards, is otherwise directly entered NMT slave station mode;If equipment is configured to main website, inspection Whether have flight main website processing function, main website is executed if having and is negotiated if looking into, the processing of flight main website refers to by multiple equipment It is configured to main website, then can execute arbitration, the high triumph of priority is changed into slave station as main website, the low meeting of priority.
When equipment is configured as NMT main website, step S2 is executed, the processing of NMT flight main website is carried out to main website;Wherein, exist In the present embodiment, carry out NMT flight main website processing method are as follows: be configured to main website if there is multiple equipment, after can execute Arbitration, the high equipment of priority win and as main websites, and the low equipment of priority is changed into slave station.
After main website carries out the processing arbitration failure of NMT flight main website, into NMT slave station mode.
After the processing of progress NMT flight main website of main website is arbitrated successfully, step S3 is executed, judges whether main website requires LSS to take Business.
In master request LSS service, step S4 is executed, executes the processing of LSS main website.LSS service is layer setting service, and For the flag information of slave station to be arranged;Wherein, flag information includes device type, mark, coding, version number, sequence number.
After main website failed call LSS services or execute the processing of completion LSS main website, step S5 is executed, is judged whether there is The active position of slave station is set, and is, reset enlivens the slave station that position is not set, otherwise resets all slave stations;All slave stations have work Jump position is set, and just remote reboot enlivens what position was not set in turn, if be all not provided with, disposably restart it is all from It stands, which may allow certain special slave stations not restarted by main website, guarantee the particularity of slave station, this in some applications may There is specific use, for example certain is not intended to carry out certain by main website restarting at any time, the slave station from equipment Special task.
Step S6, judges whether the slave station of all force starts has been turned on success.
In the inactive success of the slave station there are force start, stop main website starting.
When the slave station of all force starts starts successfully, execute step S7, judge main website whether allow automatically into Run mode.
When main website does not allow automatically into run mode, waits and to be applied main website is entered into run mode.
Step S8, judges whether main website allows that all nodes is remotely allowed to enter run mode.
When main website is not allowed to that all nodes is remotely allowed to enter run mode, normal operating is jumped to terminate to start.
When main website is allowed to that all nodes is remotely allowed to enter run mode, step S9 is executed, judges whether optional slave station opens It moves successfully.Here, after due to starting all slave station startings, all slave stations is not represented and are started successfully, it is also possible to some Slave station is lost or occurs other mistakes, then the slave station is not start success, some slave stations do not start successfully also can be after Continue down, but some possible slave stations are because responsible task is critically important, it is necessary to start successfully, these are configured to from standing-meeting The slave station of force start, if there is such slave station exists, the slave station of these force starts must start up success, otherwise main website into Enter to start abort state.
When all slave stations start successfully, all slave stations is first made to enter run mode, after jump to normal operating to terminate Starting.In success inactive there are slave station, first make to start successful part slave station and enter run mode, after jump to normal operating To terminate starting.
In the present embodiment, the judgment method of step S1 specifically:
By the numerical value of the position 0 of the object 0x1F80 in check object dictionary, judge whether equipment is configured as NMT master It stands;Equipment starting after, the equipment be to be determined by the position 0 of object 0x1F80, that is, be configured as main website or slave station , and object 0x1F80 is exactly to carry out similar in this way configuration, it also will do it the configuration of other a variety of attributes, it is same other very The multipair configuration as different attribute may be used as.One object is directed toward a judgement, all indicates a kind of configuration or parameter setting.Therefore In step S2-S9:
By the position 1 of the object 0x1F80 in check object dictionary and the numerical value of position 3, judge whether main website allows remotely to open Begin all nodes;By the numerical value of the position 2 of the object 0x1F80 in check object dictionary, judge main website whether allow automatically into Run mode;By the numerical value of the position 5 of the object 0x1F80 in check object dictionary, the processing of NMT flight main website is judged whether to; By the numerical value of the position 4 of the object 0x1F84 in check object dictionary, the active position for judging whether there is slave station is set;Pass through The position 0 of object 0x1F81 in check object dictionary and the numerical value of position 3, judge whether be force start slave station.
In this way, the starting to the multiple equipment in CAN bus may be implemented in the present embodiment, and be configured according to equipment Attribute carries out the processing of differentiation, realizes the flexibility of equipment connection, promotes distributed system to the adaptability of different application.
Referring to Fig. 9, the Booting sequence in order to realize main website, in CopMgr, CopMgr defines multiple shapes of equipment State and event, event is used to synchronize with other modules, and state is then used to carry out the different disposal of different situations.CopMgr It is a module in more top, can uses other all modules, at the process of other all modules of CopMgr poll Reason, and safeguard the state machine of oneself, in which:
A) referring to Fig. 10, equipment has a starting event when starting, CopMgr can jump to starting state, open It is checked under dynamic state and oneself is arranged to main website or slave station, here as main website is arranged to main website, then registers one A SDO dynamic requests, the SRD of oneself are registered on SDOM, and SDOM is also in main website, the registration of the dynamic service request of SDO Undergo multiple steps.
After experienced dynamic service request and succeed in registration, the SRD event of succeeding in registration can be activated, and then jump to configuration shape State, and configuration event is activated, there may be multiple events under each state, the activation of each event executes different function respectively again Energy.
B) in the configuration event under configuration status, the starting initial information of slave station is set, rear activation sends reseting event, Then all slave stations of reseting event medium-long range reset are being sent, remote reset is realized by sending CAN message, and NMTM is utilized The corresponding COB of module, which is realized, to be sent, and NMTS has corresponding COB to realize reception, and locks corresponding readjustment processing reception event, It here is reseting event, slave station will do it reset operation.
The COB ID in the message transmission of slave station is resetted if it is 0, all slave stations can all respond, but for receiving Slave station for whether execute and reset the node ID number that operation depends on the data segment of message started, if node ID number is 0, Then all slave stations can all execute response command, and the order of response depends on the command type that main website sends the data segment of message.This In be reset command, if the node ID of the data segment in the received message of slave station (is not COB ID, COB ID is in data segment In the CAN identification field of front) it is not 0, then whether consistent with the ID number of oneself slave station judges the node ID, if unanimously It responds, does not otherwise continue to respond.
C) after resetting all slave stations, firstly, the poll of main website activation slave node queue, this part mainly realize it is all from The starting stood, the starting of these slave stations from wide in range concept of time for be parallel starting, it is microcosmic it is upper for be each slave station Execute first step state in turn, then execute second state in turn, and so on, record variable record how many Slave station completes start-up course, waits all slave stations to be completed after start-up course, this record variable is decremented to 0.Later, judge Whether there is slave station to be configured to force start type, force start type means that the slave station must start up success, one from Station, which completes start-up course and do not represent the slave station, to be started successfully, mistake occurs in possible start-up course.Force start is set Slave station may be because special task and then require to must start up success, even and if those are not very special slave station starting failures , will not influence generally be configured to force start type if entirely applying, if slave station has force start type , then check that the slave station of the type must start up success, otherwise main website stops starting, into abort state, forbids slave node The poll of queue.If the slave station of force start all starts successfully, other stations are also completed start-up course, and main website is according to matching It sets to enter and waits application state or be directly entered run mode, be configured to enter waiting application state here.Either etc. State to be applied still enters abort state, all can notify application program by readjustment before this.Here handle after starting successfully Start successful event notification applications, application can activate run case.
D) Figure 11 is please referred to, in the case where waiting application state, due to application activating run case, so main website meeting basis is matched It sets and determines that slave station is oneself to enter run mode or main website is allowed to enter run mode by slave station by remote command.Here it is configured NMTM message notifying slave station is sent at main website and enters run mode, and main website oneself also enters run mode, so far completes main website The starting of starting and all slave stations.
Figure 12 is please referred to, in some embodiments, CopMgr also manages the starting of slave station.
A) when main website starts, need to start all slave stations, starting slave station refers to the starting to single slave station, parallel Processing slave station starting is the parallel starting to multiple slave stations, and starting means the multiple communication interaction with slave station, starts slave station generation This process of table.
B) starting slave station does not represent slave station and starts successfully, if slave station is not replied, checks whether the slave station is to force Start and whether overtime.If it is force start and overtime, then noting that application, terminate the starting of the substation, As soon as and sending a signal 2 to the main flow for starting to process slave station starting, if the slave station has reply to check whether slave station starts Succeed, does not notify the starting for applying and terminating the slave station then.
C) when starting slave station, if slave station is not replied, the order of the remote reset slave station will be sent, then It waits reentering for 1 second and starts the slave station process, if the slave station is force start type, also need to check in the limited time It is interior to have reply, it is operated as the slave station and then waiting if time-out undying would not carry out resetting.
D) starting of slave station is started to process, this process belongs to a part in main website start-up course, starts in main website Cheng Zhong needs the starting for waiting all slave stations to finish, this waiting is exactly the signal described in attached drawing, signal 1 indicate it is all from It stands and all experienced one-shot.Regardless of this starting is also being a time out for failure, it can all belong to one-shot and complete, and signal The slave station of force start type in 2 expression slave stations starts successfully corresponding signal.The signal indicates all force start types Slave station all start successfully, main website start when need to wait the two signals.In fact, the two signals are in design Its effect is realized with two correlated variables, specially variable 1 represents all slave station numbers, and variable 2 represents force start type Slave station number.When each slave station undergoes one-shot process, variable 1 can subtract 1, and when the slave station of each force start type opens It moves successfully, variable 2 subtracts 1.If all slave stations all experienced one-shot process, variable 1 will be eventually equal to 0, and The slave station of all force start types starts successfully, and variable 2 is last to be also equal to 0.Main website starting waiting just according to this two A variable judges whether all slave stations all start and whether all slave stations of force start type all start successfully, And then determine it is to enter to stop starting state or enter to wait application state.
So signal 1 terminates just to will do it in each slave station start-up course subtracts 1, and signal 2 has to wait for each pressure and opens The slave station of dynamic type, which starts, successfully just subtracts 1.
Etc. e) all slave station Booting sequences terminate the starting that can terminate to start slave station, and single slave station is next described in detail Start-up course.
Please refer to Figure 13, Figure 14 and Figure 15, single slave station Booting sequence are as follows:
1) when starting a slave station, first check whether the slave station is included in network list, main website management The node number of all slave stations can be all provided in advance, be to configure whole network, Suo Youcong by the configuration of host computer The node number stood is saved in the network list of main website, this list is exactly 0 position of position of object 0x1F81, object 0x1F81 It is an array, the corresponding slave station of each single item of array saves the relevant configuration of the slave station, if its position 0 is provided with, Indicate the corresponding slave station of the array item in network list.
It if the node number of the slave station in network list, will continue to start, otherwise can terminate the starting of the slave station, tie Beam means the final step into start-up course step, checks the result of starting.
2) after slave station is resetted by main website by remote message, slave station has carried out preliminary self-starting, and starting divides many steps, The corresponding state of each step, when entering quasi- operating status, slave station issues one starting notice message of main website, main website Starting slave station, that is, the position 2 of 0x1F81 are determined whether after receiving, and if it is start to carry out communication friendship with slave station Mutually.
It is synchronous that data are not carried out in the starting of slave station when not entering into run mode, it is necessary to wait slave stations starting at Data can be just executed into run mode after function to synchronize.
It enters in error control and handles if not allowing to start slave station, error control will continue to describe later, temporarily When retain.
If 3) allow to start slave station, the 0x1000 object of slave station is then requested, requesting the process of the object is one dynamic The process of state SDO request, is related to the Dynamic link library request of SDO, and the SRD of main website enters waiting Default Connected State, SDOM scanning COB ID is distributed to the SDOS of slave station and the SDOC of main website because what is requested here is default connection, default connection using The COB ID of fixed allocation, rather than dynamically distribute, when find request is default connection, distribution can be discharged COB ID, and the SDOS of setting slave station will not be removed, because the default SDOS of slave station is fixed setting, in slave station SDOS mould First SDOS list item is provided with when initialization block, corresponding COB list item, which is all fixed, to be provided with, this COB ID is Relevant to slave node number, default connection request is the fixed channel SDO, after the success of dynamic SDO connection request, meeting A SDO transmission is carried out to go to read the 0x1000 object of slave station
4) terminate to start if slave station is not replied, if there is replying, check the content and main station side 0x1F84 of reply Whether object saves consistent.If 0x1F84 object array corresponds to if the element of the slave station is not 0, tied if inconsistent Shu Qidong simultaneously can record type of error in case of mistake with error identification, that is, each step, wait last mistake Accidentally control processing.If 0x1F84 object is 0 or is consistent, the 0x1018 object of slave station is then requested.
5) there are four subindexs for 0x1018 object, include four objects, request respectively, and request whether waiting later has It replys, is checked whether unanimously if there is the 0x1F85-0x1F88 of reply and main station side is not 0, unanimously then continue following stream Journey, it is inconsistent, terminate to start and records reason mark.
Actually object 0x1000 and object 0x1018 corresponds to altogether five parameters, the respectively device type of slave station, factory Family mark, product coding, version number, sequence number are exactly to examine by SDO remote access object 0x1000 and object 0x1018 Look into corresponded in this five parameters and main station side 0x1F84-0x1F88 object array of slave station slave station element it is whether consistent.
6) entering B is optional process, and C is normal flow, the optional process meaning be this partial function be can skip or Person retains, but is finally also into the process of C, this is continued to describe below.
7) in optional process, check slave station enlivens whether mark is provided with, if being provided with indicates to be to enliven class Type slave station, then automatically configure heartbeat, and automatically configuring heartbeat is not the heartbeat parameter of slave station to be arranged, but obtain the heartbeat of slave station Parameter goes the heartbeat parameter of the slave station of the preservation of setting main website local.It namely carries out once automatically configuring heartbeat consumer, So-called heartbeat consumer refers to that the heartbeat packet of oneself is issued main website by the website for receiving heartbeat packet, each slave station, and main website is heartbeat The recipient of packet, this recipient is exactly heartbeat consumer HBC (heartbeat consumer), and generates the slave station of heartbeat packet It is heartbeat producer HBP (heartbeat producer).
8) it checks node state, waits the reply of node state, terminate to start if node state is not received by, such as Fruit node state has received, and checks whether node is currently in run mode.If it is with regard to carrying out error control processing, come into D process, behind be described, if not be in run mode, then reset the node communication.
The meaning done so is in a network, has mounted multiple equipment, wherein having main website and slave station, for the first time Main website and slave station, which all start, in starting finishes, and later in the process of running, possible certain slave stations error reporting occur to main website, master Station needs to reset slave station again and restarts all slave stations, it is also possible to and main website oneself needs to restart protocol stack because of certain reasons, But sometimes may want to certain slave stations when other slave stations break down or main website needs to restart, main website starting When not reset the slave station again again, the task that perhaps slave station has this special needs to run always, for it is such from Standing-meeting is configured to enliven the slave station of type, and main website will not reset it when starting again.
It is not reset when main website starting so enlivening type slave station, but the slave station for enlivening type has to Into run mode, and to enter run mode, it is necessary to which main website, which sends order, allows it to enter run mode, and work is needed to be reset before this The slave station for the type that jumps because the slave station for enlivening type enter after must being resetted and be started by main website by main website for the first time run mode it Just main website is not allowed to reset again to it afterwards, has just been restarted due to main website and do not known that enlivening type slave station is to reset for the first time also It is last time to be reset and entered run mode, so do not reset the slave station for enlivening type when main website starts, But start to check the state for the slave station for enlivening type when starting slave station, if the state for enlivening type slave station is not at Run mode, then it represents that this is to need to be reset subsequently into slave station Booting sequence for the first time, so for the slave station for enlivening type It needs to check node state, and judges whether in run mode, be to be directly entered D process to carry out error control, be not then table Showing that this enlivens slave station is to need to be reset for the first time, so can reset this enlivens type slave station.
Following process is then directly entered for inactive type slave station, because what the slave station of inactive type started in main website Period is crossed by remote reset.
9) it checks whether to need to check slave station program version, need, check and update, checked again for after update, after consistent Into next process, if you do not need to checking that program version is also directly entered next process C.
10) it checks configuration, error control service is carried out if correct, check next configuration is being described.
11) start error control service.
12) process to come from E is not allow to start slave station, so directly finishing and with starting success flag.
And the process to come from D is to enliven the slave station of type to be in run mode, so not allowing multiple again by main website Position and starting, so directly terminating and indicating that enlivening slave station has been in run mode with a mark L.
13) equipment is determined whether to after and enters operating status, once slave station enters run mode, data, which synchronize, to be opened Dynamic, the data between network node will realize synchronizing process, and the input data relevant to slave station in main website is consistent, And the output data of main website can be also consistent with the output of slave station.
In the function that the end that the end of the starting of slave station is exactly main website starting is realized.
Figure 16 is please referred to, checks a part that configuration belongs in slave station starting, two objects of predominantly inspection main website are No is 0, is 0 configuration (this is to configure for the first time) for updating slave station, otherwise requests the 0x1020 object of slave station, slave station 0x1020 object save slave station configuration last time update date and time, if the configuration update date of slave station and when Between it is consistent with the configuration date and time of the corresponding slave station of main station side, then there is no need to be configured for, otherwise update configuration, Update certain parameters that configuration is main website configuration slave station.
Figure 17 is please referred to, checks that node state is to first look at consumer's heartbeat for the slave station for enlivening type Whether time parameter is nonzero value.
In order to preferably state this process, it is necessary first to understand the state there are two types of the available slave station of method, it is a kind of The referred to as mechanism of heartbeat, the module that this part is realized is HBC module and HBP module respectively, and HBC module is the recipient of heartbeat, And HBP module is the sender of heartbeat, recipient is consumer, and producer is referred to as the producer, that is, consume-produce mould Type, main website is the consumer i.e. recipient of heartbeat, and slave station is the producer of heartbeat, and slave station sends one at regular intervals Secondary CAN message is to main website, and exactly slave station corresponds to HBP module, and main website corresponds to HBC module, COB the and HBC mould of HBP module The COB of block is mapped, and a HBC module receives the heartbeat packet of multiple HBP, and (CAN message, only its COB ID determines Determining it is what), exactly main website includes HBC module, that is, includes a HBC table, and HBC table then has multiple subitems. Only one COB of slave station, and this COB is overlapped with the COB of NMTS, the HBC module of such main website save it is all from The recipient HBC for corresponding HBP module of standing, and slave station only one HBP module, so the message that HBP module is sent only has HBC table can respond because the COB ID of HBP module and HBC table be it is relevant to node, HBP module and HBC table have CAN mark Corresponding relationship, slave station according to the setting interval of heart time parameter send heartbeat packet give HBC module, this heartbeat packet contains The current state of slave station, slave station are active transmissions, and main website be it is passive received, here it is heartbeat mechanisms.It can be seen that heartbeat machine System is summarized in short, and to be exactly slave station determine be spaced how long be once sent to one heartbeat of main website according to the heartbeat parameter of oneself Packet, heartbeat packet contain the current state of slave station, so checking the state of node, it is only necessary to obtain a heartbeat packet of slave station just It is known that the state of the slave station.
Another mechanism for obtaining slave station state is called node monitoring, it is that the one node monitoring of main website active transmission is asked It asks, then slave station passively replys a message, and the current state of slave station is contained in this node reverts back message.
So whether being 0 referring initially to consumer's heart time, consumer's heart time is main website when checking node state The heartbeat parameter of the correspondence slave station saved is held, but it is different with the value of the heartbeat parameter of the slave station, and the former is bigger than the latter, the former It is that whether can receive the heartbeat packet of the slave station before the deadline for checking, and the latter is slave station according to this time Heartbeat packet is sent, so the former is greater than the latter, when consumer's heart time is 0, consumer refers to main website, also The time for being the heartbeat that slave station should be able to be received in the parameter temporal for the slave station that main station side saves is 0, indicates that slave station does not have There is starting heartbeat mechanism, but use node and guard mechanism, then main website then requests a node monitoring request, waits slave station It replys, if not having received over time to arrive reply, also just obtains the state of slave station, terminate to check later.
If consumer's heartbeat parameter non-zero, indicate to use heartbeat mechanism, heartbeat mechanism is the passive slave station active of main website, institute Only to need to wait heartbeat packet, terminate to check as long as receiving heartbeat packet, has on the contrary been more than the heart that consumer saves Time namely time-out is jumped, terminates to check and recording the mistake with an error identification.
Figure 18 is please referred to, a part that error control service belongs in slave station starting is started, the inspection of front enlivens type Also heartbeat and node monitoring mechanism are used when slave station, have had been started up the heart at this time in practice for the slave station of general type It jumps or node guards mechanism, because being configured with slave station when the inspection configuration of front, once it is configured with the heart of slave station Parameter is jumped, slave station has just been activated heartbeat mechanism.
This part mainly detects whether slave station is configured successfully, if being configured success, heartbeat packet or Life Cycle Otherwise the phase mechanism heartbeat packet that has been activated or can receive sends life cycle monitoring message and can be in the parameter of setting Between interval in can obtain reply confirmation, otherwise slave station and inactive success.
The step of realization of front process is established on the mechanism of event and state machine, and state is then process, and event Then determine multiple and different situation processing.
It mainly includes following steps that slave station, which starts implementation method:
Step 1. checks device type, producer's mark, product coding, version number, sequence number;
Step 2. automatically configures heartbeat consumer (only enlivening just executing for type);
Step 3. checks the state (only enlivening just executing for type) of live-vertex;
The configuration management of the step 4. starting node;
Step 5. automatically configures heartbeat and life cycle (referring to the producer);
Step 6. starts slave node life cycle;
Step 7. stops slave node life cycle;
Step 8. starts error control;
Error handle after step 9..
Please refer to Figure 19, in step 1: in the initial state, slave station is in idle condition, when etc. event to be launched in master After state machine of standing is activated during controlling, slave station enters waiting starting state.If not additional thing in this state Part is activated, then entering request device model state after waiting for a period of time.When initially entering some state, The change of state exactly has occurred, trigger event can be activated, and start a SDO request, request the device model of slave station.When from Stand reply after, in the readjustment of message activate SDO transmission success event, check the result and main station side of request configuration whether one It causes.If the configuration non-zero of main station side, end state is jumped to if inconsistent, while having recorded error reason, if unanimously Request producer's identification-state is then jumped to, requests the producer of slave station to identify, executes inspection according to previous state transition.
Therefore, device type, the producer's mark, product coding, version number, sequence number of slave station, and and main website are once checked The configuration of preservation is made comparisons, if unanimously will continue to next inspection, if occur in the middle any one it is inconsistent if all tie Beam and misregistration reason.
Please refer to Figure 20, in step 3: when check out the device type of slave station, producer's mark, product coding, version number, After sequence number, if the parameter of all correct or main website preservation is 0 expression without checking, it can all jump to and automatically configure heartbeat Consumer's state.
Since generating state changes, so trigger event is activated, automatically configure heartbeat consumer and inspection state be for Processing enlivens the slave station of type.Main website is not allowed to reset it if the slave station for enlivening type is in run mode, main website There is no the slave stations for resetting and starting the type at the time of initialization.Enlivening for run mode has been in if there is such The slave station of type will configure the heartbeat consumer parameters of main station side after main website starting, which is the heartbeat of main station judging slave station Message whether a kind of Chao Shi measurement.Since main website resets, and main website needs to reset the parameter as consumer, works as touching After hair event is activated, though the slave station or the slave station if it is inactive type are to enliven type to be just reset this Configuration heartbeat consumer is not needed in the case of two kinds then and checks slave station state, if it is enlivening type slave station and be not reset, Then activate the configuration heartbeat custom events of AutoHb module.
After the configuration heartbeat custom events of AutoHb module are activated, it can cause and automatically configure heartbeat consumer.
AutoHb module can activate SDO success events after configuration successful, can jump to inspection state.
Under inspection state, the inspection for enlivening type is equally carried out and whether has just resetted, so only processing enlivens class The slave station of the type and slave station was not reset waits the heartbeat packet of the slave station, if having waited until the heart in this case Packet is jumped, then a heartbeat receives event and is activated, and main website can obtain the state of the slave station from heartbeat packet at this time, if the work The slave station of jump type is in run mode and then jumps to error control state, otherwise resets the slave station and enters waiting starting state, weight One-shot process newly is executed to the slave station.
If being not received by heartbeat, main website checks whether heartbeat consumer has been provided with, if be provided with The slow heartbeat packet for not receiving the slave station has occurred again and then jumps to end state, terminates the Booting sequence of the slave station and records mistake Accidentally reason.
If heartbeat consumer is not set, main website guards mechanism by node and obtains slave station state, and main website is actively sent out One node guards message, receives after slave station is replied and obtains slave station state, jumps to error control if the slave station is in run mode State, on the contrary it resets and one-shot process is restarted to the slave station, if slave station, which is not replied, can terminate start-up course simultaneously Misregistration mark.
Figure 21 is please referred to, in step 7: either enlivening type or inactive type slave station, can all jump to match later Manager state is set, the configuration node event under trigger event is to be not belonging to start using the configuration task actively initiated Link in journey, is consequently belonging to special duty, which will start configuration manager configuration node, the portion of configuration manager Belong to CfgMa module, which can remove the object dictionary of configuration slave station according to the content in device file, if configuration successful End state can be then jumped to, because being not belonging to Booting sequence directly terminating, if can jump to automatic without configuration file Configure heartbeat and life cycle state.
Here configuration data or configuration file refers to device description file, contains and needs to configure in device description file Object dictionary information, such as index the information such as subindex and data, it is corresponding right that slave station can be configured according to these information As configuration process is to be realized by traversing this document by SDO transmission.
The a part for belonging to Booting sequence if not additional task, should belong to configuration manager under trigger event State is if configuration successful can jump to error control state and continue Booting sequence, if not configuring number with front difference Heartbeat and life cycle state are automatically configured according to equally can also jump to.
Namely if leaping to error control state by configuration manager configuration successful, not needing to be reconfigured Heartbeat and life cycle related object.
It needs to go by another mode to configure heartbeat and the relevant object of life cycle if had failed, so can jump To automatically configuring heartbeat and life cycle state.Under trigger event in this state, matching automatically for AutoHb module can be activated Set event.
The event can cause AutoHb module and automatically configure heartbeat and life cycle.If configuration successful AutoHb module meeting Error control is jumped to if activating SDO success events, end state is jumped to if belonging to special duty, otherwise belong to start-up course State continues the Booting sequence of next step.
It starts or stops life cycle and belongs to special duty, this task and AutoHb module are relevant, and effect is that choosing It selects heartbeat mechanism or life cycle monitoring mechanism controls the mistake of slave station.
Figure 22 is please referred to, in step 9, in error control state, main function is to check whether slave station is in dead connection. Slave station vacation connects in order to prevent, and there are two types of mechanism, and one is heartbeat mechanism, slave station sends out heartbeat packet to main website at regular intervals. Here there are two intervals, one to be slave station send out heartbeat packet according to the time that the heartbeat parameter of slave station indicates, this belongs to heartbeat and gives birth to The heart time parameter of production person.Another is the heart time parameter for each slave station that main station side saves, this parameter is main Stand judge slave station heartbeat packet whether Chao Shi parameter, the heartbeat parameter in main station side belongs to heartbeat consumer parameters.Heartbeat Consumer parameters are greater than the time parameter of the heartbeat producer, because the reception and processing of message need the time, there are certain to prolong Late.
If having received heartbeat packet in error control state, (heartbeat receives event quilt in the readjustment that heartbeat packet receives Activation), it indicates that connection is normal, jumps to end state.If being not received by heartbeat packet, heartbeat consumer parameters are checked, if It is that zero expression does not use heartbeat mechanism, but life is used to guard mechanism, main website configures NMTM list item, NMTM poll institute at this time There is list item, sends life monitoring message and give the slave station, slave station replys life and guards message, and a possible message is overtime or long-term super When (such case be without reply situation) error handle can be caused, error handle is different from error control here, error handle It is a readjustment, slave station is resetted in error handle and jumps to waiting starting state.
Terminating state, idle state, and the knot in advance to slave station during startup are jumped in release dynamics SDO connection The error identification of beam start-up course is handled, and waiting starting state is resetted and jump to if slave station is without replying, if slave station Starting is correct, then text of remotely transmitting messages allows the slave station to enter operating status, once slave station enters run mode.The synchronization of PDO data is just opened Begin, if it is other mistakes, then manager enters abort state.
Figure 23 is please referred to, AutoHb module is next introduced.
AutoHb module mainly realizes the multiple SDO transmission control of configuration process, and AutoHb module is mainly slave station starting What heartbeat or life cycle configuration in the process serviced.
AutoHb is in idle condition at the beginning, activates the event of an AutoHb, causes a state transition, and main point For four kinds of events:
A) heartbeat custom events are configured
In slave station start-up course, if slave station, which belongs to, enlivens type, configuration heartbeat consumer can be executed, when having activated this Event jumps to request heart beat status, causes a SDO transmission, waiting request heart beat status is jumped to, if requested successfully, if the heart Jumping producer's pulse rate is zero, then returns to idle state, heartbeat consumer heartbeat parameter is otherwise obtained, if heartbeat consumer is not Zero is compared size and notifies to apply, if zero is arranged the pulse rate that heartbeat consumer corresponds to the station.
Namely just configuration heartbeat consumer if necessary, if the heartbeat producer is not zero and heartbeat consumer The case where being zero, is just necessary.
B) event is automatically configured
The event can be activated when automatically configuring heartbeat and life cycle state, jump to request heart beat status and carried out primary SDO transmission.Waiting request heart beat status is jumped to, request monitoring periodic state is jumped to if being zero if heartbeat producer's parameter, SDO is passed After defeated in the case where waiting request life cycle state, terminate if slave station life cycle non-zero, otherwise need to continue to configure, checks the heart Consumer's heartbeat parameter and local life parameter are jumped, if heartbeat consumer parameters non-zero or local life cycle are zero, and Heartbeat producer heartbeat parameter is zero this moment, then jumps to setting heart beat status, otherwise jumps to setting life cycle state.
Automatically configuring heartbeat and life cycle only allows to configure one of them, one of them is configuration heartbeat, the other is Configure life cycle.
There are the producers and consumer for heartbeat.
The producer is slave station, and consumer is main website.There are heartbeat parameter and life parameter, slave stations for main station side There are heartbeat parameter and life parameters.When automatically configuring, if slave station heartbeat non-zero indicate slave station by Heartbeat mechanism is configured to not need to be reconfigured.
If slave station heartbeat is that zero i.e. slave station heartbeat is not configured, check whether the life cycle of slave station is configured for. If the life cycle non-zero expression of slave station is configured for, also terminate automatic configuration process, because this indicates that slave station uses Be life cycle mechanism.
When the heartbeat of slave station and life cycle are simultaneously zero, that is, slave station does not select the dead connection of which kind of detection Mode, need main website to go to be configured at this time, select which kind of mode according to the heartbeat of main station side and life parameter to determine.
There are four kinds of situations for the parameter of main station side at this time:
Heartbeat is zero and life cycle is zero;
Heartbeat non-zero and life cycle are zero;
Heartbeat non-zero and life cycle non-zero;
Heartbeat is zero and life cycle non-zero.
The heartbeat of first three situation meeting option and installment slave station, the life cycle of the 4th kind of situation configuration slave station.
Although the heartbeat of the first situation main website is zero, (heartbeat of main website refers to the maximum for the correspondence slave station that main station side saves The heartbeat timeout time), but can be gone that it is arranged with default value.
So setting heart beat status is then jumped in setting heartbeat, setting life cycle then jumps to setting life cycle state.? Heart beat status is set, with the heartbeat of the heartbeat parameter setting slave station of the correspondence slave station of main station side, if the heartbeat of main station side is zero Default value is then used, set-up mode is the heart beat status to be placed such as to jump to later by SDO transmission form.
In the end for waiting heart beat status to be placed to wait SDO transmission process, activation SDO is transmitted event, jumps to the free time State simultaneously notifies slave station starting state machine, by activating the SDO of slave station starting state machine to complete event, so far automatically configures knot Beam.
If what front selected is setting life cycle, same life cycle with SDO transmission mode setting slave station and Two parameters of the life cycle factor, life cycle is to judge the interval of the monitoring message of certain connection of living of slave station, if at this Reply expression information drop-out is not received every interior, and the life cycle factor refers in the life cycle of how many times without message time It is multiple, then it represents that slave station is lost.Slave station starting state machine is notified after completing life cycle and the setting of the life cycle factor and is terminated.
C) start life cycle events
The event is then two parameters of life cycle and the life cycle factor that slave station is arranged, and precondition is that slave station is not Under heartbeat mechanism, that is, the heartbeat parameter of slave station is not set, once being provided with the life cycle of slave station, then starts Life cycle mechanism.
D) stop life cycle events
The event is using stopping life cycle mechanism, and precondition is that slave station is under life cycle mechanism, stops life As long as the life period then resets two parameters of life cycle and the life cycle factor of slave station, slave station enters node prison after clearing It protects under agreement.
In the present embodiment, overall management device need to carry out Control for Dependability.Control for Dependability mainly handles network communication Slave station loses problem, if a slave station is because certain reason causes communication disruption, main website is able to detect that the hair of this mistake It is raw.The treatment mechanism is realized by heartbeat mechanism and life cycle mechanism.
Control for Dependability includes the start-up course of slave station, and generally the start-up course of slave station can be from heartbeat mechanism and life It selects a mechanism that detection is gone to communicate to connect in cycle machinery, if connection is lost, error handle can be generated, and error handle root Addition after all nodes still reset all nodes or only reset individual node, which is off, according to the different selections of configuration starts stream Journey.
Starting firstly for an equipment includes two parts, and term starting both includes front slave station starting state machine institute The Booting sequence of description, the also inside comprising slave station oneself itself start several stages, the two parts are mutual.
Please continue to refer to Fig. 1, when slave station powers on, it can be connected to network up, which can execute local Initialization command, initialization command cause local initialization event respectively, reset node event, quasi- reset communication event, answer Bit walk event resets event and the quasi- run mode event of entrance after communication.Each event can cause the module of each protocol stack Event executes, and it is HBP and NMTS respectively that two modules are related to for Control for Dependability (for opposite slave station).It is resetted in standard For slave station using starting agreement, slave station, which sends out a starting message, under such an arrangement indicates initiate by its own to main website in communication event, Main website starts the Booting sequence of the slave station after receiving, process is as shown in Figure 2.Main website receives the starting message of slave station, opens Beginning starting processing, starts the node device, that is, be directly entered request without waiting and set if slave station is in network list Standby type state.
After slave station enters the reset communication of local event when event, slave station guards agreement using node, at this The configuration of main website, that is, main website is waited to automatically configure heartbeat and life cycle during starting slave station under agreement, because Which kind of mechanism slave station does not select as reliability mechanisms this moment.
After slave station starts successfully, slave station has selected one of them of heartbeat or life cycle, hereafter starts reliability control System.
Control for Dependability includes four parts:
1, heartbeat mechanism
Under heartbeat mechanism, slave station actively issues main website heartbeat packet, devises HBP module and HBC module.Main website includes HBC module and slave station include HBP module.
HBC table includes multiple list items, the corresponding COB of each list item, the heartbeat message of the responsible slave station of each list item. HBP module does not have module table, only one COB, although the COB of this COB and NMTS is shared.At the poll of HBP module The transmission of heartbeat is managed, it checks whether the interval of a preceding sending time and current time is greater than the heart time parameter set, If it is greater than then sending, and all items of the poll of HBC module processing poll HBC table, check last heartbeat receiving time with Whether current time occurs time-out, and error processing procedure above is entered if time-out.
2, life cycle mechanism
Under life cycle mechanism, main website actively issues slave station life monitoring message, and slave station, which replies to main website, indicates connection It is active.This partial function is included in NMT NMTM NMTS module.
Please continue to refer to Fig. 3, NMTM module includes a module table (NMTM table), and each list item corresponds to a slave station, It is exactly the relevant information that main station side needs to save each slave station, these information are used to carry out COB communication.
Please continue to refer to Fig. 4, each list item of NMTM corresponds to the single table entry structure in a slave station, that is, figure, should Structure includes the information of life parameter and slave station again, and for the COB argument structure of COB is arranged, the COB of setting includes COB is sent and received, for uniquely identifying this message between which NMTM list item of main website and which slave station Communication.
Slave station includes NMTS module, and NMTS module is without module table but having a COB, this COB is the heartbeat with front The corresponding COB of HBP module is the same COB because CAN ID be it is shared, timesharing use depend on slave station at that time used by It is heartbeat mechanism or life cycle mechanism.
Time transmission life monitoring message is guarded to slave station according to the life of NMTM list item in NMTM module polls, and from Message is replied in the reception readjustment for the NMTS module stood to main website, NMTM module polls enter mistake if discovery slave station replys time-out Accidentally in processing.
2, start chain and error handle
Slave station starting in slave station starting state machine is starting to single slave station, actually main website management it is multiple from Stand and start together, the starting speed of each slave station be it is uncontrolled, in addition some slave stations may start success, also some may Starting failure.
In order to handle the parallel starting of multiple slave stations and restarting for wrong slave station be devised a kind of starting chain and controlled System, multiple slave stations start according to node sequence at the beginning, start speed later with regard to uncontrolled, it is possible to second slave station elder generation Start successfully, it is also possible to which the last one slave station starts success at first.
It is as follows to start chain mode:
A) it is arranged all slave stations by node sequence, if there is slave station starts successfully, starts successful slave station from chain It removes, the slave station specially started below checks that front is successful with the presence or absence of starting.Starting is successfully then by oneself if it exists To Forward, after subsequent slave station successively carries out this operation, that is, some or certain several slave stations start successfully, subsequent slave station Forward is squeezed out successful slave station is started in turn, this is equivalent to the successful slave station of starting and is removed from chain.
B) start the slave station of failure if you do not need to being again started up, be also the quilt from chain with starting as successful slave station It removes.
C) slave station of starting failure is again started up if necessary, then the slave station to fail is moved to last-of-chain, actually in chain Tail adds the copy of the slave station, while by former part as the node for needing to remove, according to class when the end of polling(EOP) of chain Like starting success or failure slave station it is the same rejected from chain, this be equal to by fail slave station moves directly to last-of-chain.
So can reset again if slave station fails during startup and be again started up primary, starting is to allow at slave station In wait state, reset be not powered off it is similar restart, program does not rerun, and only slave station local event changes Become, reset refers to reset node or resets communication, because of the reset command that main website is sent by message, orders for remote reset It enables.
It is not to reset always but if the slave station starts always unsuccessful, this depends on configuration.If there is mistake always Words are configured to just not restart after manager is jumped out from configuration status here.That is in the start-up course of slave station In, second of starting of then progress can be first resetted after starting failure for the first time to be attempted.Manager jumps out configuration state later, so the If restarting still fails, the slave station can be resetted again, but is not introduced into the trial being again started up, but this Slave station is removed from starting chain.Namely just now described starting has failed do not need to be again started up in the case where by slave station from It is removed in starting list, is again started up if necessary, which is moved on into starting last-of-chain.
Please continue to refer to Fig. 5, when error handle occurs, this may be because that main website does not receive the heart of slave station slowly The life cycle monitoring message for jumping packet or main website cannot repeatedly reply, and carry out configurability according to the slave station type in this case Processing, if the slave station be must start up successful type, that is, the slave station represent distributed task scheduling do not allow the mould Block has of short duration mistake, then main website may stop whole network when detecting this kind of slave station mistake or reset all set It is standby, if the equipment is resetted after allowing mistake, the slave station will be resetted in error handle and enters the slave station Team is added in starting chain, because the slave station is removed from starting chain after starting successfully in start-up course at the beginning, It now disconnects in the process of running, then to rejoin in starting chain.
For heartbeat mechanism, the heartbeat packet loss of a slave station only can generate an error handle, will not be ceaselessly The multiple error handle of generation, if having restored and having generated loss, can be generated unless the heartbeat packet of the slave station is restored again New error handle.
For life cycle mechanism, if a slave station does not respond life cycle monitoring message, slave station is lost, An error handle can be generated, which also no longer executes the inspection of monitoring message, because the life cycle of the slave station no longer makes Can, so the transmission life cycle monitoring message of intermittent will not be continued.If it is desired to enabling life cycle monitoring again Mechanism needs to carry out the slave station new primary configuration, which just needs to carry out again it primary slave station start-up course.
When some slave station occur mistake when, if the slave station in network node list, according to the configuration of main website Decision is off all nodes and still resets all nodes or reset individual node, this is mainly for must start up successful types Slave station for, it is general individually to reset and restart from standing-meeting, restarting be add it to starting chain in And it is set to wait starting state.
In addition previously mentioned there are also the internal error occurred in two resume module protocol stack operational process of EMCP, EMCC Heartbeat or life cycle be communication connection, and internal error can then generate emergency, these internal errors be mainly COB, It is generated in PDO, NMT three parts operational process:
The internal error of COB is and drives relevant mistake, and when can not find, CAN controller is driven or driving condition is wrong When cause.The internal error of NMT includes the mistake in the event handling of all modules.The mistake of PDO is same in progress PDO Step sends PDO packet, PDO coding, PDO decoding and checks the mistake generated in the case of mapping object.
These mistakes can all cause the transmission of emergency, after the urgent producer generates emergency, urgent consumer The event of receiving is handled, main that application program is notified to allow using determining how to handle, and is in addition generated during startup Emergency can also enter in above-mentioned error processing procedure.
The above is merely preferred embodiments of the present invention, be not intended to limit the invention, it is all in spirit of the invention and Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within principle.

Claims (10)

1. a kind of CANopen master-salve station Control for Dependability method, the multiple equipment being applied in CAN bus, and one of them Equipment is main website, and other equipment are slave station;It is characterized in that, when the main website starts the slave station, described in the main website configuration The heartbeat or life cycle of slave station;
The Control for Dependability method includes:
So that the slave station is sent heartbeat packet to the main website, or so that the main website is sent life and guard message to the slave station;
All slave stations are arranged by node sequence and form starting chain;
It is removed from the starting chain and starts successful slave station or the slave station without being again started up, need to opened starting failure and again Dynamic slave station moves to the last-of-chain of the starting chain;
The heartbeat packet of slave station is not received by a preset time one in the main website or the main website sends life cycle When guarding message repeatedly and not receiving the reply of the slave station, carried out at corresponding mistake according to the type of the slave station Reason.
2. CANopen master-salve station Control for Dependability method as described in claim 1, which is characterized in that the main website includes one A heartbeat consumer module, each slave station include heartbeat producer's module;
One heartbeat consumer module includes the HBC table that multiple list items are arranged, the corresponding communication of each heartbeat producer module The list item of Object table;
The list item of the corresponding communication object table of one list item of the HBC table, and each list item of the HBC table is one corresponding The heartbeat message of slave station;
Each heartbeat producer module judges whether the time interval of a preceding sending time and current time is greater than one and presets Heart time, and when time interval is greater than the default heart time, heartbeat packet is sent to the main website;
All list items of each heartbeat consumer module poll HBC table judge that last heartbeat receiving time is with current time It is to carry out the error handle when no generation is more than a preset time two.
3. CANopen master-salve station Control for Dependability method as described in claim 1, which is characterized in that the main website includes one A NMTM module, the NMTM module contain a NMTM module table, and multiple NMTM list items are arranged in the NMTM module table, each NMTM list item corresponds to a slave station;
Wherein, two COB list items of the corresponding communication object table of each NMTM list item, and two of the communication object table The list item of one communication object table of the corresponding slave station of COB list item.
4. CANopen master-salve station Control for Dependability method as claimed in claim 3, which is characterized in that the slave station includes one A NMTS module, and the list item of the corresponding communication object table of the NMTS module;
The NMTM module is polled, and according to the life of NMTM list item guard the time send life guard message to it is described from It stands;The NMTS module receives readjustment, and replys message to main website;In the poll of the NMTM module, the NMTM module When waiting the slave station to reply more than a preset time three, the error handle is carried out.
5. CANopen master-salve station Control for Dependability method as described in claim 1, which is characterized in that
All slave stations are arranged by node sequence and the method for forming starting chain includes:
Successively start all slave stations, whether the slave station before the slave station inspection of subsequent starting starts success, and exist starting at It moves forward when the slave station of function.
6. CANopen master-salve station Control for Dependability method as described in claim 1, which is characterized in that by starting failure and need The method of last-of-chain that the slave station being again started up moves to the starting chain includes:
In a copy of the slave station that the last-of-chain increases starting failure and need to be again started up, and using former part as the section that need to be removed Point is removed when starting the end of polling(EOP) of chain.
7. CANopen master-salve station Control for Dependability method as described in claim 1, which is characterized in that the Control for Dependability Method further include:
The slave station is repeatedly started;
Wherein, after starting the slave station failure for the first time, the slave station is first resetted, then carry out second of starting, and second After secondary starting failure, the slave station is resetted again, removes the slave station of starting failure at least twice.
8. CANopen master-salve station Control for Dependability method as described in claim 1, which is characterized in that the method for error handle Include:
Judge whether node is located in control list;
When the node is located in the control list, determines whether to stop all nodes, is to stop all nodes, And terminate error handle, it otherwise determines whether to reset all nodes;
When the node is not located in the control list, terminate error handle;
When allowing to reset all nodes, all nodes are resetted;When not allowing to reset all nodes, individual node is first resetted, Restart the equipment of individual node, after terminate error handle.
9. CANopen master-salve station Control for Dependability method as described in claim 1, which is characterized in that sent in the slave station When heartbeat packet to the main website, the every reply for losing the primary heartbeat packet of the slave station carries out a corresponding error handle;
When the main website sends life monitoring message to the slave station, and life monitoring message of the every loss of the slave station It replys, carries out a corresponding error handle;After carrying out an error handle, the slave station is abandoned checking the life monitoring report Text.
10. a kind of overall management device is used to manage the multiple modules being arranged in the multiple equipment in CAN bus;Its feature exists In, when the overall management device manages multiple modules, CANopen principal and subordinate of the realization as described in any one of claim 1-9 It stands Control for Dependability method.
CN201811303119.0A 2018-11-02 2018-11-02 CANopen master-slave station reliability control method and overall management device thereof Active CN109245979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811303119.0A CN109245979B (en) 2018-11-02 2018-11-02 CANopen master-slave station reliability control method and overall management device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811303119.0A CN109245979B (en) 2018-11-02 2018-11-02 CANopen master-slave station reliability control method and overall management device thereof

Publications (2)

Publication Number Publication Date
CN109245979A true CN109245979A (en) 2019-01-18
CN109245979B CN109245979B (en) 2021-07-27

Family

ID=65076733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811303119.0A Active CN109245979B (en) 2018-11-02 2018-11-02 CANopen master-slave station reliability control method and overall management device thereof

Country Status (1)

Country Link
CN (1) CN109245979B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383457A (en) * 2020-09-23 2021-02-19 卡斯柯信号有限公司 Safety slave station system based on CANopen protocol
EP4120636A1 (en) * 2021-07-16 2023-01-18 Schneider Electric Industries SAS Communication method, communication device and communication system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201335955Y (en) * 2009-01-16 2009-10-28 深圳市浚海仪表设备有限公司 CAN bus intelligent electric device based on CANopen protocol
CN101626333A (en) * 2009-08-07 2010-01-13 北京和利时电机技术有限公司 Controller area network (CAN) bus system and application layer communication method in same
CN101854300A (en) * 2010-06-02 2010-10-06 北京工业大学 Method for realizing CANopen slave station
CN103188122A (en) * 2013-03-19 2013-07-03 深圳市汇川控制技术有限公司 Communication system and communication method based on CAN (Controller Area Network)
US9201744B2 (en) * 2013-12-02 2015-12-01 Qbase, LLC Fault tolerant architecture for distributed computing systems
CN106330531A (en) * 2016-08-15 2017-01-11 东软集团股份有限公司 Node fault recording and processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201335955Y (en) * 2009-01-16 2009-10-28 深圳市浚海仪表设备有限公司 CAN bus intelligent electric device based on CANopen protocol
CN101626333A (en) * 2009-08-07 2010-01-13 北京和利时电机技术有限公司 Controller area network (CAN) bus system and application layer communication method in same
CN101854300A (en) * 2010-06-02 2010-10-06 北京工业大学 Method for realizing CANopen slave station
CN103188122A (en) * 2013-03-19 2013-07-03 深圳市汇川控制技术有限公司 Communication system and communication method based on CAN (Controller Area Network)
US9201744B2 (en) * 2013-12-02 2015-12-01 Qbase, LLC Fault tolerant architecture for distributed computing systems
CN106330531A (en) * 2016-08-15 2017-01-11 东软集团股份有限公司 Node fault recording and processing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383457A (en) * 2020-09-23 2021-02-19 卡斯柯信号有限公司 Safety slave station system based on CANopen protocol
CN112383457B (en) * 2020-09-23 2022-01-28 卡斯柯信号有限公司 Safety slave station system based on CANopen protocol
EP4120636A1 (en) * 2021-07-16 2023-01-18 Schneider Electric Industries SAS Communication method, communication device and communication system
AU2022205145B2 (en) * 2021-07-16 2023-07-27 Schneider Electric Industries Sas Communication method, communication device and communication system

Also Published As

Publication number Publication date
CN109245979B (en) 2021-07-27

Similar Documents

Publication Publication Date Title
JP7362650B2 (en) Task processing methods, devices and systems
EP3386170B1 (en) Fault processing method, device and system
US8700760B2 (en) Method and systems for redundant server automatic failover
WO2016106682A1 (en) Post-cluster brain split quorum processing method and quorum storage device and system
CN103944814B (en) A kind of method for interchanging data and system and a kind of gateway server
CN103414916B (en) Fault diagnosis system and method
CN101980171B (en) Failure self-recovery method for software system and software watchdog system used by same
CN101777020A (en) Fault tolerance method and system used for distributed program
CN106411655B (en) Communication processing method based on the diagnosis of serial communication equipment state
WO2015184866A1 (en) Monitoring method and device, and first monitoring unit in power source system
CN104601668B (en) Data push method, device and system based on condition managing
CN109245966A (en) The monitoring method and device of the service state of cloud platform
CN109245979A (en) A kind of CANopen master-salve station Control for Dependability method and its overall management device
CN110417913A (en) A kind of asynchronous creation method of Cloud Server based on Rabbit MQ
CN109450757A (en) A kind of the starting method and its overall management device of CANopen main website
CN112887176B (en) Computer interlocking subsystem master-slave switching system based on heartbeat message
JP5558279B2 (en) MONITORING / CONTROL SYSTEM, MONITORING / CONTROL DEVICE USED FOR SAME, AND MONITORING / CONTROL METHOD
CN109257396A (en) A kind of distributed lock dispatching method and device
CN107395768B (en) Double-machine self-adaptive load balancing method for file secure transmission
CN105871633A (en) Application control method, device and system
US20160285673A1 (en) Client side host machine backup system and its implementing method
CN106445852B (en) A kind of task communicator and method based on from monitoring framework
CN112835748A (en) Multi-center redundancy arbitration method and system based on scada system
CN109361586A (en) A kind of the starting method and its overall management device of CANopen slave station
JPH0944376A (en) Process state management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant