下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Building a LabVIEW User Interface for a Simulink Model with LabVIEW Simulation Interface Toolkit 36 ratings | 3.75 out of 5 Overview The Simulation Interface Toolkit (SIT) provides a seamless integration between The MathWorks Inc. Simulink software and LabVIEW. The Simulation Interface Toolkit autom
2、atically generates LabVIEW code to interface with a Simulink model resulting in a flexible and easy-to-use user interface. You first must configure the Simulink model to communicate with LabVIEW. Then you can create a LabVIEW host VI that automatically calls, runs, and interacts with the Simulink mo
3、del. Table of Contents 1. Configuring the Simulink Model 2. Creating a LabVIEW User Interface 3. Creating Connections between the LabVIEW User Interface and the Simulink Model 4. Attachments Configuring the Simulink Model Before LabVIEW can communicate with the Simulink model, you must correctly con
4、figure the model in Simulink. 1. Save the attached files, absbrakesingleclosed.mdl and abssingleclosed.vi, to the computer. 2. Launch MATLAB and notice how the MATLAB command window displays the following message: Starting the SIT Server on port 6011 SIT Server started The Simulation Interface Toolk
5、it automatically installs the SIT server. If you do not see this message. you have not installed the toolkit correctly. 3. Enter simulink in the MATLAB command window to launch the Simulink Library Browser window. 4. Select FileOpen and select the absbrakesingleclosed.mdl, which is file you download
6、ed in Step 1, to open the ABS Braking model. The simulation model should look similar to the following diagram: This Simulink model represents an anti-lock braking system for a desired slip. The brake torque adjusts according to the current wheel speed and vehicle speed to achieve the desired slip.
7、5. At each point you want to monitor in the simulation model, add an NISink to theabsbrakesingleclosed.mdl to allow LabVIEW to read the data at that point in the simulation model . In the Simulink Library Browser window, double-click the NI Toolkit Sinks library. Notice the NISink and NIXYGraph bloc
8、ks. 6. Place an NISink block in the model window of the absbrakesingleclosed.mdl. 7. Connect the signal to the NISink block. The ABS Braking Model should look similar to the following diagram: You also can use the NIXYGraph block to plot and compare two signals in LabVIEW. 8. Save the Simulink model
9、. You now can create a user interface in LabVIEW for the Simulink model. Notice that the model remains fully-operational within the Simulink environment. Creating a LabVIEW User Interface To interact with the ABS Braking Model using a LabVIEW user interface, you need to create a user interface in La
10、bVIEW. 1. Launch LabVIEW and open a new VI. 2. Select one slider control and three gauges and place them on the front panel. 3. Label the slider control Relative Slip. 4. Label the three gauges Wheel Speed, Vehicle Speed, and Brake Torque. 5. Change the Relative Slip scale to 0 to 0.3. 6. Change the
11、 Wheel Speed and Vehicle Speed scales to 0 to 100 7. Change the Brake Torque scale to be 0 to 1500. The front panel of the VI should look like the following front panel: 8. Save this VI as abssingleclosed.vi. Notice that there is no block diagram code for calling the Simulink model. Creating Connect
12、ions between the LabVIEW User Interface and the Simulink Model The Simulation Interface Toolkit enables LabVIEW to run and communicate with the Simulink model once you make the appropriate connections. MATLAB and Simulink must remain open to configure and run the simulation model. 1. On the front pa
13、nel menu bar, select ToolsSIT Connection Manager to launch the SIT Connection Manager dialog box. Notice how the Controls and indicators listbox displays the controls and indicators you created on the front panel of the abssingleclosed VI. 2. Click the Load Model button to display the Select Host di
14、alog box. 3. In the Select Host dialog box, make sure the Machine Name/IP is localhost. 4. Click the OK button. By selecting localhost, LabVIEW connects to the SIT Server that MATLAB initially started. If you choose to start MATLAB on a separate computer with SIT 2.0 installed, you can connect to th
15、at computer by typing in the correct IP address. 5. In the Select Model dialog box, navigate to the folder where you saved theabsbrakesingleclosed.mdl. Select the absbrakesingleclosed.mdl file and click the OKbutton. Notice how all the parameters and sinks associated with the ABS Braking Model appea
16、rs in theModel parameters and sinks listbox in the SIT Connection Manager dialog box. 6. To create a connection between the Brake Torque gauge in LabVIEW and the Brake Torqueinput in the Simulink model, select Brake Torque in the Controls and indicators listbox and select BrakeBrake in the Model par
17、ameters and sinks listbox. 7. Click the Add to Connections button to add the connection to the Current connections table. 8. Similarly, create the remaining connections between the LabVIEW controls and indicators and the Simulink parameters and sinks. The SIT Connection Manager dialog box should loo
18、k similar to the following figure: + Enlarge Image Notice that the parameters and controls have a icon in front of them while sinks and indicators have a icon in front of them. Use these icons to ensure that you do not make an invalid connection. 9. Click the OK button. Notice that the Simulation In
19、terface Toolkit generates the block diagram code that governs the interaction between the LabVIEW front panel and the absbrakesingleclosed.mdl. The VI should look similar to the following figure: 10. Click the Run button, to run the VI. The Select Host dialog box appears. 11. Verify that the host co
20、mputer is localhost. Click the OK button. Although the VI starts do run, the Simulink model is not running yet. 12. To run the Simulink model, absbrakesingleclosed.mdl, click the Run button, , on the front panel. 13. Adjust the values of the Relative Slip slider while the Simulink model is running. You can see the effect of relative slip on the wheel speed, vehicle speed, and brake torque. The process described here does not require The MathWorks Real-Time Workshop. This VI uses Simulink to run the simulation. You also can use the Simulation Interface Toolkit toge
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 车床维修施工方案(3篇)
- 连续化施工方案(3篇)
- 金子首饰营销方案(3篇)
- 门店钻头营销方案(3篇)
- 餐厅上午营销方案(3篇)
- 龙华装修施工方案(3篇)
- 2026年顺德职业技术学院单招职业适应性考试题库含答案详解(精练)
- 2026年长白山职业技术学院单招综合素质考试题库附答案详解(突破训练)
- 2026年陕西学前师范学院单招职业倾向性测试题库带答案详解(夺分金卷)
- 2026年陕西工业职业技术学院单招职业倾向性测试题库带答案详解(a卷)
- 道路高程测量成果记录表-自动计算
- 搅拌站节水用水管理制度
- 基于大语言模型的语义理解研究-洞察阐释
- 船舶建造监理合同协议
- 陕西单招数学试题及答案
- 中外航海文化知到课后答案智慧树章节测试答案2025年春中国人民解放军海军大连舰艇学院
- 【新教材】苏教版数学一年级下册1.1 9加几(课件+同步教案带反思+分层练习)
- 2025年安徽商贸职业技术学院单招职业适应性测试题库a4版
- 小学数学分数四则混合运算300题带答案
- 父女三人分配财产协议书范本
- 思想道德与法治(2023版)学习通超星期末考试答案章节答案2024年
评论
0/150
提交评论