首页 -> 登录 -> 注册 -> 回复主题 -> 发表主题
光行天下 -> FRED,VirtualLab -> FRED接口 [点此返回论坛查看本帖完整版本] [打印本页]

崔粤鹏 2014-08-21 16:23

FRED接口

FRED可与Matlab Excel接口,并可支持VB脚本语言编程。 7#UJ444b~  
OMjPC_  
FRED can act as an OLE automation server, which means that FRED canbe run remotely from other applications such as Microsoft Visual Basic,Microsoft Excel, Matlab, or any other application that can act as anOLE/Automation client.  In  this configuration, FRED is the automation serverand the application which is controlling FRED is the automation client.  Thefollowing information describes the fundamentals of how to run FRED as anautomation server. 8b 7I\J`  
下面是FRED原厂photon engineering与Matlab并行使用的接口连接,有兴趣的可以看下 R|qNyNXo[  
Kg<~Uf=1  
FRED Automation with Matlab b}Im>n!  
ShV_8F z  
Using FRED’s COM interface it is possible to exchange data with external programs such as MATLAB and Excel.  This article presents an example where FRED and MATLAB are used respectively as the automation client and server in order to exchange data and create plots.  There are a few steps that should be taken both in FRED and MATLAB before executing your script: Ei]Sks V>*  
In MATLAB: VK*H1EH1  
Start an instance of MATLAB (HeSL),1  
Execute the command: enableservice(‘AutomationServer’,true) m!<FlEkN  
Execute the command: enableservice(‘AutomationServer’) FG71<}C[K  
In FRED: ; Gv-$0{P3  
Right mouse click in the script editor and choose: Edit > References q$v0sTk0Y  
Choose the Matlab Type Library #huh!Mn  
Dimension your Matlab object in the script as type MLApp.MLApp .HY,'oC.  
The above steps will ensure that 1) FRED uses the current instance of MATLAB as the server instead of the command console, and 2) FRED loads the Matlab type library and can recognize and execute the server’s application commands.  In general, it is not necessary to load the Matlab type library in FRED since the Matlab server can be generically defined as an Object. 4,QA {v  
67T.qX2I$  
The example enbedded script in the sample file with this article demonstrates how to use some of the following Matlab application commands: |p*cI @  
PutWorkspaceData: send real-valued data to Matlab XHgW9;M!  
PutFullMatrix: send complex-valued data to Matlab Txe*$T,(  
GetWorkspaceData: retrieve data from Matlab kl1Q:  
Execute: issue Matlab commands to the server for execution o\it]B  
W4nn)qBrh  
链接:http://fred-kb.photonengr.com/2011/08/16/fred-automation-with-matlab/  
查看本帖完整版本: [-- FRED接口 --] [-- top --]

Copyright © 2005-2026 光行天下 蜀ICP备06003254号-1 网站统计