Source: http://www.cnblogs.com/dongdonghuihui/archive/2012/09/26/2704611.html
Canoe is the vector company's bus analysis tool for the automotive electronics industry, now I use the CANoe7.6 version of the introduction, the other version of the basic features almost.
The hardware I use is the can case XL.
1,canoe Software Installation is simple, first installed driver, and then installed software. Installation complete, plug in USB, connect hardware, so in Control Panel, Vector Hardware to view
By looking at the information, we can see that the two piggy in Cancasexl, one is 251 (high speed can), one is 7269 (LIN), and the other is 1054 (low-speed can, or fault-tolerant can), because CANCASEXL only supports two-way communication, So that piggy can be freely assembled.
2, hardware connection is OK, open canoe software
File->new configuration can choose the new project template, we choose CAN_500KBAUD.TCN here, so the new baud rate of 500K can works, file->save configuration, To save
3, the next step is to use the Can db++ editor tool for bus network nodes, messages, signals, defined.
Click on this icon in the toolbar, or start the tool by looking for it in the starting menu.
After startup, File->create Database, select Cantemplate.dbc, select directory and file name, save
Right-click Network nodes->new, for the definition of the node, you just need to fill out the name, for example: node_a
Then add the Node_b, complete as follows, so add two nodes under the network nodes directory
After the node is added, the next step is to add the can message, right-messages->new, which is required to define the name, ID,DLC and other information, as follows:
Then on the Transmitters page, click the Add button and add node_a as the Send node, meaning that this message is sent from the Node_a node
In fact, there is a way to do this at this time, do not define the sending node, and then drag the way directly to the sending node, functionally the same
With the news, the message is naturally a signal, then we start to create a signal
Right click Signals->new, fill in the following information
The signal is going to be in the message. Switch to the Messages page, Add the message_a we just created, and, of course, as above, it is also possible to use the drag-and-drop method to create an association from the signal to the message.
The difference between Intel mode and Motorola format in the above information is as follows:
With the 0 and the signal state of the switch does not seem to be very intuitive, we can use on and off to represent the good, so View->value Tables, right-click on the blank->new, type the following information:
Once defined, it also needs to be associated with the signal. The right key requires the associated signal->edit Signal,value Table to associate the Value Talbe item that you just created
Such a signal is completed, but also need to add a similar signal, you can click on the signal root directory, on the right to select signal Copy, and paste, and then double-click Copy Good signal, make some edits, and then use the above method associated with a message can quickly establish a second signal, Isn't it convenient?
Continue to add a third signal, indicator_a, as above, but I want to put this signal in the second byte of the message position, what to do?
In fact, there are two ways: the first, the right button has been linked, that is, in the message directory of the signal, Edit mapped signal, in the popup dialog box Startbit fill 8, so that the signal will run to the second byte of the message. The second method, right-->edit the message, in the Layout page, drag the color block of the signal to move
The above message_a messages and messages defined below have been defined to complete
The same as another message Message_b, when finished.
Create environment variables below, right-environment variables
Add the other environment variables in succession, indicator's Access property is write Oh, add the following:
Definition of the database this paragraph is basically OK. After saving, close candb++ editor and return to the canoe main program.
Please set the communication channel used in Configuration->options->configuration settings->channel usage, as this only requires 1-way can, and the others are set to 0.
Click on this option page to display the simulate Setup interface
Right-Databases->add, the newly created DBC to load in, and then connect the right-click->insert Network Node
The results are as follows:
Right-click this ECU module->configuration, select Node_a in Network Node, complete, then add Node_b
As soon as this is done, it is good to have the DBC associated with canoe.
4, interface design
Network and the corresponding relationship set up, you should design the interface, a good interface can be intuitive to display and control a variety of signals.
There are two types of interface design tools: The Panel designer, the new interface design tool, the other is the Panel editor is the old interface design tool, regardless of which tool design interface, can and canoe very good compatibility, no problem. Let's start with the first interface design tool to complete the interface design
Click on the toolbar icon or File->open Panel Designer to open the interface editor with the following interface:
Save the interface, named Panel_a, an empty interface can be placed on the top right of several components. Once placed, select the component on the interface, the right side back to show the currently selected components of the properties, you can change the corresponding size position, etc., but the most important is the symbol attribute, here to say, each interface component also needs to be associated with canoe, otherwise the simple interface is meaningless, Correlation is mainly signal and environment variables, in the symbol property of the symbol Filter property can be selected, we are related to the environment variable, so select Environment Variable, and then click on the symbol property above, Then select the corresponding associated variable in the page that pops up
You can design the panel_b the same way when you are done, or you can quickly create the same panel with the Save As method, but the association of Environment Variables and the text of the interface need to be fine-tuned. So two panel has been completed. The association with Canoe has also been established.
5,CAPL programming
All the preparatory work and assembly work have been completed, and now the program needs to be programmed to make the whole system run organically. Go back to Canoe's simulation setup interface, then click the Node_a module, like a pencil icon, fill in the program name, here Node_a, and then open the programming interface to complete the following program. Then complete the Node_b program. Tip: If you can't back a specific message name, signal name or environment variable, you can right-click the program blank, you will get unexpected surprise, try.
OK, okay.
6, run
Now click on the toolbar to run the program. Note: Here is the actual network, all messages are sent to the physical network, if only the validator, set to do so
The results of the complete operation are as follows:
This is so, step by step, we completed the first complete canoe application engineering, although this is only the first step in the introduction, but the entire canoe development process basically covers, if can run out of the above results, still can give us a lot of surprises. We need this surprise because it is the driving force for us to move on.
"Reprint" CANoe Primer Step By Step Series (i) Basic application