We are troubleshooting an issue impacting community login, and it may be intermittently unavailable. Sorry for any inconvenience.
Hello PTC community,
i'm trying to call the MKS Java Api from MATLAB (Release 2010b 32 bit).
This is because I want to avoid having an external java-class since our main code is all in MATLAB and running Java classes in Matlab was never an issue before.
It all looks good at the beginning, however, when running the cmdRunner-Class, i encounter a Java exception.
Below is an excerpt of the code (MATLAB M-File format) that i'm trying to run. The full m-file with more information is also attached.
When I run the same code from an external Java class in the JRE, everything is working fine. (Thus it shouldn't be the connection to the server)
Is there somebody who could help me with this? Any help would be greatly appreciated.
Thanks,
Stefan
javaaddpath('C:\Matlab\WORK\mksapi.jar');
javaclasspath('-dynamic');
import java.util.List;
import com.mks.api.*
import com.mks.api.response.*;
import com.mks.connect.*;
ipf = IntegrationPointFactory.getInstance();
APIVersion=util.APIVersion(4,11); % Was also tested with 4,15
IntegrationPoint = ipf.createIntegrationPoint('SERVERNAME',7001,true,APIVersion);
Session = IntegrationPoint.createSession('USERNAME','PASSWORD');
CmdRunner = Session.createCmdRunner();
% CmdRunner-Test:
CmdRunner.toString()
% Answer:
% com.mks.connect.HttpCmdRunnerImpl@2bce4f
cmd = Command(Command.SI,'about');
resp = CmdRunner.execute(cmd);
% Answer:
% ??? Java exception occurred:
%
% (no more information...)
Solved! Go to Solution.
Hi
You can have a look to the MATLAB code provided in the PTC "MathWorks Integration".
Download from https://support.ptc.com/
under Features "Mathworks Integration".
HTH.
Thierry
Hello Stefan,
I suspect the intersection of Integrity & MatLab users is quite small here. Please contact PTC Integrity Lifecycle Management Support to open a case to investigate with you.
Regards,
Kael
Hi
You can have a look to the MATLAB code provided in the PTC "MathWorks Integration".
Download from https://support.ptc.com/
under Features "Mathworks Integration".
HTH.
Thierry