Skip to main content
Solved

MATLAB and ZOS 24.1

  • January 24, 2024
  • 1 reply
  • 199 views

Dr Michael.Spurr

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

Best answer by MichaelH

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.

View original
Did this topic help you find an answer to your question?

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • January 24, 2024

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings