Simulink setConfig showing error while Updating References for each worker in parallel parfor
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am running Simulink Model, which is set to Never Rebuild, in parfor.
Looks like setConfig is showing error with Simulink Model References are being updated.
This is resulting in following error:
Error using Simulink.fileGenControl A build is in progress. During a build the only actions allowed are:
'getConfig'
'get'
Error in Simulink.fileGenControl
Note:
It's required to define CacheFolder & CodeGenFolder for each run although its a same folder.
Code Outline:
% Running first time to create slprj folder
buildFolder = 'C:\Users\Documents\Work\temp';
cfg = Simulink.fileGenControl('getConfig');
cfg.CacheFolder = buildFolder;
cfg.CodeGenFolder = buildFolder;
Simulink.fileGenControl('setConfig', 'config', cfg);
open_system('Simulink_Model')
sim('Simulink_Model')
parfor i=1:3
buildFolder = 'C:\Users\Documents\Work\temp';
cfg = Simulink.fileGenControl('getConfig');
cfg.CacheFolder = buildFolder;
cfg.CodeGenFolder = buildFolder;
Simulink.fileGenControl('setConfig', 'config', cfg);
open_system('Simulink_Model')
sim('Simulink_Model')
end
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Deep Learning with Simulink dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!