Skip to main content
Solved

Quickfocus in ZPL


zemax_user

Hi, I’m a bit confused that when I run the quickfocus command in ZPL, Zemax doesn’t always give me the same value, somehow I had to run my macro twice to get to the correct back focal length (my macro also changed wavelength and field setting). Is it normal to have this? Also, what would be a solution to fix this in the macro? I tried having quickfocus command twice inside the macro but it doesn’t help. Thank you very much.

[Mod note: moved to more appropriate forum for ZPL related discussions.] 

Best answer by MichaelH

If you’re changing system or lens settings inside a macro, you should always call an UPDATE ALL followed by a PAUSE THREADS to make sure your change has propagated down to the core.  Since you’re changing wavelength & field, the core hasn’t received these updates when you run QUICKFOCUS and the core only updates at a later point; when you run your macro a second time, the wavelength & field are already changed so QUICKFOCUS now works as expected.

View original
Did this topic help you find an answer to your question?

2 replies

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 342 replies
  • Answer
  • July 27, 2022

If you’re changing system or lens settings inside a macro, you should always call an UPDATE ALL followed by a PAUSE THREADS to make sure your change has propagated down to the core.  Since you’re changing wavelength & field, the core hasn’t received these updates when you run QUICKFOCUS and the core only updates at a later point; when you run your macro a second time, the wavelength & field are already changed so QUICKFOCUS now works as expected.


zemax_user
  • Author
  • 8 replies
  • August 4, 2022

Hi Michael, thank you very much for your reply! This makes a lot of sense and it’s working as expected now. 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings