How do I wait for a license to become available?
16 views (last 30 days)
Show older comments
I am on a network license with a limited number of licenses. If all the licenses for a particular product are checked out, and I try to use a command from that product, the command will fail. I would rather wait until the license is available before continuing my program.
Accepted Answer
MathWorks Support Team
on 28 Jun 2010
You can use the LICENSE command to stall until the license you need is available. Suppose you want to wait until a license of Real-Time Workshop is available.
license('checkout','Real-Time_Workshop')
will return either 1 or 0 depending on whether the RTW license is available or not. You have a block of code such as
while (~license('checkout','Real-Time_Workshop'))
% do nothing and wait indefinitely
end
% license checkout is successful, continue with rest of program
that will wait until the license is available.
0 Comments
More Answers (0)
See Also
Categories
Find more on Manage Products 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!