Weird issue with Simulink model

조회 수: 5(최근 30일)
Lucas
Lucas 2012년 8월 28일
At work I’m working with a new version of the model that I’ve been working with. In the previous version of the model I haven’t had any problems at all, but now I’m running into a weird one right now.
If I open the model, do a search (find) on the model with a name, I only get one result. But if I type:
find_system('FindAll', 'on', 'Name', 'VariableName')
it return multiple instances of the name. This causes my tool to do not work properly. Has anyone seen an instance where find returns a number of instances but find_system returns a different number. All the instances of the handles I got from find_system are centered around the single instance returned from find.

채택된 답변

Albert Yam
Albert Yam 2012년 8월 28일
편집: Albert Yam 2012년 8월 28일
find_system(gcs,'FindAll', 'on', 'Name', 'VariableName') %needed a sys
I've never used the edit > find, but when I used find_system, something about finding the subsystem (or root) name of what you are centered on (rather than just everything inside the subsystem). But I don't think that is your problem.
Just did a little test. [const,line,scope] all named. The find_system, found the PORT, and the signal, the edit>find, only found the signal.
Suggest, add BlockType as a parameter.
What Simulink are you using? [6.6.1 here]
EDIT:
>> sx = find_system(gcs,'FindAll', 'on', 'Name', 'sigx')
sx =
1.0e+003 *
1.8550
0.0180
>> set_param(sx(1),'null','1')
??? Error using ==> set_param
port does not have a parameter named 'null'.
>> set_param(sx(2),'null','1')
??? Error using ==> set_param
line does not have a parameter named 'null'.
  댓글 수: 7
Albert Yam
Albert Yam 2012년 8월 29일
Hm.. are you sure that your script, or some callback isn't open_system/load_system anything? I wonder if there is a way to see what systems are open/loaded. I don't know how model referencing works, I'm wondering if it has some affect if it is referenced more than once.
By 6 instances, you just mean 6 windows open right? You can close 5 of them and save, next time you open it should just be the one (or specifically choose what you want to open), just for convenience though.

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

추가 답변(0개)

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by