Click To Edit Master Title Style: MATLAB Integration With Zemax Presenter - Rhys Poolman
Click To Edit Master Title Style: MATLAB Integration With Zemax Presenter - Rhys Poolman
Click To Edit Master Title Style: MATLAB Integration With Zemax Presenter - Rhys Poolman
Overview
Introduction How MATLAB and Zemax communicate.
What is a DDE.
Testing Connection
Examining MATLAB code.
How to use code to link with Zemax.
Overview
Extracting Zemax Data
Loading a lens file (.ZMX).
Extracting data for analysis in MATLAB.
Introduction- DDE
DDE is a method for applications to pass
information to each other.
Client sends data and processing instructions.
Server returns processed data.
Zemax is server.
ddereq
Sends requests to Zemax (server).
ddeterm
Closes the channel between the two applications.
A reference number
to pass the channel
to the other three
Commands.
The application
to act as the
server, in our
case Zemax.
Optional: Format of
input and output in 2
element array; 1
string, 0 numeric,
default [1, 0];
% Main body of script. All commands are passed to ZEMAX using data items in
% chapter 26 using the ddereq MATLAB command.
Second command gets
name = ddereq(channel,'GetName', [1,1]);
the lens title displayed
disp(name);
% terminate DDE connetion
close = ddeterm(channel);
Source Position
Conclusion
You need three MATLAB commands:
ddeinit to initiate link with MATLAB
ddereq to tell Zemax what to do from MATLAB
ddeterm to terminate the link
Contact Details
Please direct questions to:
zemaxsupport@radiantzemax.com
eusupport@radiantzemax.com