Invoke Error, Dispatch Exception: Exception Error Occurred
49 views (last 30 days)
Show older comments
Hi,
After creating a .COM object for SAP2000 from MATLAB I run a for loop with one API command. The loop looks something like this:
for i = 1:333
[a b c] = SAPObject.SAPModel.APIcommand(input arugments);
end
I am trying to run this code when this occurs:
"Interface.a string of numbers and letters/API command"
"Invoke Error, Dispatch Exception: Exception Error Occurred"
What's surprising if I run the for loop for any one number, say "i = 1" or "i = 4", and it runs successfully but when I try to loop through a range of numbers, it generates error.
Thanks in advance for your help.
0 Comments
Accepted Answer
Walter Roberson
on 26 Apr 2012
This isn't necessarily a MATLAB issue: COM interfaces can be sensitive to 32 vs 64 bit.
You can write your code to detect 32 vs 64 bit: http://www.mathworks.com/support/solutions/en/data/1-2HBX9L/index.html?solution=1-2HBX9L . With all the currently supported versions, if computer() or mexext() end in '64' then you have a 64 bit version and otherwise you have a 32 bit version. You can use this information to set typename strings for use with ones() or zeros() or cast() or NaN() or inf()
More Answers (1)
Peeyush
on 26 Apr 2012
2 Comments
Guy Reading
on 12 Jun 2019
I realise this was asked a long time ago, but just in case others are looking for help here, I believe the problem may be in where you're registering your .com object.
There's a folder for 64 bit objects and another folder for 32 bit. This is in the (Windows) OS architecture, nothing to do with MATLAB, but you'll need to register the .com object in the right folder.
For 32 bit, it's C:\Windows\SysWOW64.
For 64 bit, it's C:\Windows\System32
This may help, I'd also invite you to research this independently as I'm not an expert with this, but it helped me a few times in the past.
supriya Naik
on 10 May 2022
Error using Interface.4E4ADE7E_0FB6_430F_9D1B_1A66C6A69953/GetPropertyValue
Error: Object returned error code: 0x80070202
Can you explain what is the meaning of this error, during ansys matlab interfacing?
See Also
Categories
Find more on Use COM Objects in MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!