Skip to main content
Solved

Wavelength setting in ZPL


zemax_user

Hi, 

I have some issue with setting wavelengths correctly using ZPL. You can see that in my ZPL script I have the following 

ZPL script used

But in the system after running ZPL my wavelengths are actually set to the following, where the wavelength 6 is wrong. However, if I run the ZPL a second time, the wavelength 6 will show correctly as 430nm.

Zemax interface

I thought maybe it’s an issue of system hasn’t got enough time to update, but adding “Pause thread/update all” also didn’t help. Does anyone know how to fix this? Thanks!

Best answer by MichaelH

My first guess is you don’t actually have 6 wavelengths the first time you run the script.  At some point you are either calling SYSP 201, 6 after trying to set the 6th wavelength or you are manually enabling the 6th wavelength after running the script the first time.  Then, when you run the script a second time, there is already a 6th wavelength so the SYSP 202, 6, 0.43 sets the 6th wavelength correctly.  Can you confirm that you have a SYSP 201, 6 before calling SYSP 202, 6, 0.43.

If the order of ZPL commands isn’t the issue, can you please share your complete code?

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
  • August 29, 2022

My first guess is you don’t actually have 6 wavelengths the first time you run the script.  At some point you are either calling SYSP 201, 6 after trying to set the 6th wavelength or you are manually enabling the 6th wavelength after running the script the first time.  Then, when you run the script a second time, there is already a 6th wavelength so the SYSP 202, 6, 0.43 sets the 6th wavelength correctly.  Can you confirm that you have a SYSP 201, 6 before calling SYSP 202, 6, 0.43.

If the order of ZPL commands isn’t the issue, can you please share your complete code?


zemax_user
  • Author
  • 8 replies
  • August 29, 2022

Hi MichaelIH,

 

Thanks so much for the quick reply. You’re right, I only had 5 wavelengths in my system and I didn’t call SYSP 201, 6 until later. I thought by calling SYSP 202,6, 0.43 it will automatically add the specified wavelength. Now it’s fixed, thanks again for the quick fix!


Reply


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