try/catch with timeout
18 views (last 30 days)
Show older comments
I have an instruction block with communication to external components, enclosed in try/catch. However, instead of throwing an exceptionand skipping to the "catch" part, the execution simply stalls under certain conditions. Is there any way top realize something like
try (max execution time x seconds)
instructions with possible stall
catch ME
will be executed either if instructions within try throw an exception or their execution takes more than x s
end
1 Comment
Rik
on 18 Mar 2021
As far as I'm aware, this is only possible by spawning a new process, which then needs to signal to the main process that it is done by writing a file or something similar.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!