Using LibBlockParameter() in M-S-Function
Show older comments
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.
Answers (1)
Kaustubha Govind
on 26 Sep 2012
0 votes
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.
Categories
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!