Using LibBlockParameter() in M-S-Function
이전 댓글 표시
I can't understand how to use the LibBlockParameter(), I need a complete example. I have a M-S-Function block with "msfn_trans_ctrl" function and parameters with six parameters: "AD.p1,AD.p2,AD.p3,AD.p4,AD.p5,AD.p6". The first question was where to get this "parameter name". I've added the following string into DoPostPropSetup(block), but I'm not sure about it: block.AutoRegRuntimePrms({'Prm1','Prm2','Prm3','Prm4','Prm5','Prm6'}); Is it right? Second question is how to access these parameters from .tlc file? For example, I have an AD.p3 = [2 4 6 7 8 9 10 11 12]; I need to switch AD.p3(3) value. I've tried: %switch %<LibBlockParameter(Prm1,"","",2)> %case 550 And: %switch LibBlockParameter(Prm1,"","",2) %case 550 And many also. But nothing works. Usually I getting an "The == and != operators can only be used to compare values of the same type" error message.
답변 (1개)
Kaustubha Govind
2012년 9월 26일
0 개 추천
Based on this previous discussion, I think LibBlockParameter returns the parameter value as a string, so you might need to use string comparison as I described in that link.
카테고리
도움말 센터 및 File Exchange에서 Texas Instruments C2000 Processors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!