Specific embodiment
It should be appreciated that specific embodiment described herein is not intended to limit the present invention only to explain the present invention.
The present invention provides a kind of communication means based on CAN protocol.
With reference to Fig. 1, Fig. 1 is the schematic flow sheet of the communication means first embodiment based on CAN protocol.
In the present embodiment, the communication means following steps:
Step S10, the first chip is by CAN protocol to the second chip continuous transmission communication data;
In the present embodiment, the communication data in CAN protocol at least includes state class data, stores core in state class data
The status information at piece a certain moment, is recognized that shape of the correspondence chip at the moment according to the state class data at a certain moment
State.Welding system is applied to based on the communication means of CAN communication protocol, the welding system include controller, CAN,
Execution equipment, execution equipment include inverter, wire feeding device, special welding machine, welding robot etc..Control device in system
Connected by CAN with the equipment of execution, communication media adopts twisted-pair feeder, naturally it is also possible to fine using coaxial cable or photoconduction
Dimension.Communicated using CAN, only 2 lines are communicated with the outside, communicate compared with traditional parallel communicationss, simplify circuit
Connection, reduces equipment cost, is conducive to the extension and upgrading of system.
Chip in each execution equipment upon actuation, can be constantly passed to the chip of miscellaneous equipment automatically by CAN protocol
Defeated communication data, at least includes state class data in the communication data of transmission.First character in state class data is saved in right
Data type is identified, and correspondence chip status information at a time is record in state class data.Specifically, the first core
By CAN protocol to the second chip continuous transmission communication data, the communication data includes record the second chip status letter piece
The state class data of breath.
Step S20, if second chip at least receives once the first chip transmission in the first Preset Time
Communication data, then second chip determine institute according to the current state class data of the first chip in the communication data for receiving
State the state of the first chip;
In the present embodiment, each chip can be also received while communication data is transmitted to other chips by CAN protocol
Other chips are transferred to communication data by CAN protocol.System will arrange the first Preset Time, normal when transmitting between each chip
When, each chip can receive the communication data of other each chip transmission in the first Preset Time.If each chip exists
The communication data of a certain chip transmission is received in first Preset Time at least, you can the communication number is determined according to the communication data
According to corresponding transmission chip state at a time.Specifically, if the second chip is at least received in the first Preset Time
The communication data of the first chip transmission, then will parse to communication data, obtain the status information of the first chip, and according to this
Status information determines the first chip state at a time.
Step S30, if second chip does not receive the communication data in the first Preset Time, described second
Chip determines transmission abnormality between first chip and the second chip.
In the present embodiment, if a certain chip does not receive the communication data of another chip transmission in the first Preset Time,
Transmission abnormality between two chips is illustrated then.Specifically, if the second chip does not receive the first chip in the first Preset Time
The communication data of transmission, then the second chip determine transmission abnormality between the first chip and the second chip.
In the present embodiment, system is communicated by CAN protocol, and only 2 lines are communicated with the outside, and simplify system line
Connection, and communication media adopts twisted-pair feeder, reduces equipment cost;Data are transmitted in the way of persistently sending, and are reduced
The adverse effect that factor data is lost and brought, improves the stability and capacity of resisting disturbance of system;Mutually enter between each chip
Row state class data transfer strengthens the monitoring capacity of system to determine mutual state;If a core in the first Preset Time
Piece does not receive the status data of another chip transmission, it is determined that transmission abnormality between two chips each other, is conducive to user timely
It was found that the failure problems of system being overhauled, the safety of system is improve.
With reference to Fig. 2, Fig. 2 is schematic flow sheet of the present invention based on the communication means second embodiment of CAN protocol.
It is based on the embodiment described in above-mentioned Fig. 1, before step S10, further comprising the steps of:
Step S40, when the first chip and the second chip start, controller by CAN protocol to first chip and
Second chip transmission start sense command data;
In the present embodiment, the communication data in CAN protocol also includes order class data, and order class packet contains:Order class
Class is identified, and order entity, wherein command parameter, command parameter can be default, and the first character of order class data is saved in data
Type be identified.Each chip is receiving order class data all by execution corresponding order.Wherein order class data include
Start sense command data.On startup, controller will be to each chip transmission start sense command data for each chip.Specifically,
When the first chip and the second chip start, controller is detected to the first chip and the second chip transmission start by CAN protocol
Order data.
Step S50, first chip and the second chip receive it is described startup sense command data when, according to described
Starting sense command data carries out startup detection, and is given birth to after CAN protocol starts detection to the controller constant feedback
Into the first starting state data and the second starting state data.
In the present embodiment, each chip is started to own situation respectively when startup sense command data are received
Detection, and corresponding startup detection status data is generated according to testing result.When detection data generation is started, each chip will be logical
Cross CAN protocol and start detection status data to controller constant feedback is respective.Specifically, the first chip will be received on startup
To sense command data are started, the first chip will carry out startup detection to itself according to sense command data are started, will after detection
The corresponding first starting state data of first chip are generated according to testing result, in the first starting state data, the first core is record
Status information when piece starts;In the first starting state data genaration, the first chip will be continued to controller by CAN protocol
The first starting state data are fed back, the state during startup of the first chip is determined for controller according to the first starting state data.Class
As, the second chip will also receive startup sense command data on startup, and the second chip will be according to startup sense command number
Startup detection is carried out according to itself, will be according to the corresponding second starting state data of detection the second chip of structural generation after detection;
In the second starting state data genaration, the second chip will be by CAN protocol to controller constant feedback the second starting state number
According to, for controller according to the second starting state data determine the second chip start when state.If controller is when second is default
It is interior at least to receive a first starting state data, second starting state is at least received in the second Preset Time
Data, then into step S60;If controller does not at least receive the first starting state data and second in the second Preset Time
One in starting state data, then into step S90.
Step S60, if the controller at least respectively receives once first starting state in the second Preset Time
Data and a second starting state data, then the controller is respectively according to the first starting state data and the second startup
Status data judges the state of first chip and the second chip;
In the present embodiment, system will arrange the second Preset Time, when transmitting normal between controller and each chip, control
Device processed at least can respectively receive once the state class number of each chip feedback in the second Preset Time for sending order class data
According to, and correspondence chip state at a time is determined according to the state class data of each chip feedback.Specifically, controller to
After first chip transmission start sense command data, if the first chip feedback is at least received in the second Preset Time
First starting state data, then obtain the status information of the first chip, and believed according to the state according to the first starting state data
Breath judges whether the first chip is run on startup normal.Similar, in controller to the second chip transmission start sense command
After data, if the second starting state data of the second chip feedback, basis are at least received in the second Preset Time
Second starting state data obtain the status information of the second chip, and judge that the second chip is transported on startup according to the status information
Whether row is normal.If now controller determines each chip all normal operations, into step S70;If controller is determined respectively
At least one chip operation exception in chip, then into step S80.
Step S70, if the controller determines first chip and the second chip all normal operations, the control
Device determines that first chip and the second chip start to be completed;
In the present embodiment, just all run if controller determines each chip according to the starting state data that each chip feeds back
Often, then system start-up is completed.Specifically, if controller determines first according to the first starting state data that the first chip feeds back
Normal operation when chip starts, determines when the second chip starts according to the second starting state data of the second chip feedback and also transports
Row is normal, then system start-up is completed.
Step S80, if the controller determines the first chip and/or the second chip operation exception, the controller
Into alarm condition;
In the present embodiment, if controller is determined in each chip at least according to the starting state data that each chip feeds back
One chip operation exception, then system enter alarm condition.Specifically, if controller is determined according to the first starting state data
Operation exception when first chip starts, or the startup of the second chip is determined according to the second starting state data of the second chip feedback
When operation exception, then system enter alarm condition, and stop current operation, display alarm information;If controller is determined certainly
First chip and the second chip all operation exceptions, then system also enter alarm condition, and stop current operation, display alarm letter
Breath.
Step S90, if the controller do not receive in the second Preset Time the first starting state data and/or
Second starting state data, then the controller determine transmission abnormality between the controller and/or the second chip, and enter report
Alert state.
In the present embodiment, if not receive a certain chip anti-in the second Preset Time of transmission order class data for controller
The state class data of feedback, then to determine that transmission between controller and the chip occurs abnormal for controller, and enters alarm condition.Tool
Body, controller after to the first chip and the second chip transmission start sense command data, if in the second Preset Time not
Receive the first starting state data of the first chip feedback, it is determined that the transmission between controller and the first chip occurs different
Often, system into alarm condition, and will stop current operation, show abnormal information;It is similar, if in the second Preset Time not
Receive the second starting state data of the second chip feedback, it is determined that the transmission between controller and the second chip occurs different
Often, system also into alarm condition, and will stop current operation, show abnormal information.
In the present embodiment, when each chip starts, controller will transmit sense command data to start each chip
Detection, only when each chip starts during all normal operations, system just completes to start.Otherwise, as long as there is a chip starting
When operation exception, system all into alarm condition, and will show abnormal information, improve the safety of system.
With reference to Fig. 3, Fig. 3 is schematic flow sheet of the present invention based on the communication means second embodiment of CAN protocol.
It is based on the embodiment described in above-mentioned Fig. 2, after step S70, further comprising the steps of:
Step S100, controller transmit files classes data to the first chip and the second chip by CAN protocol;
In the present embodiment, the communication data in CAN protocol also includes files classes data, and files classes packet contains:Files classes
Mark, one group of manual data, 16 bond pads technological parameters, a check code.The first character of files classes data is saved in logarithm
According to type be identified.The various welding conditions tested can be saved as data APMB package by welding procedure teacher, often
Individual files classes packet is preserved in a hard disk with text.When the startup of each chip is completed, files classes data are sent out by controller
To each chip, will be configured and verify according to the parameter in files classes data for each chip.Specifically, in the first chip and
When the startup of two chips is completed, controller transmits files classes data to the first chip and the second chip by CAN protocol.
Step S110, first chip and the second chip when the files classes data are received, according to the file
Class data carry out parameter verification, and the first school generated to after the controller constant feedback parameter verification by CAN protocol
Test status data and the second verification status data.
In the present embodiment, each chip will enter line parameter respectively according to files classes data and set when files classes data are received
Put and verify, and corresponding verification status data is generated according to assay.When verification data is generated, each chip will pass through
CAN protocol is to the respective verification status data of controller constant feedback.Specifically, the first chip will receive file on startup
Class data, the first chip will will be generated according to check results after verification according to files classes data to carrying out parameter setting and verification
The corresponding first verification status data of first chip, records the state letter of the first chip verification in the first verification status data
Breath;When the first verification status data is generated, the first chip will verify state to controller constant feedback first by CAN protocol
Data, determine the state after the verification of the first chip for controller according to the first starting state data.Similar, the second chip is being opened
Files classes data will be also received when dynamic, the second chip will carry out parameter setting and verification according to files classes data, will after verification
The corresponding second verification status data of the second chip is generated according to check results;When the second verification status data is generated, second
Chip will verify status data to controller constant feedback second by CAN protocol, for controller according to the second verification status number
According to the state determined after the verification of the second chip.If controller at least receives a first verification state in the second Preset Time
Data, at least receive one time second verification status data, then in the second Preset Time into step S120;If controller exists
One in the first verification status data and the second verification status data is not at least received in second Preset Time, then enters step
Rapid S150.
Step S120, if the controller at least respectively receives once the first verification state in the second Preset Time
With one time second verification status data, then the controller is respectively according to the described first verification status data and the second verification state
Data judge the state of first chip and the second chip;
In the present embodiment, when transmitting normal between controller and each chip, controller is sending files classes data
The state class data of each chip feedback can be respectively received once in second Preset Time at least, and according to the shape of each chip feedback
State class data determine correspondence chip state at a time.Specifically, files classes data are transmitted to the first chip in controller
Afterwards, if the first verification status data of the first chip feedback is at least received in the second Preset Time, according to first
Verification status data obtains the status information of the first chip, and judges the fortune after the verification of the first chip parameter according to the status information
Whether row is normal.Similar, in controller to after the second chip transmission files classes data, if at least connecing in the second Preset Time
The second verification status data of the second chip feedback is received, then the shape of the second chip is obtained according to the second verification status data
State information, and judge whether the operation after the verification of the second chip parameter is normal according to the status information.If now controller judges
To each chip all normal operations, then into step S130;If at least one chip operation is different during controller determines each chip
Often, then into step S140.
Step S130, if the controller determines first chip and the second chip all normal operations, the control
Device processed enters holding state;
In the present embodiment, just all run if controller determines each chip according to the verification status data that each chip feeds back
Often, then system start-up is completed.Specifically, if controller verifies status data according to the first chip feeds back first determines first
Normal operation after chip parameter verification, determines the second chip parameter school according to the second verification status data of the second chip feedback
Also normal operation after testing, then system enter holding state.
Step S140, if the controller determines first chip and/or the second chip operation exception, the control
Device processed enters alarm condition;
In the present embodiment, if controller is determined in each chip at least according to the verification status data that each chip feeds back
One chip operation exception, then system enter alarm condition.Specifically, if controller is determined according to the first verification status data
Operation exception after the verification of first chip parameter, or controller determines the according to the second verification status data that the second chip feed back
Operation exception after the verification of two chip parameters, then system enter alarm condition, and stop current operation, display alarm information;Certainly
If controller determines the first chip and the second chip all operation exceptions, system also enters alarm condition, and stops current behaviour
Make, display alarm information.
Step S150, if the controller do not receive in the second Preset Time it is described first verification status data and/
Or second verification status data, then the controller determine between the controller and the first chip and/or the second chip transmit
It is abnormal, and enter alarm condition;
In the present embodiment, if not receive a certain chip anti-in the second Preset Time of transmission files classes data for controller
The state class data of feedback, then to determine that transmission between controller and the chip occurs abnormal for controller, and enters alarm condition.Tool
Body, controller to the first chip and the second chip transmission files classes data after, if not receiving in the second Preset Time
First verification status data of the first chip feedback, it is determined that abnormal, system occurs in the transmission between controller and the first chip
Into alarm condition, and current operation will be stopped, showing abnormal information;Similar, if not receiving in the second Preset Time
Second verification status data of the second chip feedback, it is determined that abnormal, system occurs in the transmission between controller and the second chip
Also into alarm condition, and current operation will be stopped, showing abnormal information.
In the present embodiment, when each chip startup is completed, controller will transmit files classes data to join each chip
Number is arranged and is verified, and only when all normal operations after the verification of each chip parameter, system just enters holding state.Otherwise, as long as
There is operation exception after a chip parameter verification, system all into alarm condition, and will show abnormal information.By opening in chip
Parameter setting and verification are carried out after the completion of dynamic, it is to avoid the parameter of chip does not meet the situation of job requirement;Set in chip parameter
The state for determining chip is put and verified, can find that chip, because being provided with the parameter of mistake and the situation of operation exception, is improved in time
The safety of system.
With reference to Fig. 4, Fig. 4 is schematic flow sheet of the present invention based on the communication means second embodiment of CAN protocol.
Based on the embodiment described in above-mentioned Fig. 1, the communication means is further comprising the steps of:
Step S160, controller transmit call instruction data to first chip and the second chip by CAN protocol;
In the present embodiment, the communication data in CAN protocol also includes order class data, the first character section of order class data
For being identified to the type of data.Each chip is receiving order class data all by execution corresponding order.Wherein order
Class data include call instruction data, and call instruction data include the obj ect file title called and address information.Controller
Call instruction data can be transmitted to each chip.Specifically, controller is opened to the first chip and the transmission of the second chip by CAN protocol
Dynamic sense command data.
Step S170, first chip and the second chip when the call instruction data are received, according to the tune
In internal memory, one group of parameter is called to be configured with order data, and by CAN protocol to the controller constant feedback parameter
The the first setting status data generated after setting and second arranges status data;
In the present embodiment, when call instruction data are received, the first chip will be according to call instruction data for the first chip
Obj ect file is called in internal memory parameter setting is carried out according to obj ect file, and the first chip pair will be generated after the completion of parameter setting
The the first setting status data answered, records the status information that the first chip is provided with the first setting status data;
When one setting status data is generated, the first chip will arrange status data to controller constant feedback first by CAN protocol, supply
Controller determines the state after the setting of the first chip parameter according to the first starting state data.Similar, the second chip is starting
When will also receive call instruction data, the second chip will call obj ect file with basis according to call instruction data in internal memory
Obj ect file carries out parameter setting, will generate the second chip corresponding second and arrange status data after the completion of parameter setting;
When two setting status datas are generated, the second chip will arrange status data to controller constant feedback second by CAN protocol, supply
Controller determines the state after the setting of the second chip parameter according to the second setting status data.If controller is in the second Preset Time
One time first setting status data is inside at least received, one time second setting status number is at least received in the second Preset Time
According to then into step S180;If controller does not at least receive the first starting state data and second in the second Preset Time
One in starting state data, then into step S210.
Step S180, if the controller at least respectively receives once the first setting state in the second Preset Time
Data and one time second setting status data, then the controller is respectively according to the described first setting status data and the second setting
The state of the first chip and the second chip described in condition adjudgement;
In the present embodiment, in controller to after the first chip transmission call instruction data, if in the second Preset Time
The first setting status data of the first chip feedback is at least received, then the first core is obtained according to the first setting status data
The status information of piece, and judge whether the first chip is run after parameter setting normal according to the status information.Similar, in control
Device processed is to after the second chip transmission call instruction data, if the second chip feedback is at least received in the second Preset Time
The second setting status data, then the status information of the second chip is obtained according to the second setting status data, and according to the state
Information judges whether the second chip is run after parameter setting normal.If now controller determines each chip all normal operations,
Step S190 is entered then;If controller determines at least one chip operation exception in each chip, into step S200.
Step S190, if the controller determines first chip and the second chip all normal operations, the control
Device determination processed is called and is completed;
In the present embodiment, if controller arranges status data according to the first chip feeds back first determines the first chip
Normal operation after parameter setting, determines after the setting of the second chip parameter according to the second setting status data of the second chip feedback
Also normal operation, then system complete call.
Step S200, if the controller determines first chip and/or the second chip operation exception, the control
Device processed enters alarm condition;
In the present embodiment, if controller is determined in each chip at least according to the setting status data that each chip feeds back
One chip operation exception, then system enter alarm condition.Specifically, if controller is determined according to the first setting status data
Operation exception after the setting of first chip parameter, or the second chip is determined according to the second setting status data of the second chip feedback
Operation exception after parameter setting, then system enter alarm condition, and stop current operation, display alarm information;If controlling certainly
Device determines the first chip and the second chip all operation exceptions, then system also enters alarm condition, and stops current operation, shows
Warning message.
Step S210, if the controller do not receive in the second Preset Time it is described first arrange status data and/
Or second arrange status data, then the controller determine between the controller and the first chip and/or the second chip transmit
It is abnormal, and enter alarm condition;
In the present embodiment, if not receive a certain chip anti-in the second Preset Time of transmission order class data for controller
The state class data of feedback, then to determine that transmission between controller and the chip occurs abnormal for controller, and enters alarm condition.Tool
Body, controller after to the first chip and the second chip transmission start sense command data, if in the second Preset Time not
Receive the first setting status data of the first chip feedback, it is determined that the transmission between controller and the first chip occurs different
Often, system into alarm condition, and will stop current operation, show abnormal information;It is similar, if in the second Preset Time not
Receive the second setting status data of the second chip feedback, it is determined that the transmission between controller and the second chip occurs different
Often, system also into alarm condition, and will stop current operation, show abnormal information.
In the present embodiment, controller can transmit call instruction data so that each chip store in calling internal memory certain group parameter
It is configured, meets different job requirements.The running status of chip is determined after parameter setting, only when each chip all runs
When normal, system ability complete call, otherwise, as long as there is a chip operation exception, system all into alarm condition, and will show
Abnormal information, improves the safety of system.
With reference to Fig. 5, Fig. 5 is schematic flow sheet of the present invention based on the 5th embodiment of communication means of CAN protocol.
Based on the embodiment described in above-mentioned Fig. 1, the communication means is further comprising the steps of:
Step S220, according to the modification instruction of user's triggering, controller is by CAN protocol to first chip and second
Chip transmission modification order data;
In the present embodiment, the communication data in CAN protocol also includes order class data, the first character section of order class data
For being identified to the type of data.Each chip is receiving order class data all by execution corresponding order.Wherein order
Class data include changing order data, and modification order data can be used to individually change certain arrange parameter.Parameter can be divided into handss again
Dynamic parameter and welding parameter, wherein manual data are that, for controlling and detecting a certain chip manually, welding parameter is to weld
Parameter to be performed in journey.According to the modification instruction of user's triggering, controller is to each chip transmission modification order data with independent
Change certain parameter.Specifically, user clicks on modification option in controller, and after being input into the parameter information of modification, controller will
Generate corresponding modification instruction.After modification instruction is generated, controller is transmitted to the first chip and the second chip by CAN protocol
Corresponding modification order data.
Step S230, first chip and the second chip are repaiied according to described when the modification order data is received
Change order data and individually change certain parameter setting, and by CAN protocol to institute after the controller constant feedback parameter modification
The the first modification status data for generating and the second modification status data;
In the present embodiment, when modification order data is received, the first chip will be according to modification order data for the first chip
Corresponding parameter is individually modified, the corresponding first modification status data of the first chip after the completion of parameter modification, will be generated,
The status information that the modification of the first chip is completed is record in first modification status data;When the first modification status data is generated,
First chip will change status data to controller constant feedback first by CAN protocol, for controller according to the first modification shape
State data determine the amended state of the first chip parameter.Similar, the second chip is receiving call instruction data, also by root
Corresponding parameter is individually modified according to modification order data, the second chip corresponding second after the completion of parameter modification, will be generated
Modification status data;When the second modification status data is generated, the second chip will be by CAN protocol to controller constant feedback the
Two modification status datas, determine second chip parameter amended state according to the second modification status data for controller.If control
Device processed at least receives one time first modification status data in the second Preset Time, at least receives in the second Preset Time
One time second modification status data, then into step S240;If controller does not at least receive first in the second Preset Time
One in modification status data and the second modification status data, then into step S270.
Step S240, if the controller at least respectively receives once the first modification state in the second Preset Time
Data and one time second modification status data, then the controller is respectively according to the described first modification status data and the second modification
Status data judges the state of first chip and the second chip;
In the present embodiment, in controller to after the first chip transmission modification order data, if in the second Preset Time
The first modification status data of the first chip feedback is at least received, then the first core is obtained according to the first modification status data
The status information of piece, and judge whether the first chip is run after parameter modification normal according to the status information.Similar, in control
Device processed is changed after order data to the transmission of the second chip, if the second chip feedback is at least received in the second Preset Time
The second modification status data, then the status information of the second chip is obtained according to the second modification status data, and according to the state
Information judges whether the second chip is run after parameter modification normal.If now controller determines each chip all normal operations,
Step S250 is entered then;If controller determines at least one chip operation exception in each chip, into step S260.
Step S250, if the controller determines first chip and the second chip all normal operations, the control
Device processed determines that modification is completed;
In the present embodiment, if controller changes status data according to the first chip feeds back first determines the first chip
Normal operation after parameter modification, determines after the modification of the second chip parameter according to the second modification status data of the second chip feedback
Also normal operation, then system complete modification.
Step S260, if the controller determines first chip and/or the second chip operation exception, the control
Device processed enters alarm condition;
In the present embodiment, if controller is determined in each chip at least according to the modification status data that each chip feeds back
One chip operation exception, then system enter alarm condition.Specifically, if controller is determined according to the first modification status data
Operation exception after the modification of first chip parameter, or the second chip is determined according to the second modification status data of the second chip feedback
Operation exception after parameter modification, then system enter alarm condition, and stop current operation, display alarm information;If controlling certainly
Device determines the first chip and the second chip all operation exceptions, then system also enters alarm condition, and stops current operation, shows
Warning message.
Step S270, if the controller do not receive in the second Preset Time it is described first modification status data and/
Or second modification status data, then the controller determine between the controller and the first chip and/or the second chip transmit
It is abnormal, and enter alarm condition;
In the present embodiment, if not receive a certain chip anti-in the second Preset Time of transmission order class data for controller
The state class data of feedback, then to determine that transmission between controller and the chip occurs abnormal for controller, and enters alarm condition.Tool
Body, controller to the first chip and the second chip transmission modification order data after, if not receiving in the second Preset Time
To the first modification status data of the first chip feedback, it is determined that exception occurs in the transmission between controller and the first chip, is
System into alarm condition, and will stop current operation, show abnormal information;Similar, if not receiving in the second Preset Time
To the second modification status data of the second chip feedback, it is determined that exception occurs in the transmission between controller and the second chip, is
System also into alarm condition, and will stop current operation, show abnormal information.
In the present embodiment, controller changes order data so that each chip is individually changed according to the instruction transmission that user triggers
Certain arrange parameter, meets different job requirements.After parameter modification determine chip running status, only when each chip all
During normal operation, system just complete modification, otherwise, as long as there is a chip operation exception, system all will into alarm condition, and
Abnormal information is shown, the safety of system is improve.
With reference to Fig. 6, Fig. 6 is schematic flow sheet of the present invention based on the communication means sixth embodiment of CAN protocol.
Based on the embodiment described in above-mentioned Fig. 1, the communication means is further comprising the steps of:
Step S280, according to the work order of user's triggering, controller is by CAN protocol to first chip and second
Chip transmits work order data;
In the present embodiment, the communication data in CAN protocol also includes order class data, the first character section of order class data
For being identified to the type of data.According to the work order of user's triggering, controller transmits work order number to each chip
Each chip is made to be operated preparation according to this.Specifically, user in controller click work option, controller will generate corresponding work
Instruct.After work order is generated, controller transmits corresponding work life to the first chip and the second chip by CAN protocol
Make data.
Step S290, first chip and the second chip when the work order data are received, according to the work
Preparation is operated as order data, and the generated after being ready to complete to the controller constant feedback by CAN protocol
One operating state data and the second operating state data;
In the present embodiment, when work order data are received, the first chip will be according to work order data for the first chip
Preparation is operated, corresponding first operating state data of the first chip, the first working condition after the completion of Job readiness, will be generated
The status information that the first chip operation is ready to complete is record in data;When the first operating state data is generated, the first chip
Will be true according to the first operating state data for controller by CAN protocol to the first operating state data of controller constant feedback
Determine the state after the first chip operation is ready to complete.Similar, the second chip is receiving work order data, also will be according to work
Preparation is operated as order data, corresponding second operating state data of the second chip after Job readiness, will be generated;Second
When operating state data is generated, the second chip will be by CAN protocol to the second operating state data of controller constant feedback, for control
Device processed according to the second operating state data determine the second chip operation be ready to complete after state.If controller is when second is default
It is interior at least to receive first operating state data, second working condition is at least received in the second Preset Time
Data, then into step S300;If controller does not at least receive the first operating state data and in the second Preset Time
One in two operating state datas, then into step S330.
Step S300, if the controller at least respectively receives once first working condition in the second Preset Time
Data and second operating state data, then the controller is respectively according to first operating state data and the second work
Status data judges the state of first chip and the second chip;
In the present embodiment, in controller to after the first chip transmission work order data, if in the second Preset Time
The first operating state data of the first chip feedback is at least received, then the first core is obtained according to the first operating state data
The status information of piece, and judge whether the first chip is run after the completion of Job readiness normal according to the status information.Similar,
In controller to after the second chip transmission work order data, if second chip is at least received in the second Preset Time
Second operating state data of feedback, then obtain the status information of the second chip according to the second operating state data, and according to this
Status information judges whether the second chip is run after the completion of Job readiness normal.If now controller determines each chip and all transports
Row is normal, then into step S310;If controller determines at least one chip operation exception in each chip, into step
S320。
Step S310, if the controller determines first chip and the second chip all normal operations, the control
Device processed enters working condition;
In the present embodiment, if controller determines the first chip according to the first operating state data that the first chip feeds back
Normal operation after the completion of Job readiness, determines the second chip operation according to the second operating state data of the second chip feedback accurate
Also normal operation after the completion of standby, then system enter working condition.
Step S320, if the controller determines first chip and/or the second chip operation exception, the control
Device processed enters alarm condition;
In the present embodiment, if controller is determined in each chip at least according to the operating state data that each chip feeds back
One chip operation exception, then system enter alarm condition.Specifically, if controller is determined according to the first operating state data
First chip operation is ready to complete rear operation exception, or determines second according to the second modification status data of the second chip feedback
Chip operation is ready to complete rear operation exception, then system enters alarm condition, and stops current operation, display alarm information;When
If so controller determines the first chip and the second chip all operation exceptions, system also enters alarm condition, and stops current
Operation, display alarm information.
Step S330, if the controller do not receive in the second Preset Time first operating state data and/
Or second operating state data, then the controller determine
It is abnormal, and enter alarm condition;
In the present embodiment, if not receive a certain chip anti-in the second Preset Time of transmission order class data for controller
The state class data of feedback, then to determine that transmission between controller and the chip occurs abnormal for controller, and enters alarm condition.Tool
Body, controller to the first chip and the second chip transmission work order data after, if not receiving in the second Preset Time
To the first operating state data of the first chip feedback, it is determined that exception occurs in the transmission between controller and the first chip, is
System into alarm condition, and will stop current operation, show abnormal information;Similar, if not receiving in the second Preset Time
To the second operating state data of the second chip feedback, it is determined that exception occurs in the transmission between controller and the second chip, is
System also into alarm condition, and will stop current operation, show abnormal information.
In the present embodiment, when user triggers work order, controller will transmit work order data so that each chip
The state for preparing and determining each chip is operated, only when each chip starts during all normal operations, system just enters work
State.Otherwise, as long as there is chip operation exception on startup, system all into alarm condition, and will show abnormal information,
Improve the safety of system.
With reference to Fig. 7, Fig. 7 is schematic flow sheet of the present invention based on the 7th embodiment of communication means of CAN protocol.
Based on the embodiment described in above-mentioned Fig. 6, the communication means is further comprising the steps of:
Step S340, according to the halt instruction of user's triggering, controller is by CAN protocol to first chip and second
Chip transmits data of ceasing and desisting order;
In the present embodiment, user clicks in controller and stops option, and controller will generate corresponding halt instruction.Stopping
After instruction is generated, controller transmits corresponding cease and desist order data to the first chip and the second chip by CAN protocol.
Step S350, first chip and the second chip receive it is described cease and desist order data when, stopped according to described
Only order data quits work, and first generated after CAN protocol works stopping to the controller constant feedback stops
Only status data and the second halted state data;
In the present embodiment, the first chip receive cease and desist order data when, the first chip will be according to work order data
Quit work, the corresponding first halted state data of the first chip will be generated after stopping, being record in the first operating state data
Status information when first chip quits work;In the first halted state data genaration, the first chip will by CAN protocol to
According to the first halted state data, controller constant feedback the first halted state data, determine that the first chip stops work for controller
State when making.Similar, the second chip is receiving data of ceasing and desisting order, and also will be quit work according to data of ceasing and desisting order,
The corresponding second halted state data of the second chip will be generated after quitting work;In the second halted state data genaration, second
Chip will be by CAN protocol to controller constant feedback the second halted state data, for controller according to the second working condition number
State when quitting work according to the second chip of determination.If controller at least receives one time first stopping in the second Preset Time
Status data, at least receives a second halted state data, then in the second Preset Time into step S360;If control
Device does not at least receive one in the first operating state data and the second operating state data in the second Preset Time, then enter
Enter step S390.
Step S360, if the controller at least respectively receives once first halted state in the second Preset Time
Data and a second halted state data, then the controller is respectively according to the first halted state data and the second stopping
Status data judges the state of first chip and the second chip;
In the present embodiment, after controller ceases and desist order data to the transmission of the first chip, if in the second Preset Time
The first halted state data of the first chip feedback are at least received, then the first core is obtained according to the first operating state data
The status information of piece, and whether operation is normal when judging that the first chip quits work according to the status information.Similar, in control
Device is ceased and desisted order to the transmission of the second chip after data, if the second chip feedback is at least received in the second Preset Time
Second halted state data, then obtain the status information of the second chip, and believed according to the state according to the second halted state data
When breath judges that the second chip quits work, whether operation is normal.If now controller determines each chip all normal operations, enter
Enter step S370;If controller determines at least one chip operation exception in each chip, into step S380.
Step S370, if the controller determines first chip and the second chip all normal operations, the control
Device processed enters holding state;
In the present embodiment, if controller determines the first chip according to the first halted state data that the first chip feeds back
Normal operation when quitting work, when determining the second chip and quit work according to the second halted state data of the second chip feedback
Also normal operation, then system enter holding state.
Step S380, if the controller determines first chip and/or the second chip operation exception, the control
Device processed enters alarm condition;
In the present embodiment, if controller is determined in each chip at least according to the halted state data that each chip feeds back
One chip operation exception, then system enter alarm condition.Specifically, if controller is determined according to the first halted state data
Operation exception when first chip quits work, or the second chip is determined according to the second halted state data of the second chip feedback
Operation exception when quitting work, then system enter alarm condition, and stop current operation, display alarm information;If controlling certainly
Device determines the first chip and the second chip all operation exceptions, then system also enters alarm condition, and stops current operation, shows
Warning message.
Step S390, if the controller do not receive in the second Preset Time the first halted state data and/
Or the second halted state data, then the controller determine
It is abnormal, and enter alarm condition;
In the present embodiment, if not receive a certain chip anti-in the second Preset Time of transmission order class data for controller
The state class data of feedback, then to determine that transmission between controller and the chip occurs abnormal for controller, and enters alarm condition.Tool
Body, controller is being ceased and desisted order after data to the first chip and the transmission of the second chip, if not receiving in the second Preset Time
To the first halted state data of the first chip feedback, it is determined that exception occurs in the transmission between controller and the first chip, is
System into alarm condition, and will stop current operation, show abnormal information;Similar, if not receiving in the second Preset Time
To the second halted state data of the second chip feedback, it is determined that exception occurs in the transmission between controller and the second chip, is
System also into alarm condition, and will stop current operation, show abnormal information.
In the present embodiment, when user triggers halt instruction, controller will transmit data of ceasing and desisting order so that each chip
The state of each chip is quit work and determines, only when each chip starts during all normal operations, system just enters holding state.
Otherwise, as long as there is chip operation exception on startup, system all into alarm condition, and will show abnormal information, improve
The safety of system.
With reference to Fig. 8, Fig. 8 is schematic flow sheet of the present invention based on the 7th embodiment of communication means of CAN protocol.
Based on the embodiment described in above-mentioned Fig. 1, the communication means is further comprising the steps of:
Step S400, controller is by CAN protocol to first chip and the second chip transfer bus sense command number
According to;
In the present embodiment, the communication data in CAN protocol also includes order class data, and the first byte of order class data is used
In being identified to data type, order class data include bus sense command data.Controller is by bus sense command data
Each chip is issued, so that each chip will be detected to CAN according to bus sense command data.Specifically, controller leads to
CAN protocol is crossed to the first chip and the second chip transfer bus sense command data.
Step S410, first chip and the second chip when the bus sense command data are received, according to institute
Bus sense command Data Detection CAN state is stated, and by CAN protocol to after controller constant feedback bus detection
The the first bus state data for being generated and the second bus state data;
In the present embodiment, when bus sense command data are received, the first chip will be detected the first chip according to bus
Order and CAN detected, after detection, the corresponding first bus state data of the first chip will be generated according to testing result,
The detection information of the first chip detection is record in first verification status data;In the first bus state data genaration, first
Chip will be by CAN protocol to controller constant feedback the first bus state data, for controller according to the first bus state number
According to the state for determining CAN.Similar, the second chip will also receive bus sense command data, the second core on startup
Piece will be detected to CAN according to bus sense command data, will generate the second chip pair according to testing result after detection
The the second bus state data answered;In the second bus state data genaration, the second chip will be held to controller by CAN protocol
The second bus state data of continuous feedback, determine the state of CAN for controller according to the second verification status data.If controller
A first bus state data are at least received in the second Preset Time, is at least received once in the second Preset Time
Second bus state data, then into step S420;If controller does not at least receive the first bus in the second Preset Time
One in status data and the second bus state data, then into step S450.
Step S420, if the controller at least respectively receives once first bus state in the second Preset Time
Data and a second bus state data, then the controller is according to the first bus state data and the second bus state
Data judge the state of the CAN;
In the present embodiment, in controller to after the first chip transfer bus sense command data, if when second is default
Interior the first bus state data at least receiving the first chip feedback, then obtain according to the first verification status data
The status information of CAN, and judge whether CAN operation is normal according to the status information.It is similar, in controller to
After two chip bus sense command data, if second that the second chip feedback is at least received in the second Preset Time is total
Line states data, then obtain the status information of CAN, and judged according to the status information according to the second bus state data
Whether CAN operation is normal.If now controller all obtains CAN operation according to the bus state data that each chip feeds back
Normal judged result, then into step S430;If controller is drawn according at least to the bus state data that a chip feeds back
The judged result of CAN operation exception, then into step S440.
Step S430, if the controller determines the CAN normal operation, the controller is pre- through the 3rd
If the time transmits the bus sense command data to first chip and the second chip again;
In the present embodiment, if controller determines CAN according to the first bus state data that the first chip feeds back
Normal operation, just also runs after determining the verification of the second chip parameter according to the second bus state data of the second chip feedback
Often, then controller can again to each chip transfer bus sense command data, with total to CAN again after the 3rd Preset Time
Line is detected.
Step S440, if the controller determines the CAN operation exception, the controller enters warning shape
State;
In the present embodiment, if controller determines CAN operation exception, or control according to the first bus state data
Device determines CAN operation exception according to the bus state data that the second chip feeds back, then system enters alarm condition, and stops
Only current operation, display alarm information;If certainly controller according to the first bus state data and the second bus state data all
The judged result of CAN operation exception can be obtained, then system also enters alarm condition, and stops current operation, display alarm
Information.
Step S450, if the controller do not receive in the second Preset Time the first bus state data and/
Or the second bus state data, then the controller determine
It is abnormal, and enter alarm condition;
In the present embodiment, controller after to the first chip and the second chip transfer bus sense command data, if
The first bus state data of the first chip feedback are not received in two Preset Times, it is determined that between controller and the first chip
Transmission occur abnormal, system into alarm condition, and will stop current operation, display abnormal information;It is similar, if second
The second bus state data of the second chip feedback are not received in Preset Time, it is determined that between controller and the second chip
There is exception in transmission, and system also into alarm condition, and will stop current operation, shows abnormal information.
In the present embodiment, controller periodically can be carried out to each chip transfer bus sense command data with CAN
Detection, as long as the judged result of CAN operation exception is obtained according to the bus state parameter of chip feedback, system all incite somebody to action
Into alarm condition, and abnormal information is shown, improve the safety of system.
The present invention also provides a kind of communication system based on CAN protocol.
With reference to Fig. 9, Fig. 9 is high-level schematic functional block diagram of the present invention based on the communication system first embodiment of CAN protocol.
In the present embodiment, the communication system includes the first chip 10 and the second chip 20:
First chip 10, for by CAN protocol continuous transmission communication data;
Second chip 20, if the communication data for the transmission of the first chip 10 is received in the first Preset Time, root
The state of first chip 10 is determined according to the current state class data of the first chip 10 in the communication data for receiving;
If the second chip 10 is additionally operable to the communication data is not received in the first Preset Time, it is determined that described first
Transmission abnormality between chip 10 and the second chip 20, and enter alarm condition.
With reference to Figure 10, Figure 10 is high-level schematic functional block diagram of the present invention based on the communication system second embodiment of CAN protocol.
Based on the embodiment described in above-mentioned Fig. 9, the communication system also includes controller 30:
Controller 30, for when the first chip 10 and the second chip 20 start, by CAN protocol to first chip
10 and 20 transmission start sense command data of the second chip;
First chip 10 and the second chip 20 are additionally operable to when the startup sense command data are received, and are opened according to described
Dynamic sense command data carry out startup detection, and are generated after CAN protocol starts detection to the controller constant feedback
The first starting state data and the second starting state data;
If controller 30 is additionally operable in the second Preset Time at least respectively receive once the first starting state data
With a second starting state data, then institute is judged according to the first starting state data and the second starting state data respectively
State the state of the first chip 10 and the second chip 20;
If controller 30 is additionally operable to determine first chip 10 and the second chip 20 all normal operations, it is determined that described
First chip 10 and the second chip 20 complete to start;
If controller 30 is additionally operable to determine 20 operation exception of first chip 10 and/or the second chip, report is entered
Alert state;
If controller 30 is additionally operable to the first starting state data and/or second are not received in the second Preset Time
Starting state data, it is determined that transmission abnormality between the controller 30 and the first chip 10 and/or the second chip 10, and enter
Alarm condition.
With continued reference to Figure 10, communication system described in the present embodiment:
Controller 30 is additionally operable to transmit files classes data to first chip 10 and the second chip 20 by CAN protocol;
First chip 10 and the second chip 20 are additionally operable to when the files classes data are received, according to the files classes number
According to carrying out parameter verification, and first shape is verified by what CAN protocol generated to after the controller constant feedback parameter verification
State data and the second verification status data;
If controller 30 is additionally operable in the second Preset Time at least respectively receive once the first verification status data
With one time second verification status data, then institute is judged according to the described first verification status data and the second verification status data respectively
State the state of the first chip 10 and the second chip 20;
If controller 30 is additionally operable to determine first chip 10 and the second chip 20 all normal operations, into standby
State;
If controller is additionally operable to determine 20 operation exception of first chip 10 and/or the second chip, enters and report to the police
State;
If controller 30 is additionally operable to the first verification status data and/or second is not received in the second Preset Time
Verification status data, it is determined that transmission abnormality between the controller and the first chip 10 and/or the second chip 20, and enter report
Alert state.
With continued reference to Figure 10, communication system described in the present embodiment:
Controller 30 is additionally operable to the call instruction according to user's triggering, and CAN protocol is to first chip 10 and the second core
Piece 20 transmits call instruction data;
First chip 10 and the second chip 20 are additionally operable to, when the call instruction data are received, call life according to described
Make data in internal memory, call one group of parameter to be configured, and by CAN protocol to the controller constant feedback parameter setting
The the first setting status data for being generated afterwards and second arranges status data;
If controller 30 be additionally operable at least to receive once in the second Preset Time described first arrange status data and
One time second setting status data, then respectively first according to described first arranges status data and second arranges condition adjudgement
The state of chip 10 and the second chip 20;
If controller 30 is additionally operable to determine first chip 10 and the second chip 20 all normal operations, it is determined that call
Complete;
If controller 30 is additionally operable to determine 20 operation exception of first chip 10 and/or the second chip, report is entered
Alert state;
If controller 30 is additionally operable to the first setting status data and/or second is not received in the second Preset Time
Status data is set, it is determined that transmission abnormality between the controller and the first chip 10 and/or the second chip 20, and enters report
Alert state.
With continued reference to Figure 10, communication system described in the present embodiment:
Controller 30 is additionally operable to the modification instruction according to user's triggering, by CAN protocol to first chip 10 and the
The transmission modification order data of two chip 20;
First chip 10 and the second chip 20 are additionally operable to when the modification order data is received, according to the modification life
Make data individually change certain parameter setting, and generated to after the controller constant feedback parameter modification by CAN protocol
First modification status data and second modification status data;
If controller 30 is additionally operable in the second Preset Time at least respectively receive once the first modification status data
With one time second modification status data, then institute is judged according to the described first modification status data and the second modification status data respectively
State the state of the first chip 10 and the second chip 20;
If controller 30 is additionally operable to determine first chip 10 and the second chip 20 all normal operations, it is determined that modification
Complete;
If controller 30 is additionally operable to determine 20 operation exception of first chip 10 and/or the second chip, report is entered
Alert state;
If controller 30 is additionally operable to the first modification status data and/or second is not received in the second Preset Time
Modification status data, it is determined that transmission abnormality between the controller and the first chip 10 and/or the second chip 20, and enter report
Alert state.
With continued reference to Figure 10, communication system described in the present embodiment:
Controller 30 is additionally operable to the work order according to user's triggering, by CAN protocol to first chip 10 and the
Two chip 20 transmits work order data;
First chip 10 and the second chip 20 are additionally operable to when the work order data are received, and are ordered according to the work
Data are made to be operated preparation, and generated to after the completion of the controller constant feedback Job readiness by CAN protocol
One operating state data and the second operating state data;
If controller 30 is additionally operable in the second Preset Time at least respectively receive once first operating state data
With second operating state data, then institute is judged according to first operating state data and the second operating state data respectively
State the state of the first chip 10 and the second chip 20;
If controller 30 is additionally operable to determine first chip 10 and the second chip 20 all normal operations, into work
State;
If controller 30 is additionally operable to determine 20 operation exception of first chip 10 and/or the second chip, report is entered
Alert state;
If controller 30 is additionally operable to first operating state data and/or second are not received in the second Preset Time
Operating state data, it is determined that transmission abnormality between the controller and the first chip 10 and/or the second chip 20, and enter report
Alert state.
With continued reference to Figure 10, communication system described in the present embodiment:
Controller 30 is additionally operable to the halt instruction according to user's triggering, by CAN protocol to first chip 10 and the
Two chip 20 transmits data of ceasing and desisting order;
First chip 10 and the second chip 20 be additionally operable to receive it is described cease and desist order data when, stop life according to described
Data are made to quit work, and the first stopping shape being generated after CAN protocol works stopping to the controller constant feedback
State data and the second halted state data;
If controller 30 is additionally operable in the second Preset Time at least respectively receive once the first halted state data
With a second halted state data, then institute is judged according to the first halted state data and the second halted state data respectively
State the state of the first chip 10 and the second chip 20;
If controller 30 is additionally operable to determine first chip 10 and the second chip 20 all normal operations, into standby
State;
If controller 30 is additionally operable to determine 20 operation exception of first chip 10 and/or the second chip, report is entered
Alert state;
If controller 30 is additionally operable to the first halted state data and/or second are not received in the second Preset Time
Halted state data, it is determined that transmission abnormality between the controller and the first chip 10 and/or the second chip 20, and enter report
Alert state.
With continued reference to Figure 10, communication system described in the present embodiment:
Controller 30 is additionally operable to by CAN protocol to the 20 transfer bus sense command of first chip 10 and the second chip
Data;
First chip 10 and the second chip 20 are additionally operable to when the bus sense command data are received, according to described total
Line sense command Data Detection CAN state, and given birth to after controller constant feedback bus detection by CAN protocol
Into the first bus state data and the second bus state data;
If controller 30 be additionally operable at least to receive once in the second Preset Time the first bus state data and
Second bus state data, then judge the CAN according to the first bus state data and the second bus state data
The state of bus;
If controller 30 is additionally operable to determine the CAN normal operation, through the 3rd Preset Time again to institute
State the first chip 10 and the second chip 20 sends the bus sense command data;
If controller 30 is additionally operable to determine the CAN operation exception, into alarm condition;
If controller 30 is additionally operable to the first bus state data and/or second are not received in the second Preset Time
Bus state data, it is determined that transmission abnormality between the controller and the first chip 10 and/or the second chip 20, and enter report
Alert state.
The present invention is corresponding with each step in said method embodiment based on modules in the communication system of CAN protocol,
Each function and realize that process is no longer repeated one by one herein.
The preferred embodiments of the present invention are these are only, the scope of the claims of the present invention is not thereby limited, it is every using this
Equivalent structure or equivalent flow conversion that bright description and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.