PCSSP module API documentation¶
- class pcssp_module¶
Bases:
SCDDSclass_algoderived class for PCSSP modules using the SCDDS core framework for model referencing with data dictionaries.
- Method Summary
- build(build_target)¶
generates C/C++ from a PCSSP module. The method first grabs the required SimulinkConfiguration settings, sets them as configurationSettings in the base WS, and then calls rtwbuild. Optionally, a build target can be provided (‘rtf’ or ‘auto’). Select auto to automatically detect an installed toolchain on your machine or use ‘rtf’ to pick the hardcore RTF settings.
Syntax: obj.build or obj.build(‘rtf’)
- Parameters:
build_target – optional target for C code generation.
Current options are ‘rtf’ or ‘auto’ to automatically select an installed toolchain.
- clear_model_ws(variables)¶
Clears all or a comma-separated list of variables from the model workspace of this PCSSP module
Syntax: obj.clear_model_ws(‘tp1’,’tp2’,’tp3’) or: obj.clear_model_ws
- Parameters:
parameters – comma separated list of to-be-deleted parameters (optional)
- get_model_arguments()¶
Grabs all model arguments that are currently defined in the model workspace of this PCSSP module. You can define new model arguments using the set_model_arguments method
syntax: obj.get_model_arguments
- Parameters:
none
- init()¶
initializes this pcssp module. During initialization, the following steps are performed:
-put a SimulinkConfiguration set in the base WS that can be referred to in the model slx (needs to be linked manually)
-create a fresh new sldd
-call the parameter and bus init fcns and stick their nominal values in the freshly created sldd
This method should be called before obj.setup
syntax: obj.init
- Parameters:
none
- set_model_argument(param, param_name)¶
sets model arguments to allow parametrization when referencing this module from a top model. The parameter is put in the model workspace and exposed as a mask parameter. If the parameter already exists in the model WS it is updated when needed
syntax: obj.set_model_arguments(param,’tp_name’)
- Parameters:
param – Simulink.Parameter or struct to become model arg
param_name – name of the parameter in the model WS and mask
- set_module_description(description_string)¶
Adds a descriptive text to the module obj property obj.description, and sets it in the description of the attached slx model.
syntax: obj = set_module_description(‘some piece of text’);
- Parameters:
description_string – char array containing the description
- write_XML(function_block_alias)¶
Automatically generates an XML description of this PCSSP module to act as RTF FunctionBlock description. This XML works together with the generated code to form an RTF FB. You can use the optional Bus and Simulink.Parameter description field to describe your signal/parameter, which then gets put as a comment in the RTF XML.
this function uses the matlab writestruct fcn to mimick this XML structure for RTF applications.
syntax: obj.write_RTF_xml(‘FUN-CTRL-MAG-01’);
- Parameters:
functionblock_alias – Alias linking to the PCSDB