algo_mdsmarte2

[SCDDS - Simulink Control Development & Deployment Suite] Copyright SPC-EPFL Lausanne 2022. Distributed under the terms of the GNU Lesser General Public License, LGPL-3.0-only.

Class hierarchy: algo

Class hierarchy: algo

class SCDDSclass_algo_mdsmarte2

Bases: SCDDSclass_algo

This class implements specific functionality and methods to handle MDSplus and MARTE2 integration

Constructor Summary
SCDDSclass_algo_mdsmarte2(name)

SCDDSCLASS_ALGO_MDSMARTE Construct an instance of this class

Property Summary
exportedwgstructs

list of exported waveforms structs

mdscontainer

Container class for MDS+ interface objects

taskcontainer

Container class for init and term tasks

wavegenbasestruct

base struct name of the next added wavegen

Method Summary
actualize(shot)

actualizes (fetches from source and updates values) of all defined tunable parameters (previously added with the addparameter method) and waveforms (previously added via the addwavegen method) syntax obj.actualize(shot_number) inputs shot_nr : (double) shot number to be used to actualize wavegens and parameters in this obj. -1 takes the most recent

actualizeparameters(shot)

actualizes (updates) the tunable parameters in this algo obj with their new values from a particular shot. The values are taken from the respective MDS trees syntax obj = obj.actualizeparameters(shot_number) inputs shot_nr : (double) shot number to actualize parameters from. -1 takes the last available shot

actualizewavegens(shot)

actualizes the wavegen data for a particular shot syntax obj = obj.actualizewavegens(shot_nr) input shot_nr : (double) shot number to be loaded, -1 will take the latest

addparameter(params)

adds tunable parameter descriptions to the object. Params must resolve to a SCDDS loader class object Syntax obj = obj.addparameter(params) or obj=obj.addtunparamstruct(‘algo_template_tp’, @()algo_template_loadtp()); obj=obj.addparameter(SCDclass_mdsparnumeric(‘ks1’,’gain’ );

The resulting parameter in the obj will be linked to its MDSplus source, in this example case: algo_template_tp.gain <-> ks1 inputs params : (SCDDS loader class) MDS parameter structure to be linked

addtask(task)

adds a ‘task’ to this algo object. Tasks can be used in supervisory control on some machines syntax obj = obj.addtask(task) inputs task : (SCDclass_task instance) task to be added to this algo

addwavegen(wavegen)

attaches a wavegen signal to this algo object syntax obj = obj.addwavegen(wavegen_obj) inputs wavegen_obj : obj of class scdds wavegen (SCDclass_mdswg etc.) to be attached to this algo

addwavegenbasestruct(basestruct)

attaches a MDS wavegen signal structure to this algo syntax obj = obj.addwavegenbasestruct(‘struct_name’) inputs basestruct : (string) signal structure to be attached to the algo

buildworkspacesimdata(obj)

This function builds a SCDsimdata structure containing the necessary timeseries to support a standalone simulation of the algorithm

Currently it prepares a timeseries structure to be filled with the wavegens configured within the algorithm

cleanwavegens()

cleans the data in the attached wavegens in this algo object syntax obj = obj.cleanwavegens

getmdscontainer()

returns the mds container linked to this algo object syntax out = obj.getmdscontainer

gettaskcontainer()

returns the task container linked to this algo object syntax out = obj.gettaskcontainer

printMARTe2parconfig(shot, fid)

prints the MARTe2 parameter configuration for a particular shot and parameter identifier Syntax obj.printMARTe2parconfig(shot,fid) Inputs shot : (numeric) shot number, -1 for the last available shot fid : (string) MATLAB file identifier to which the output will be directed. Use 1 for matlab console output.

printMARTe2wgbusconfig(shot, busname, frequency, fid, varargin)

prints the MARTe2 config file for loading a particular input bus signal as a wavegen (or set of them) in MARTe2 Syntax obj.printMARTe2wgbusconfig(shot,busname,frequency,fid,ddname) inputs shot : (numeric) shot number, -1 for last available busname : (string) name of the input bus frequency: (numeric) MARTe2 signal frequency fid : (string) MATLAB file identifier to which the output will be directed. Use 1 for matlab console output. ddname (optional, string) name of the datadict containing the bus definition. When ommited, the default data dictionary is used.

printinfo()

prints algo obj information. Syntax obj.printinfo Inputs None

printparameters()

prints info on MDS SCDDS loader class params attached to this algo obj syntax obj.printparameters

printtasks()

prints available tasks syntax obj.printtasks

printwavegens()

prints info on the attached wavegen objects to this algo syntax obj.printwavegens

setup()

method to setup the algo object. Calling this method performs the following steps: - call updatetemplatetp - call buildworkspacetpstruct (if obj.exporttptobase=1) - call buildworkspacesimdata after init+setup, an algorithm block diagram should pass ctrl+d (slx model update) syntax obj.setup

updateparameters(shot)

updates MDS tree values with current values of tunable parameters syntax obj.updateparameters(shot_number) inputs shot_number : (double) shot number to load parameters from. -1 takes the latest available

updatewavegens(shot)

updates MDS tree values with current values of wavegens syntax obj.updatewavegens(shot) inputs shot_number : (double) shot number to load parameters from. -1 takes the latest available