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!