GUI to interface Matlab with Omicron (Significance of the syntex used)

7 次查看(过去 30 天)
invoke(test, 'CMDevlock', hEngine, Info2(1)')
what is the difference between the above code and the one below?
invoke(test, 'CMDevlock', hEngine, Info2(1))
is the any significance of " ' " after info2(1)?

采纳的回答

Walter Roberson
Walter Roberson 2020-1-17
It is not impossible that there is a significance to the ' at that point, but chances are not high.
For there to be a significant difference, one of the three circumstances would have to hold:
1. Info2 could be a function that when invoked with parameter (1) returns a nonscalar result that is being passed to the function. In this case, the ' would transpose the array before passing it down ; or
2. Info2 could be an object class that for some reason defined a custom ctranspose method. This would be rare and typically would be a bad interface
3. Info2 could simply be a value that is potentially complex valued and for some reason it is appropriate to pass in its complex conjugate. This can happen; it just doesn't look likely in context.
Most of the time I see this, the author has had a temporary brain glitch in how they are thinking about an array and the ' is not needed in context.
  4 个评论
Tejas Rivonkar
Tejas Rivonkar 2020-1-17
% define COM Object
test = actxserver('omicron.cmengine.1')
% Get the Version No of CMEngine
% Number = (Int) return version as Int
% Version = (string) return version as string (e.g. 2.10.1819.SR2)
[Number , Version] = invoke (test, 'CMVersion')
% Get a handle that you need to access the other interface functions of CM
% Engine from your computer program
hEngine = invoke(test,'CMGetEngineHandle')
% Scan ports for connected CMCs
invoke(test, 'CMDevScanForNew', hEngine)
% Get a list of all connected CMCs
% Info1 = (Bool) return '1' when command was excecuted without errors
% Info2 = (String) returns:
% - Device ID No of CMC
% - Serial No
% - LPT port
% - CMC Device Address
[Info1, Info2] = invoke(test,'CMDevGetList', hEngine , 1)
% Before you can work with a CMC device, you have to lock it. The parameter
% '1' is the Device ID of the CMC (see CMDevScanForNew)
invoke(test, 'CMDevlock', hEngine, Info2(1)')
This is how info2 is defined as
the previous codes follow after this.
thanks you for answering so far

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by