I am not really a specialist in this topic, so please excuse possible hiccups in formulating the question. We are running two programs under Windows, Zemax and Matlab, where Matlab controls Zemax via .NET COM interface. (The fact that it’s Zemax is not critical for this question, it’s just to be specific.) The Matlab code looks like this: If Matlab