Computer Engineering and Applications ›› 2009, Vol. 45 ›› Issue (34): 56-58.DOI: 10.3778/j.issn.1002-8331.2009.34.018
• 研发、设计、测试 • Previous Articles Next Articles
MIAO Li-dong
Received:
Revised:
Online:
Published:
Contact:
苗立东
通讯作者:
Abstract: The Real-Time Windows Target(RTWT) toolbox in MATLAB can make task run in real time on a single PC with Windows operating system,which can be used for real time simulation of control system,but such function is limited by its driver.Targeting this problem,key issues about development of RTWT driver is discussed,which includes register access and the debug of the driver.Two methods are put out,and the first one is to use the mdlOutputs function in the RTWT and the second one is to use the xPC environment.Different tests are conducted on three computers, and results show that the two methods can output debug results correctly.Test results for 15 channels analog input with developed PCI-8360A board driver show that RTWT driver is compatible with xPC one under certain conditions,and the sample time is 0.18 ms for RTWT and 0.3 ms for xPC target,which indicates that the RTWT target can run faster than the xPC one,and provides new idea for the use of RTWT.
Key words: real-time simulation, Real-Time Windows target(RTWT), xPC Target, driver, system function
摘要: MATLAB下的实时视窗目标工具箱能够在一台运行Windows操作系统的微机上执行实时任务,可用于对自动控制系统进行实时仿真分析,但是此功能受限于其驱动程序。针对此问题,讨论了开发实时视窗目标工具箱驱动程序的关键问题,包括寄存器的访问和程序调试,提出了两种方法:(1)在实时视窗目标环境下借助于驱动程序的输出函数mdlOutputs;(2)利用xPC目标工具箱环境。在三台计算机上进行了不同的实验,实验结果表明所提出的方法能够正确地显示中间结果;采用开发的PCI-8360A模拟量输入驱动程序采集15路模拟量信号,结果表明实时视窗目标驱动程序在一定条件下可以和xPC目标驱动程序兼容,实时视窗目标的采样时间为0.18 ms要小于xPC目标的采样时间0.3 ms,这为实时视窗目标的扩展应用提供了新的思路。
关键词: 实时仿真, 实时视窗目标, xPC目标, 驱动程序, 系统函数
CLC Number:
TP391
MIAO Li-dong. Extension and discussion of MATLAB real-time simulation on single PC[J]. Computer Engineering and Applications, 2009, 45(34): 56-58.
苗立东. MATLAB的单机型实时仿真系统的扩展与讨论[J]. 计算机工程与应用, 2009, 45(34): 56-58.
0 / Recommend
Add to citation manager EndNote|Ris|BibTeX
URL: http://cea.ceaj.org/EN/10.3778/j.issn.1002-8331.2009.34.018
http://cea.ceaj.org/EN/Y2009/V45/I34/56