필터 지우기
필터 지우기

External application stalls and locks up Matlab, tic/toc delay check does not work to pull Matlab out of stall.

조회 수: 3 (최근 30일)
I am iteratively calling an external application (OpenVSP) in a script via:
!vsp.exe -script runCalculations.vspscript
Sometimes this external app stalls or cannot converge on a solution and Maltab is unable to recognize that the elapsed time has passed the defined limit. How can I allow Matlab to actively identify this time limit during a stall or that OpenVSP has stalled at all? I have made an effort in the following code which is unable to detect the stall and timer. My next thought is to retain the process ID but that feels like it would have the same issues.
Cheers!
clear timer
timer = tic; yourDelay = 10; checkVal = false;
while ~checkVal
if toc(timer) >= (yourDelay-1)
% Detect the stall and break while printing an error
VSP_struct(iter).VSPstall = true;
warning('VSP Stall')
break;
else
% Run the code and break out of the loop
!vsp.exe -script runCalculations.vspscript
fprintf(' Calcs Done!')
checkVal = true;
end
end
  댓글 수: 5
Voss
Voss 2022년 7월 1일
% cmd = sprintf('taskkill /PID %d', p(1).Id, '/F');
cmd = sprintf('taskkill /PID %d /F', p(1).Id);
Walter Roberson
Walter Roberson 2022년 7월 2일
Does the System.Diagnostics.Process method allow Matlab to continue operating once executed rather than waiting on the process to complete like I have now?
Yes, definitely.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 PID Controller Tuning에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by