필터 지우기
필터 지우기

Simscape PreCopyFcn prevents simulation running when in referenced model

조회 수: 16 (최근 30일)
Phil Taylor
Phil Taylor 2012년 7월 16일
답변: Yifeng Tang 2022년 6월 22일
A colleague has created a Simscape simulation of a Plant using hydraulic components (he has the full suite, I just have Simscape and the associated libraries installed).
I can run his model OK if I treat it as standalone (it runs in Restricted mode). However, when I include his Plant model as a referenced model in a whole system simulation it fails to run:
Error evaluating 'PreCopyFcn' callback of Check Valve block (mask)
When I open the block's callbacks they are all greyed out so I cannot see the callback. However, I can reveal it programatically :
>> get_param(gcb, 'PreCopyFcn')
ans =
simscape.compiler.sli.internal.callback('PreCopyFcn',gcbh);
So it appears that simply running a referenced model that contains Simscape blocks requires a Copy, and that is a restricted function. But running a simulation containing the same block all by itself is fine... any thoughts on how to overcome this?
PS - I can't even see what happens when I remove the block - Restricted Mode prevents it's deletion too!
PPS - Colleague is on holiday for the next two weeks, so unless I 'administer' his SimHydraulics licence to myself I'm really stuck.

답변 (1개)

Yifeng Tang
Yifeng Tang 2022년 6월 22일
Attempt to answer from 10 years later ... lol.
It sounds to me that it's a feature of Simscape and its Add-On libraries working properly. The restricted mode is designed such that a user with Simscape license can run a model created using Add-On libraries, e.g. Simscape Fluids, but cannot modify what is inside the model. Here is a list of thing you can do in the restricted mode vs full mode:
Hope this helps.

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by