Solved

MATLAB and ZOS 24.1

  • 24 January 2024
  • 1 reply
  • 90 views

Hi,

After installing the latest version of Zemax OpticStudio (24.1), I’ve been having trouble with MATLAB scripts that interface via the ZOS-API. In particular, when running the initial boilerplate code to establish a connection between MATLAB and Zemax, I receive the following error:

 

"Could not load file or assembly 'Google.Protobuf, Version=3.23.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' or one of its dependencies. The system cannot find the file specified."

 

This occurs for all MATLAB scripts (example attached) and seems to relate to the InitConnection function. I have had to rollback to the previous version of Zemax (23.2.1) to use my MATLAB scripts. 

 

Has anyone else encountered this issue and does anyone know of a solution?

 

Thanks,

 

Michael

icon

Best answer by MichaelH 24 January 2024, 18:07

View original

1 reply

Userlevel 6
Badge +2

Hi Michael,

I’m totally guessing here, but these are my thoughts.

It appears that the Google.Protobuf.dll is data exchange protocol for serializing/deserializing structured data (similar to saving a Matlab struct as a .MAT file).  This could be used either to save & load data or to pass data from one application to another.

Ansys Zemax OpticStudio 2024 R1 (not the legacy Zemax OpticStudio 24.1 release) has several features which might use a new data saving structure including:

  • improved ZRD segments including TIR flag, OPL, & diffraction orders
  • improved export to PanDao (2023 feature)
  • improved Speos export

The Ansys version includes the Google.Protbuf.dll but my guess is the Zemax legacy version doesn’t.  Since this is the last version of the Zemax legacy version that will be release, my guess it probably made it past testing because the Zemax team only tested for Ansys Zemax, not Zemax, when making sure the ZOS-API provides consistent results from the previous version. 

I would go ahead and file a bug report so this can be fixed in the service pack to make sure the last version of Zemax doesn’t have a bug in it.

Reply