필터 지우기
필터 지우기

.net programming unable to use existed methods

조회 수: 1 (최근 30일)
Ganwei Yan
Ganwei Yan 2019년 9월 26일
답변: Steven Lord 2019년 9월 26일
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

채택된 답변

Steven Lord
Steven Lord 2019년 9월 26일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 .NET Methods in MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by