Solved

Quickfocus in ZPL

  • 27 July 2022
  • 2 replies
  • 182 views

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.] 

icon

Best answer by MichaelH 27 July 2022, 23:34

View original

2 replies

Userlevel 6
Badge +2

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.

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

Reply