필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

can I modify how a global data store is represented in generated code?

조회 수: 2 (최근 30일)
Michael
Michael 2016년 2월 2일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a model with several masked subsystems. These masks set values for constant blocks inside of the subsystem which are then used for simulating various things. I'd like to replace these constant blocks with DataStoreReads and the several debug displays with DataStoreWrites so that I can better manage/keep track of them. When I tie these DataStoreReads/Writes to a local DataStore and generate code (encapsulated C++), I get header files defining my struct and the the DataStore instantiated inside of the ModelClass. If I then make the internal states of the model public, I can see them in another tool. This works well but I'd rather not make the entire internal state public.
I set it to use a global data store (making a Simulink.Signal in the base workspace with all the necessary BusObjects) and now the instance of the DataStore isn't lumped into the internal state but is generated as an extern statement outside of the ModelClass. How can I get RealTimeWorkshop to define that extern as a member of the ModelClass (preferably marked "public")?
I am using R2013a on RedHat 5.

답변 (1개)

Venkatachala Sarma
Venkatachala Sarma 2016년 3월 8일
Instead of defining it as a global data store, define the Simulink.Signal inside the Model Workspace. By doing so I as able to get the data store as a parameter of the ModelClass.
Hope this helps.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by