FRED可与
Matlab Excel接口,并可支持VB脚本语言
编程。
_6.Y3+7I }v6@yU 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.
%[x
PyqX 下面是FRED原厂photon engineering与Matlab并行使用的接口连接,有兴趣的可以看下
& ^;3S*p W!V-m FRED Automation with Matlab
c Rv#aV j:7AVnt 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:
}"M5"? In MATLAB:
>e!Y 63` Start an instance of MATLAB
0M!GoqaA Execute the command: enableservice(‘AutomationServer’,true)
{gb` %J Execute the command: enableservice(‘AutomationServer’)
@?*;
-]#) In FRED:
m4?a'z" Right mouse click in the script editor and choose: Edit > References
;)q"X>FMZe Choose the Matlab Type Library
)]C(NTfxg Dimension your Matlab object in the script as type MLApp.MLApp
`_SV1|=="8 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.
`L%<3/hF 0UhJ
I The example enbedded script in the sample file with this article demonstrates how to use some of the following Matlab application commands:
ZF@$3 PutWorkspaceData: send real-valued data to Matlab
x(A8FtG PutFullMatrix: send complex-valued data to Matlab
BS3{TGn GetWorkspaceData: retrieve data from Matlab
!8&EkXTw, Execute: issue Matlab commands to the server for execution
F+!9T 8^67,I-c 链接:
http://fred-kb.photonengr.com/2011/08/16/fred-automation-with-matlab/