matlab 端口,用Matlab实现硬件端口采集的方法

兵工自动化 软件技术 O. I. Automation 2003 年第 22 卷第 3 期 Software Technique 2003, Vol. 22, No. 3 ·58· 文章编号:1006- 1576(2003)03- 0058- 03 用 Matlab 实现硬件端口采集的方法 刘秀 (华南理工大学 工业装备与控制工程学院,广东 广州 510640) 摘要:Matlab 实现硬件端口数据采集有 Matlab 工具箱和 Mex 文件法。工具箱法用函数实现,其步骤: 用 serial()、visa()、gpib() 创建设备对象;用 set() 设定设备对象属性;用 fopen() 实现设备对象与硬件设备的连接;用 fprintf()、fscanf() 等实现硬件设备端口数据采集;用 fclose() 关闭或用 delete() 和 clear() 清除设备对象。文件法用 Matlab 应用程序接口实现,其步骤:用 C++/Fortran 编写 Mex 文件,Matlab 解释器调用并执行动态链接函数;安装 Mex 文件编辑器对 Mex 文件调试与编译;调用 Mex 文件实现串口的读写。 关键词:数据采集;Matlab;工具箱;Mex 中图分类号:TP274.2 文献标识码:A Method of Data Acquisition for Hardware Port Realized with Matlab LIU Xiu (College of Industrial Equipment & Control Engineering, South China University of Technology, Guangzhou 510640, China) Abstract: There are methods of Matlab ToolBox and Mex file for data acquisition of hardware port realized with Matlab. Matlab ToolBox is implemented with function. The procedures are that equipment object is created with serial(), visa() and gpib(), the attribute of equipment object is set with set(), the connection of equipment object and hardware equipment is realized using fopen(), data acquisition for hardware port is realized with fprintf(), fscanf() etc, and equipment object is closed or deleted with delete() or clear(). Mex file method is realized with Matlab application program interface. The procedures are that Mex file is compiled with C++ or Fortran, Matlab interpreter transfers and implements dynamic connect function, install Mex fil

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值