PCSSP wrapper API documentation¶
- class pcssp_wrapper¶
Bases:
SCDDSclass_wrapperInherited class for PCSSP wrapper definition and manipulation To define a new instance: obj_wrapper = pcssp_wrapper(‘name’,dt);
- Method Summary
- build(build_target)¶
Generates C/C++ from a PCSSP wrapper. 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’ for the hardcore RTF settings.
Syntax: obj.build or obj.build(‘rtf’)
- Parameters:
build_target – (optional) target for C code generation
- compile()¶
compiles a PCSSP wrapper (equivalent to ctrl+D in the Simulink model)
Syntax: obj.compile
- Parameters:
none
- set_model_argument_value(model_path, var_name, value)¶
Sets the model argument (or model instance parameters) in a referenced model. This is useful to inject parameters from the wrapper in a parametrized pcssp module before calling this function, the referenced model needs to have model arguments defined. Call the set_model_argument method of the pcssp_module class for this purpose
Syntax:
obj.set_model_argument_value(‘<top_model_name/referenced_mode_namel>’,’var_name’,’value’)
- Parameters:
model_path – string to point to the referenced model
var_name – name of the model argument
value – value of the to-be-injected model argument
- set_wrapper_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
- test_harness()¶
runs the attached wrapper harness model for testing purposes. Requires the existence of a m-script called <module_name>_harness_run.m to set up the simulation.
Syntax: obj.test_harness
- Parameters:
none
- 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