Borrar filtros
Borrar filtros

.net programming unable to use existed methods

1 visualización (últimos 30 días)
Ganwei Yan
Ganwei Yan el 26 de Sept. de 2019
Respondida: Steven Lord el 26 de Sept. de 2019
It says The class Thorlabs.MotionControl.PolarizerCLI.Polarizer has no Constant property or Static method named 'GetDeviceInfo'. But I just copied the method from the list.
TIM图片20190926174340.png

Respuesta aceptada

Steven Lord
Steven Lord el 26 de Sept. de 2019
The key word in the error message is Static.
The output of methods that you've shown indicates the Thorlabs.MotionControl.PolarizerCLI.Polarizer class does have a method named GetDeviceInfo. It also shows that GetDeviceInfo is not a Static method of the class.
A Static method of a class can be called using the name of the class, without an instance of the class as input. A non-Static method must accept an instance of the class. I'm betting serialNo is not an instance of that class but is probably a normal double array.
Looking at the list of methods, you probably need to call one of the Static methods Thorlabs.MotionControl.PolarizerCLI.Polarizer.CreateDevice or Thorlabs.MotionControl.PolarizerCLI.Polarizer.CreatePolarizer to create an instance of that class. Once you have an instance you can call GetDeviceInfo on that instance, something like:
myPolarizer = Thorlabs.MotionControl.PolarizerCLI.Polarizer.CreatePolarizer(necessaryInputs);
devInfo = GetDeviceInfo(myPolarizer);
I have no idea what inputs the CreatePolarizer or GetDeviceInfo methods require. You may need to refer to the help or doc for that class to learn the right way to call those methods.

Más respuestas (0)

Etiquetas

Productos


Versión

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by