1、打开file 中new
![](https://img-blog.csdnimg.cn/img_convert/e2bf9a490bc06a9cc3404ce313b3916a.png)
2、选择CAN_500kBaud 1ch的demo
![](https://img-blog.csdnimg.cn/img_convert/4fead71482573480ac2d1968c62e9aa0.png)
![](https://img-blog.csdnimg.cn/img_convert/e593c74c0c9d5a887d04922015421fea.png)
3、将新建工程保存
![](https://img-blog.csdnimg.cn/img_convert/6a46e978624a9cd18a94bf5099d6e3ef.png)
4、在can总线上新建节点
鼠标放到can总线右击,选择Inset network node,创建两个节点
![](https://img-blog.csdnimg.cn/img_convert/1b249260085b5ef0dc252aafcc991a5e.png)
![](https://img-blog.csdnimg.cn/img_convert/c29b5726fb7e18d9d2c733dd1dafe2d5.png)
5、将新建的ECU修改名称
右击ECU选择configuration
![](https://img-blog.csdnimg.cn/img_convert/b5c1a214ad60a981b953a9739f5e5ee5.png)
6、导入数据库(dbc)
右击databases,选择add,导入建好的dbc文件
![](https://img-blog.csdnimg.cn/img_convert/68bee8169055584f2234b82377948f2d.png)
导入后在databases出现导入dbc名称
![](https://img-blog.csdnimg.cn/img_convert/c818fdf4e1091fd06bb10ef5078c9b3e.png)
7、添加系统变量
在environment工具栏,选择 system variables,右击空白选择new
![](https://img-blog.csdnimg.cn/img_convert/735e6ebce3ed76010bd2f1afd13dff89.png)
![](https://img-blog.csdnimg.cn/img_convert/685c4513089149c96b371efd0d6dc427.png)
安装下图创建系统变量,点击ok
![](https://img-blog.csdnimg.cn/img_convert/2c5467fcadf722adbca69d128448945c.png)
依次创建switch 与linght两个系统变量
![](https://img-blog.csdnimg.cn/img_convert/dd5c75eb33db631b8a9dd6e6c3bbcecb.png)
8、创建仿真变量
在home工具栏选择panel ---->new panel
![](https://img-blog.csdnimg.cn/img_convert/b32bbef9597ce5801f8f9322dcd3b94d.png)
在toolbox中选择led control与switch/indicator两个组件
![](https://img-blog.csdnimg.cn/img_convert/5f610428d5154f78568d82564d6a6b59.png)
9、绑定系统变量
选定我们的组件后点击Propertise,在symbol中选择Variable
![](https://img-blog.csdnimg.cn/img_convert/2bd8fd4dc6d442abeea5269e6146132c.png)
将鼠标放置上图symbol的小方框中,出现小三点,点击进去选择我们新建的first pace中的firstswitch系统变量,依次将我们新建的两个系统变量都进行绑定
![](https://img-blog.csdnimg.cn/img_convert/d8ec2c93ee64dc2e2861ce77e1cff3da.png)
绑定完成之后如下图,完成之后将panel保存
![](https://img-blog.csdnimg.cn/img_convert/fed42f37f50db3f77c83dffa519997ea.png)
10、创建代码
双击我们新建的ecu,弹出代码存放位置与代码名称,创建之后选择打开
![](https://img-blog.csdnimg.cn/img_convert/f56049eadb10fbd1caf8402f684ed2fc.png)
![](https://img-blog.csdnimg.cn/img_convert/8b70c49c3a8c86b573fe6ac3e1259244.png)