Using LibBlockParameter() in M-S-Function
Afficher commentaires plus anciens
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.
Réponses (1)
Kaustubha Govind
le 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.
Catégories
En savoir plus sur Texas Instruments C2000 Processors dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!