When I look through the ASCII text of a lens prescription file, I notice that the commands are in different groups. How many different groups are there? Do I have do worry about these groups when I am creating different macros?
Managing different editing modules
The different groups of commands that you are seeing in the lens prescription text file correspond to different editing modules within OSLO. When you are programming in OSLO, it is very important to understand how these editing modules work, how to enter and exit them and how the modules affect command syntax.
Why do I need different editing modules when programming?
If you wanted to change the thickness of one of your surfaces in a lens design, the approach would be straightforward. You would just need the command to change the thickness, the surface you want to change and the value you want to change the thickness too. But what if you wanted to change the thickness in only one configuration. That would require an additional parameter: the configuration number that you wanted to change the thickness in. In OSLO, even though a command may have one name (i.e. TH changes thickness) that command may have different arguments for different editing modes.
How many different editing modules are there?
There are 5 different editing modules:
How do I enter and exit the different modules?
To get into the modules, just use the module name followed by what action you want to do. For instance, do you want to start fresh (delete previous module items)? Do you just want to update module items? To start a fresh lens, you would enter the LEN module with the NEW parameter: LEN NEW;To update an existing lens, you would enter the LEN module with the update (UPD) parameter: LEN UPD;To exit each of the modules, you use the END command. END;Let's put a short sequence together. Let's assume that you want to update the thickness of surface 4 to be 3.52 within the LEN editing module. The complete sequence of commands would be:
LEN UPD; GTO 4; TH 3.52; END;
But I thought that I could change some lens parameters without being in an editing mode. How does that work?
Yes, you can edit some lens parameters from outside of any editing mode, but the command arguments will be different. In the example above of changing the thickness, the surface designation was changed outside of the TH command. Instead, we used the GTO command. When you are outside of an editing mode, you will typically need to include the surface information in the command arguments. Using our previous example, when used outside of the LEN editing mode, the thickness command looks like: TH 4 3.52;
That looks a lot easier. Why would I ever use the LEN editing mode? While the LEN editing mode does have alternative commands that can be used outside of it, the other modes do not. Also, while inside the different editing modes, OSLO does not perform any evaluation procedures such as calculating solves or pickups. Think about the situation where you may want to enter 900 x, y & z data points on a spline surface. This would require over 2700 commands to be executed (although they could be done in a loop). If you entered these as individual commands, OSLO would have to rectify solves and pickups after each command. If you entered the commands within the LEN editing module, then OSLO would only have to rectify solves and pickups once when you exited the LEN editing module.
THE BOTTOM LINE: If you just want to enter or change a single lens parameter or two, then working outside of the LEN editing module makes sense, otherwise it makes sense to work within the framework of the LEN editing module.
If commands work differently in different editing modules, how do I tell the difference? Let's take the example of the TH command. Search in the online help for TH* (note that * is a wildcard character in searching on-line help). You will note that there are three instances of the TH command that are found: th, th_l, and th_c. The _l and _c notations indicate that these commands are to be used in the LEN and CFG editing modules (respectively), and the raw th command is to be used outside of an editing module. The appropriate online help page describes the different syntax of each command.
NOTE: The _l and _c notations should not actually be used in your commands, they are only used to identify the differences in the base command for the purposes of online help.
A FINAL NOTE:
When using different editing modes in your programming, OSLO will require that the surface data spreadsheet be closed. So it is best to manually close the spreadsheet before executing your commands or prompt the user to close the spreadsheet at the beginning of your command.