Working with a task where an old ZPL macro should be converted to a standalone application in C++ (using ZOS-API). I have encountered several macro commands that I cannot find any description for in manual/help.
Is there anyone here that have the knowledge of what the corresponding calls with ZOS-API would be?
Anything with a () is a function, not a keyword. Check the manual for ZPL functions.
Also, we added SetSystemProperty and SetSurfaceProperty some years back and deprecated the old functions. They still work, but are not recommended for use in new macros.
Mark
Hi Mark,
Thanks for your reply. I understand that the macro calls are functions when used with (). I have looked and the ZPL manual and read it.
The problem is that I don’t understand how I can access the same functionality when using ZOS-API (what class and function to access).
Example: Where can I for example find the lense data/configuration in ZOS-API?
// Henrik
Hi @Henrik A,
I’m assuming:
THIC(0)
returns the thickness at Surface 0, because this is not even documented in the Help File anymore (as pointed out by @Mark.Nicholson). Also note that the image surface number is the number of surfaces minus one because surfaces start at zero. The equivalent in a C++ standalone application would be:
int numberOfSurfaces = TheSystem->LDE->NumberOfSurfaces; int imageSurfaceIndex = numberOfSurfaces - 1;
int currentConfiguration = TheSystem->MCE->CurrentConfiguration; int numberOfConfigurations = TheSystem->MCE->NumberOfConfigurations;
I suggest looking at the Programming..ZOS-API Help..Syntax Help and browse the examples which are in all four langages including C++.
One more recommendation, I usually use C# and I strongly advise to do so if you can. I think the ZOS-API itself is C# based and it is easier to manipulate it with C# imo.
Hope this helps and take care,
David
Thanks David,
Hey guys,
THIC() is documented in the manual, but in the section on ZPL functions, not keywords. Look at The Programming Tab > About the ZPL > Numeric Functions for details:
You’ll find NCON(), NSUR() etc all there too
I think you’ll get the ZOS-API equivalents in the section on ISystemData TheSystemData, like so:
There are equivalent .NumberOfWavelengths, .NumberOfConfigurations etc under the relevant objects
Mark
Thank you @Mark.Nicholson, I somehow wasn’t awake when I checked the Help File… Sorry for the oversight.