Main Content

simscape.probe.defaultVariableTable

Construct default variable table for block

Since R2024b

Description

VariableTable = simscape.probe.defaultVariableTable(blockName) constructs a VariableTable object that contains all the variables that can be probed for the Simscape™ block blockName. Each table row represents a block variable and includes the properties of the simscape.probe.VariableConfiguration object associated with the variable: its unit, port label name to display on the Probe block, and the probing status. By default, the unit matches the unit of the variable selected for probing and the port label matches the name of the variable. The default probing status of all the variables is false.

Modify the variable configuration properties, as needed. Use the simscape.probe.setVariableTable function to attach the VariableTable to a Probe block.

example

Examples

collapse all

This example shows how to configure a simscape.probe.VariableTable object for the Ideal Torque Source block in the Permanent Magnet DC Motor example model and attach the table to a Probe block.

Open the model.

openExample('simscape/PermanentMagnetDCMotorExample')

Add a Probe block to the model.

add_block('nesl_utility/Probe','PermanentMagnetDCMotor/Probe');

Bind the Probe block to the Ideal Torque Source block named Load Torque.

simscape.probe.setBoundBlock('PermanentMagnetDCMotor/Probe','PermanentMagnetDCMotor/Load Torque')

Get the default variable table for the Load Torque block.

table1 = simscape.probe.defaultVariableTable('PermanentMagnetDCMotor/Load Torque')
table1 = 

  VariableTable with 5 variable(s):

                Unit       PortLabel    Probing
              _________    _________    _______

    C.w ⟼    {[rad/s]}      "C.w"       false 
    R.w ⟼    {[rad/s]}      "R.w"       false 
    S   ⟼    {[N*m  ]}      "S"         false 
    t   ⟼    {[N*m  ]}      "t"         false 
    w   ⟼    {[rad/s]}      "w"         false

The default probing status for all the variables is false.

Change the probing status of the t variable.

table1("t").Probing = true
table1 = 

  VariableTable with 5 variable(s):

                Unit       PortLabel    Probing
              _________    _________    _______

    C.w ⟼    {[rad/s]}      "C.w"       false 
    R.w ⟼    {[rad/s]}      "R.w"       false 
    S   ⟼    {[N*m  ]}      "S"         false 
    t   ⟼    {[N*m  ]}      "t"         true  
    w   ⟼    {[rad/s]}      "w"         false  

Change the port label associated with the t variable.

table1("t").PortLabel = "Torque"
table1 = 
  VariableTable with 5 variable(s):

                Unit       PortLabel    Probing
              _________    _________    _______

    C.w ⟼    {[rad/s]}    "C.w"         false 
    R.w ⟼    {[rad/s]}    "R.w"         false 
    S   ⟼    {[N*m  ]}    "S"           false 
    t   ⟼    {[N*m  ]}    "Torque"      true  
    w   ⟼    {[rad/s]}    "w"           false  

Attach table1 as the variable table to the Probe block.

simscape.probe.setVariableTable('PermanentMagnetDCMotor/Probe',table1)

The name of the output port of the Probe block in the block diagram changes to Torque.

To confirm that you properly attached the variable table table1 to the Probe block, enter:

simscape.probe.getVariableTable('PermanentMagnetDCMotor/Probe')
ans = 

  VariableTable with 5 variable(s):

                Unit       PortLabel    Probing
              _________    _________    _______

    C.w ⟼    {[rad/s]}    "C.w"         false 
    R.w ⟼    {[rad/s]}    "R.w"         false 
    S   ⟼    {[N*m  ]}    "S"           false 
    t   ⟼    {[N*m  ]}    "Torque"      true  
    w   ⟼    {[rad/s]}    "w"           false 
 

Input Arguments

collapse all

Name of the block to probe, specified as a string scalar or a character vector, or a block handle.

Data Types: double | char | string

Output Arguments

collapse all

Default variable table for the block, returned as a simscape.probe.VariableTable object. The object contains the block variables that are available for probing.

Version History

Introduced in R2024b