ZPL Macros: What FUNCTIONS and KEYWORDS are replaced or obsolete?

  • 16 March 2020
  • 3 replies
  • 249 views

Userlevel 4
Badge

There are times when we run an old ZPL Macro and it may not work in the newest version of OpticStudio. This happens because FUNCTIONS and KEYWORDS are obsolete, even though Zemax/OpticStudio have not made any KEYWORDS obsolete since before 2006, and only 1 function obsolete in the past 5 years.

The table below is for mapping the FUNCTIONS/KEYWORDS. If you have a macro that doesn't work and are forced to use Zemax 13 or earlier, perhaps you can check the table below and lookup what the old code is to manually map it and make it work in the newest version of OpticStudio.

Feel free to add any we've missed in the comments section, and I'll update the main post.

 

 

Type

 

Old

 

New

 

Comment

 

Function

 

FVAN(x)

 

FTAN(x)

 

 

 

Function

 

STDD(surf, 0)

 

SPRO(surf, 60)

 

 

 

Function

 

STDD(surf, 1)

 

SPRO(surf, 61)

 

 

 

Function

 

STDD(surf, 2)

 

SPRO(surf, 62)

 

 

 

Function

 

STDD(surf, 3)

 

SPRO(surf, 63)

 

 

 

Function

 

STDD(surf, 4)

 

SPRO(surf, 64)

 

 

 

Function

 

STDD(surf, 5)

 

SPRO(surf, 65)

 

 

 

Function

 

STDD(surf, 6)

 

SPRO(surf, 66)

 

 

 

Function

 

STDD(surf, 7)

 

SPRO(surf, 70)

 

 

 

Function

 

STDD(surf, 8)

 

SPRO(surf, 71)

 

 

 

Function

 

STDD(surf, 9)

 

SPRO(surf, 72)

 

 

 

Function

 

STDD(surf, 10)

 

SPRO(surf, 73)

 

 

 

Function

 

STDD(surf, 11)

 

SPRO(surf, 74)

 

 

 

Function

 

STDD(surf, 12)

 

SPRO(surf, 75)

 

 

 

Keyword

 

APMN surf, value1

 

SURP surf, 21, value1

 

 

 

Keyword

 

APMX surf, value1

 

SURP surf, 22, value1

 

 

 

Keyword

 

APTP surf, value1

 

SURP surf, 20, value1

 

 

 

Keyword

 

APXD surf, value1

 

SURP surf, 23, value1

 

 

 

Keyword

 

APYD surf, value1

 

SURP surf, 24, value1

 

 

 

Keyword

 

COAT surf, value1

 

SURP surf, 8, value1

 

Marked as obsolete in Help Files

 

Keyword

 

COMMENT surf, value1

 

SURP surf, 1, value1

 

 

 

Keyword

 

CONI surf, value1

 

SURP surf, 5, value1

 

 

 

Keyword

 

CURV surf, value1

 

SURP surf, 2, value1

 

 

 

Keyword

 

EDVA surf, value1

 

SURP surf, 11, value1

 

 

 

Keyword

 

GLAS surf, value1

 

SURP surf, 4, value1

 

 

 

Keyword

 

PAR1 surf, value1

 

SURP surf, 10, value1, 1

 

 

 

Keyword

 

PAR2 surf, value1

 

SURP surf, 10, value1, 2

 

 

 

Keyword

 

PAR3 surf, value1

 

SURP surf, 10, value1, 3

 

 

 

Keyword

 

PAR4 surf, value1

 

SURP surf, 10, value1, 4

 

 

 

Keyword

 

PAR5 surf, value1

 

SURP surf, 10, value1, 5

 

 

 

Keyword

 

PAR6 surf, value1

 

SURP surf, 10, value1, 6

 

 

 

Keyword

 

PAR7 surf, value1

 

SURP surf, 10, value1, 7

 

 

 

Keyword

 

PAR81 surf, value1

 

SURP surf, 10, value1, 8

 

 

 

Keyword

 

RADI surf, value1

 

SURP surf, 2, 1 / value1

 

 

 

Keyword

 

SDIA surf, value1

 

SURP surf, 6, value1

 

 

 

Keyword

 

SETSTDD surf, 0, value1

 

SURP surf, 60, value1

 

 

 

Keyword

 

SETSTDD surf, 1, value1

 

SURP surf, 61, value1

 

 

 

Keyword

 

SETSTDD surf, 2, value1

 

SURP surf, 62, value1

 

 

 

Keyword

 

SETSTDD surf, 3, value1

 

SURP surf, 63, value1

 

 

 

Keyword

 

SETSTDD surf, 4, value1

 

SURP surf, 64, value1

 

 

 

Keyword

 

SETSTDD surf, 5, value1

 

SURP surf, 65, value1

 

 

 

Keyword

 

SETSTDD surf, 6, value1

 

SURP surf, 66, value1

 

 

 

Keyword

 

SETSTDD surf, 7, value1

 

SURP surf, 70, value1

 

 

 

Keyword

 

SETSTDD surf, 8, value1

 

SURP surf, 71, value1

 

 

 

Keyword

 

SETSTDD surf, 9, value1

 

SURP surf, 72, value1

 

 

 

Keyword

 

SETSTDD surf, 10, value1

 

SURP surf, 73, value1

 

 

 

Keyword

 

SETSTDD surf, 11, value1

 

SURP surf, 74, value1

 

 

 

Keyword

 

SETSTDD surf, 12, value1

 

SURP surf, 75, value1

 

 

 

Keyword

 

SURFTYPE surf, value1

 

SURP surf, 0, value # use 8 character code

 

 

 

Keyword

 

SURFTYPE surf, value1

 

SURP surf, 17, value # use integer code

 

 

 

Keyword

 

THIC surf, value1

 

SURP surf, 3, value1

 

 

 

Keyword

 

ATYP value1

 

SYSP 10, value1

 

 

 

Keyword

 

AVAL value1

 

SYSP 11, value1

 

 

 

Keyword

 

FLDX value1, value2

 

SYSP 102, value1, value2

 

 

 

Keyword

 

FLDY value1, value2

 

SYSP 103, value1, value2

 

 

 

Keyword

 

FWGT value1, value2

 

SYSP 104, value1, value2

 

 

 

Keyword

 

FVDX value1, value2

 

SYSP 105, value1, value2

 

 

 

Keyword

 

FVDY value1, value2

 

SYSP 106, value1, value2

 

 

 

Keyword

 

FVCX value1, value2

 

SYSP 107, value1, value2

 

 

 

Keyword

 

FVCY value1, value2

 

SYSP 108, value1, value2

 

 

 

Keyword

 

FVAN value1, value2

 

SYSP 109, value1, value2

 

 

 

Keyword

 

FTYP value1, value2

 

SYSP 100, value1, value2

 

 

 

Keyword

 

GCRS value1

 

SYSP 21, value1

 

 

 

Keyword

 

NUMFIELD value1

 

SYSP 101, value1

 

Marked as obsolete in Help Files

 

Keyword

 

NUMWAVE value1

 

SYSP 201, value1

 

Marked as obsolete in Help Files

 

Keyword

 

SETAPODIZATION value1

 

SYSP 13, value1

 

 

 

Keyword

 

SETTITLE value1$

 

SYSP 16, value1$

 

 

 

Keyword

 

SETUNITS value1

 

SYSP 30, value1

 

Marked as obsolete in Help Files

 

Keyword

 

TELECENTRIC value1

 

SYSP 14, value1

 

 

 

Keyword

 

WAVL value1, value2

 

SYSP 202, value1, value2

 

 

 

Keyword

 

WWGT value1, value2

 

SYSP 203, value1, value2

 

 

 

Keyword

 

PWAV value1

 

SYSP 200, value1

 

 

 

 


3 replies

Userlevel 7
Badge +3
Hey Kats, thanks for this. Am I correct that the obsolete stuff is still there, and macros that call them still work, or has that changed?



BTW, you can check your macro for obsolete syntax using the CheckObsoleteSyntax checkbox on the Run/Edit window



Userlevel 4
Badge
Hi Mark, my understanding is that the obsolete function do not work, and I have heard of some of our customers that still use Zemax 13 since they cannot pinpoint which functions are obsolete. I am hoping this can be a starting point for people to update macros that are essential in their design process.



Thank you for pointing out the CheckObsoleteSyntax, this is great additional information for the thread!
Userlevel 7
Badge +3

Hey Kats,



Yes, if anyone is using old syntax, it should be picked up by the syntax checker, like this, erm, example from the current distribution:







I am surprised that any obsolete keywords have been removed from the code without that removal being documented by someone. It always used to be policy that changes to .ZMX and .ZPL files always be backwards compatible, so when we added SETSYSTEMPROPERTY to replace the hundreds of separate RADI, THIC, PWAV etc, we kept all the old syntax specifically so as to not blow up existing macros. Surely it must be possible for the developers to say what, if any, macro commands have been specifically removed? Somebody must have done it... 


Reply