I have some PID blocks created in R2016B, I have converted the model to R2019B. The Model runs fine but I cannot delete some PID blocks. I get a message about error trying to execute the 'DeleteFcn' and specific reference to Callback string is 'pid pack.PID Config.closeTuner(gcbh)'
These were PID blocks which I had modified (which I think means I had to unlink them or something but I cannot recall). Even if I delete all the content inside the subsystem I still cannot delete it.
I verified I still do indeed have an active license for Simulink Control Design.

 채택된 답변

Monika Jaskolka
Monika Jaskolka 2021년 10월 28일
편집: Monika Jaskolka 2021년 10월 28일

2 개 추천

It looks like the DeleteFcn in 2016 was pidpack.PIDConfig.closeTuner(gcbh) while in 2019 it is pidpack.PIDConfig.utilcloseTuner(gcbh). Try this:
  1. Click on the PID block
  2. Go to the Command Window and enter the following:
set_param(gcbh, 'DeleteFcn', 'pidpack.PIDConfig.utilcloseTuner(gcbh)')
3. Try to delete the block
If this still doesn't work, I would try just deleting the callback altogether:
set_param(gcbh, 'DeleteFcn', '')

댓글 수: 6

mariko shirazi
mariko shirazi 2021년 11월 1일
Thank you Monika! Do you know if this will affect my entire Simulink operation, meaning every time I try to delete a PID block it will use the new command, or will it just affect ability to delete that particular block I selected? I actually hope the latter as I am in the middle of big project and bit scared of upsetting the apple cart...
The steps described only impact the PID block that you have selected (see the gcbh command). You can of course use a loop to adjust all PID blocks in your model, if you wish:
pid_blks = find_system(gcs, 'MaskType', 'PID 1dof');
for i = 1:numel(pid_blks)
set_param(pid_blks{i}, 'DeleteFcn', 'pidpack.PIDConfig.utilcloseTuner(gcbh)');
end
I am curious how this issue arose in the first place. When I open a 2016b model, containing PID blocks, in 2019b, the DeleteFcn is updated automatically.
mariko shirazi
mariko shirazi 2021년 11월 2일
Thank you for pointing this out, I was working off a version of Matlab which I had opened through another program, Opal-RT RT-Lab. I tried opening Matlab R2019b directly and then opening the model, indeed I was able to delete the PID blocks. Curiously, I did get a bunch of Warning messages when I closed the model however, all like the one below. I really appreciate your help. I'll have to figure out what happens when RT-Lab opens Matlab. At the very least, I just have to open the model directly in Matlab first, delete what I want to and THEN open from RT-Lab. Thank you much,
Warning: Error evaluating 'ModelCloseFcn' callback of
SubSystem block (mask)
'uGrid_1Dsl_1INV/SM_Master/SM_Inv_Load_and_IO/Inv as LN
Voltage Source - Set InvVsrc=1 in init
file/DCX1_Controller/Modified Discrete PID Mari
05-SEP-2020'.
Callback string is 'pidpack.PIDConfig.closeTuner(gcbh)'
mariko shirazi
mariko shirazi 2021년 11월 2일
For completeness, I should have mentioned that in addition to the string of warnings related to the 'ModelCloseFcn' callback, I got warnings also for use of the 'DeleteFcn' callback. But at least it let me actually delete the blocks, and I'm thinking I can just ignore those warnings.
mariko shirazi
mariko shirazi 2021년 11월 11일
Sorry only reason for delay in acceptance is that I didn't know I had to vote and accept...
Thank you for your help!!
MIKE MA
MIKE MA 2023년 8월 4일
hi, is there a way to delete all kinds of callbacks if there were by programlly, since we not sure whether which kind of callbacks be seteed.
thanks.

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

추가 답변 (0개)

카테고리

제품

릴리스

R2019b

질문:

2021년 10월 28일

댓글:

2023년 8월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by