Find us on. Search for:. Current Version Release Notes. Search is exclusively for the Knowledge Base. Quickly locate KB articles based on specific search terms or phrases. Soon, we will launch a new and updated customer portal, which is an important step toward providing our customers with one place to learn, interact, and get help.
Learn more. This article describes how to use strings and the string related capabilities of ZPL including:. You may, in fact, already be using ZPL to perform custom calculations, post process your data or even create you own optimization operands.
The capabilities of ZPL, though, go far beyond numeric variable operations and number crunching. In fact, ZPL also includes support for string variables.
There are a variety of string operations and functions that are built into ZPL allowing you to utilize string variables in a variety of ways. Using the string capabilities of ZPL, you can: Work with non-numeric surface data such as glasses, coatings and comments Change the name of a file Determine the lens units being used in a file Reduce repetitive text entry in a macro Customize labels for data analysis summaries and plots and more!
This article will introduce you to ZPL string variables, string operations, string logical operators and string functions.
Zemax Programming Language – 3.11 Multi-Configuration
Each string variable can hold up to characters. String variables can be declared just like numeric variables except for one important difference. The corresponding macro command would be: Note that a literal string must be surrounded by double quotation marks when assigning the string to a string variable.
This operator can be used to combine multiple string variables, multiple literal strings or a mixture of string variables and literal strings together. Remember, literal strings must be surrounded by double quotation marks. Here is an example of a string variable and a literal string concatenated together into another string variable: A PRINT keyword can then be added to output the concatenated string.
The following macro code: will output: String variables and literals can also be combined directly by the PRINT keyword. For example: will also output: String Logical Operators ZPL can be used to evaluate string variables in many of the same ways that numeric variables can be evaluated.
This includes applying logical operators to compare strings. Both types of functions return data. The fundamental difference is that numeric functions return numeric data while string functions return alphanumeric data. Like numeric functions, the name of each string function must be followed by an open then closed parenthesis. In the case of some string functions, one or more arguments will be required between the two parentheses.
Many string functions are used to return information about the currently loaded lens file. There are also string functions which can be used to parse string variables stored in the same macro that the string function is called.
This function returns the glass name of the i th surface. This function will return the n leftmost characters in a string. Sequential Ray Tracing. CAD Exchange.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Skip to content. Permalink Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. Branch: master. Find file Copy path. Cannot retrieve contributors at this time. Raw Blame History. Each operand is a four character code.
The TRAR operand, when listed in the Merit Function Editor, causes a single ray to be traced whose aberration value is returned in the "value" column. See also DISA. If Surf is zero, the sum for the " "entire system is used.
This is the third order astigmatism " "calculated from the Seidel coefficients, and is not valid for " "non-paraxial systems""ATAN" : "Arctangent of the value of the operand defined by Op. Returns the convergence between two eye " "configurations in milliradians. Returns the dipvergence between two eye " "configurations in milliradians.
Used for separating portions of the operand list. Computes the minimum thickness of the glass blank required to create the volume following the surface defined by Surf. This operand uses the Huygens PSF to determine the x coordinate of the centroid for any field point.
See CEHX. See CNAX. Returns the conic constant of the surface defined by Surf. See also MNCT. Computes the diff. The wavelength used is " "defined by Wave. This is paraxial, and may not be accurate " "for non-paraxial systems. See also RELI. This operand computes the x or " "y position of the point at which the edge response function " "reaches a certain relative value.
See also MNET. See also MXET. See also FCGS. See FDMO. See also FICP.From here you can edit your personal informationmanage the products you receive from us, and tell us more about yourself to help us provide you with personalised recommendations for articles and more. If you wish to deactivate your account, visit our deactivation page. If you wish to logout, click here. You may be prompted to sign in again in order to view our content.
Your account gives you full control over what you receive from us. You must have an active account and be logged in to access certain parts of the website. Within your account, you will also have the option to receive information from us, such as our magazine and our email newsletters. You may opt in or out of any of these options at any time, and may deactivate your account by contacting us. We also ask a few questions about you and the information in which you are interested - these are optional, but help us ensure we can deliver you a more personalised experience on our site.
Zemax has released OpticStudio OpticStudio It also offers a new express view for editors, allowing engineers to navigate files with large numbers of surfaces, objects, or operands with greatly improved responsiveness and reduced lag time from buffering data. A new Zemax file collector tool also allows users to easily gather data and diagnostic information necessary to troubleshoot any potential issues with designs.
In addition, three new optimisation operands help optical engineers control problematic rays at the edges of the pupil without the use of macros or compound operands, as well as reduce the impact of ghost reflections in the optical system. Lastly, an improved design lockdown tool enables engineers to prepare a sequential optical system with multiple configurations for optomechanical analysis and production.
Skip to main content Do NOT follow this link or you will be banned from the site! Latest issue. UV light solutions deployed in fight againstForums Latest Popular Unread. Start New Topic. Unsupported customers may still access a community forum and downloads. New Forum. Abe x3. Achmed x4. Adult galleries x6. Adult placement x5. Aidan x5. Aila x3. Akrabor x6. Aldo x6. Ali x6. Alima x5. Altus x3. Anog x4. Armon x4. Arokkh x5. Asam x5. Asaru x3.You can now purchase a paperback version of this book from Amazon :.
For a beginner who wants to master the tool of ZPL, this is a good tutorial to make your learning process less stressful and more fun. Even if you are an experienced Zemax user, it is still a good idea to keep this book as a reference. In optical design, often times we will need to add, delete or modify some components or parameters based on different working environment, such as designing focal length adjustable lenses, optimizing optical system at different wavelengths, etc.
In this section, we will discuss multi-configuration related commands in ZPL. We know that multi-configuration editor is the place to set and modify multi-configuration in Zemax. The syntax is:. If the config number is 0, then the value is interpreted as follows:. If the config number corresponds to a defined configuration then the value is interpreted as follows:. Now we will give some examples to show how to define and modify multi-configurations in ZPL program.
In this example, we want to build a multi-configuration system from scratch, so we need first create a new lens system from Zemax main window file menu. In the new system, we can see three surfaces in the lens editor. The last line in the program updates the optical system using keyword UPDATE to assure each parameter of the system is the newest value. After running program ex ZPL, if we open multi-configuration editor, the content can be seen as shown in figure 3.
Of course, this multi-configuration system is not optimized yet. If needed, we can choose proper variables and merit function to further optimize this system, depending on the design target. If config is 0, then the current configuration is chosen.
This function is similar to MCOP with extended capabilities for extracting data. The 3 integer values are used for various purposes for different operands, such as surface and wavelength numbers. The string flag is 1 if the operand data is a string value, such as a glass name, or 0 for numerical data. If the row number is between 1 and the number of multi-config operands, and the config number is valid, MCON returns either the numerical value or the string data for that operand.
In this example, we assume the multi-configuration system is the one defined in example 3. In line 28, the type of the operand data is first determined to be string or value. The result of the program is shown in figure 3. From the result we can see that both function MCOP and function MCON can be used to read the same data, such as total number of configurations line 7 and line 18current configuration number line 8 and line 19or data of the given row in the given configuration line 12 and line 36and the results are the same.
In this example, since the operand only has one parameter, the return values of the second and third parameters are 0. Thanks for reading. A pdf version of the contents of this series of blog plus some more real application examples, as well as all the.You can now purchase a paperback version of this book from Amazon :. For a beginner who wants to master the tool of ZPL, this is a good tutorial to make your learning process less stressful and more fun. Even if you are an experienced Zemax user, it is still a good idea to keep this book as a reference.
Lens Data Editor is an important place to do lens design in Zemax. As we know, in sequential ray tracing, Zemax defines an optical system as being made up of various surfaces, and most of the properties related to surfaces are set in Lens Data Editor.
In this section, we will discuss how to set and read lens surface properties in ZPL through various examples. The syntax is:.
The code may either be an expression that evaluates to an integer or a mnemonic which specifies what property of the surface is being modified.
The third and fourth arguments are the new values for the specified property, and they may be either text in quotes, a string variable, or a numeric expression, depending upon the code.
For most codes, the property value being modified is defined by the value1 argument. A few operands require both a value1 and a value2, as described in the table below.
It needs to be noticed that after the surface properties were set or modified, keyword UPDATE is usually needed to update the surface properties. Please note that code can only be an integer and cannot be mnemonic. The main difference between the two functions is that SPRO supports commands with one argument in table 3.
Zemax Programming Language – 3.5 Merit Function
Among the surface-related properties, the material of the surface is a very important one. In table 3. The glass parameters are stored in vectors VECn n is 1, 2, 3 or 4 according to table 3. We will give some examples to show how to set and read important surface related parameters in ZPL. Assume the basic parameters of the doublet is:.OpticStudio 17 Beta Program: Ignore Tolerance Operands
After some simple calculation omitted herewe can get initial parameters of each surface of the doublet. In this example, we will use these parameters to construct the doublet. Later on in other examples we will have opportunities to further analyze and optimize this doublet. In our program, we need to set some system parameters such as the type and size of the system aperture, type and size of field, working wavelength, etc. After that, we need to insert enough number of lens surfaces, and input lens data.
The program is shown below:. At the end of the program, we updated the system to assure the data are accepted. This example just shows how to do it through ZPL program. For the doublet constructed in program ex, we can read various parameters through ZPL program.
Some examples are given below. In this program, we first read the total number of surfaces of the the system line 7then for surface 3, we read surface type lines 11 and 12comments lines 16 and 17curvature lines 21 and 23radius line 25thickness lines 29 and 31 and material lines 35, 36 and 38and finally we read the surface number of the stop lines 42 and We can see that when using function SPRO to read string information such as surface type, comments, etc. Please note that different from directly calling numeric function in line 9, since PRINT command cannot directly call string function, the program needs to store the result in a string variable in line 13 first, and then print out the result in line The information read with keyword is stored in the default array VEC1, and can be easily read out.
The result of the program is shown in figure 3. Thanks for reading. A pdf version of the contents of this series of blog plus some more real application examples, as well as all the.Important Notice: In an effort to assist the global community in limiting the spread of the coronavirus, Zemax has cancelled all scheduled public training courses until further notice.
We are investigating alternate models of delivering training and will provide updates on this in the coming weeks. In the meantime, if you have already registered and paid for an upcoming training class, your payment will be held as credit to a future course.
If you prefer to get this refunded, please contact sales zemax. Led by expert optical engineers, our hands-on courses teach the most useful optical design techniques. Optical System Design. Assumes a background in optics or completion of Fundamentals of Optics course. No prior knowledge of OpticStudio is required. This course provides a solid introduction to the OpticStudio sequential design environment. Attendees will acquire the skills to design, optimize, and tolerance imaging systems through hands-on exercises.
Familiarity with illumination or imaging systems encouraged. No prior knowledge of OpticStudio required. This course provides a comprehensive introduction to the OpticStudio non-sequential design environment, and is intended for those working on illumination systems or evaluating stray light in imaging systems.
Attendees will acquire the skills to design, optimize, and tolerance systems through hands-on exercises. Day 4: Stray light analysis, scattering, and switching between sequential and non-sequential mode. Model, analyze, optimize, and tolerance illumination, imaging, and collimation systems in non-sequential mode.
Build mixed sequential and non-sequential systems, like prisms, fibers, or other systems that generate total internal reflection TIR. Prerequisites Familiarity with illumination or imaging systems is encouraged. Advanced Optical System Design. Day 2: Diffraction, thin-film coatings and polarization, and introduction to freeforms and aspheres. Use physical optics propagation, Gaussian beams, and geometric rays to simulate lasers and optical fibers, and explain when to use each tool.
Programming OpticStudio. Indispensable training for anyone wanting to write their own code to control OpticStudio or interface it to other programs. Learn Zemax Programming Language ZPL macro programming, how to create user-defined features surfaces, objects, sources, etc. Prerequisites Experience with OpticStudio and at least one high-level programming language is required.
Topics Day 1: Introduction to OpticStudio and review of first- and third-order optics Day 2: Overview of optimization Day 3: 3D systems, multiple configurations, and image simulation Day 4: Tolerancing simple systems Day 5: Real-world tolerancing scenarios Skills gained Model and analyze the performance of simple sequential systems in OpticStudio Build merit functions to optimize system performance Identify system sensitivities and predict manufacturing and assembly yields Prerequisites Knowledge of fundamental optical concepts.
Programming OpticStudio Indispensable training for anyone wanting to write their own code to control OpticStudio or interface it to other programs.