Documentation Center

  • Trial Software
  • Product Updates


Get current value of tuned block in slTuner interface


  • val = getBlockValue(st,blk) example
  • [val1,...,valN] = getBlockValue(st,blk1,...,blkN)
  • [val1,...,valN] = getBlockValue(st)



val = getBlockValue(st,blk) returns the current value of the parameterization of the Simulink® block, blk.

The slTuner interface automatically associates a parametric model with each Simulink block in its list of tuned blocks. This parameterization expresses each tuned block as a Control Design Block or a tunable genss model. The parameterization specifies which parameters are tuned by commands such as systune. Use getBlockValue to access the value of this parameterization after tuning.

Use setBlockParam or writeBlockValue to align the block parameterization values with the actual block values in the Simulink model.

[val1,...,valN] = getBlockValue(st,blk1,...,blkN) returns the current values of the parameterizations of one or more blocks.

[val1,...,valN] = getBlockValue(st) returns the current values of the parameterizations of all the tuned blocks of st (in their order of appearance in st.TunedBlocks).


expand all

Get Current Parameterization Value of Tuned Block

Create an slTuner interface for the Simulink model scdcascade, and examine the current value of the block parameterization of one of the tuned blocks.

st = slTuner('scdcascade',{'C1','C2'});

val = getBlockValue(st,'C1')
val =
  Kp + Ki * ---

  with Kp = 0.158, Ki = 0.042
Name: C1
Continuous-time PI controller in parallel form.

Input Arguments

expand all

st — Interface for tuning control systems modeled in SimulinkslTuner interface

Interface for tuning control systems modeled in Simulink, specified as an slTuner interface.

blk — Blockstring

Block in the list of tuned blocks for st, specified as a string.

You can specify the full block path or any portion of the block path that uniquely identifies the block among the other tuned blocks of st.

For example, blk = 'scdcascade/C1' or blk = 'C1'.

Output Arguments

expand all

val — Current value of block parameterizationnumeric LTI model

Current value of block parameterization, returned as a numeric LTI model such as pid, ss, or tf.

More About

expand all

Tuned Blocks

Tuned blocks, used by the slTuner interface, identify blocks in a Simulink model whose parameters are to be tuned to satisfy tuning goals. You can tune most Simulink blocks that represent linear elements such as gains, transfer functions, or state-space models. (For the complete list of blocks that support tuning, see How Tuned Simulink Blocks Are Parameterized.) You can also tune more complex blocks such as SubSystem or S-Function blocks by specifying an equivalent tunable linear model.

Use commands such as systune and looptune to tune the parameters of tuned blocks.

You must specify tuned blocks (for example, C1 and C2) when you create an slTuner interface:

st = slTuner('scdcascade',{'C1','C2'})

You can modify the list of tuned blocks using addBlock and removeBlock. Use commands such as setBlockParam, getBlockValue, and writeBlockValue to interact with and manipulate tuned blocks.

See Also

| | | |

Was this topic helpful?