Accessing M-file S-Function parameters inside TLC file
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I am writing a TLC file for a M-File S-Function in order to generate C-Code but I am wondering how I can access the S-Function parameters inside the TLC file.
Inside the M-File S-Function's setup(block) method I have the following:
block.NumDialogPrms = 2;
block.DialogPrmsTunable = {'Tuneable', 'Tuneable'};
which seems to work since I can access and validate the parameters also in the CheckParameters(block) function.
However, inside the TLC file's BlockInstanceSetup(block, system) function the following lines do not work:
%assign port = LibBlockParameter(P1, "", "", 0)
%assign pins = LibBlockParameter(P2, "", "", 0)
and I am wondering why.
Best regards,
Arne
0 comentarios
Respuesta aceptada
Kaustubha Govind
el 1 de Ag. de 2012
Do you call "block.AutoRegRuntimePrms({'P1','P2'});" in DoPostPropSetup? If you call block.AutoRegRuntimePrms without the parameter names, I think the default names used are MSFcnParameter, MSFcnParameter1, etc.
0 comentarios
Más respuestas (1)
Arne
el 1 de Ag. de 2012
Editada: Arne
el 1 de Ag. de 2012
1 comentario
Kaustubha Govind
el 1 de Ag. de 2012
Glad you found the answer. FYI, you can type "sldemo_msfcn_frame" at the MATLAB prompt to see an example for WriteRTWParam().
Ver también
Categorías
Más información sobre Simulink Coder en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!