Initial Conditions

Creates and configures the initial condition sets for tests. The default initial condition set for a test can also be set with this form.

Initial Condition

An initial conditions set specifies initial values for I/O points and model parameters. It can also override the RTDB’s logging settings.
The default initial condition set is created by SimWB when you create a test. The test specifies with Simulink™ models are run in the test as well as which RTDB to use. From this information, SimWB will copy the initial values of the parameters for the Simulink™ models from the model executable to the the initial condition set.
It will also scan the associated RTDB for the items that have been created with a defaultvalue. This value will be used to set the initial condition value for the specific RTDB item.

shutdown Values

The values to be set in the RTDB at the end of a test run for the output items can be defined under the Shutdown branch.
Those values are set at the end of the test by the scheduler and are used to set output hardware channels to know values.The value is specified in the item engineering units. The final values as well as the rate in EU/s to reach the final values is set on a channel basis. The maximum time allowed for the shutdown is set in the session under the Max I/O shutdown Time. The rate is defined here as an absolute value, the sign used will depends on the direction that the I/O value has to move from the current value in the RTDB to the final value specified.
Only the items which have the enabled flag will be set to the final value defined here. Disabled output items will keep their last value in the RTDB when the test finishes and will not be set to the final shutdown value.

Folder and files location:

Folder:

  $PROJECTDIR/Tests/TEST_NAME/InitialConditions/INIT_COND_NAME

Files:

  • RTDB Items
    rtdb.itemsIC.txt
  • Model Parameters
    parm_MODEL_NAME_1.txt
  • Shutdown Values Parameters
    shutdown.txt

Warning! The default initial conditions created when a test is created will be overwritten by 'default value' in the RTDB items. This is to provide backward compatibility. If you would like persistent initial condition values, please make a copy of the default set, modify as required, and then set that as the default initial conditions for all the new test sessions

Action Buttons

Filter Variables

Displays in the values and logging tabs only variables whose name matches the regular expression. See Regular Expressions.

Demonstrate helpvideo00008.png

Opens a short video clip that demonstrates the basic workflow of this form.

Help help00009.png

Opens this section of the manual.

Deletedelete00010.png

Deletes the selected initial conditions set.

Copycopy00011.png

Creates a copy of the selected initial conditions set. There is no New button for creating a new initial condition set from “scratch”.

Add End (Shutdown) Values Setnew_s.png

Add set of values to be set in the RTDB at test shutdown. The scheduler will set the values of the RTDB for the items defined under the shutdown branch when a test is terminated. This only applies to output items. The value will be used by the I/O tasks to set the values of the output channels at the end of a test.
The Shutdown branch should automatically be present for newly created tests. This button will only be enabled when the branch is not already present and need to be added to an existing initial condition set.

Applyapply00012.png

Commits all pending edits to the real-time host. See Apply .

Cancelcancel00013.png

Discards all pending edits.

Initial Conditions Set Settings

General Settings

Test

Selects the test whose initial conditions sets are going to be edited.

Initial Conditions Library

List of initial conditions sets defined for the selected test. Select a set from this list by clicking on its row.

Name Column

Name of the initial conditions set.

Default Column

Whether the initial conditions set is the default one for the selected test. Click on the check box of a set that is not default to change the default set. The default initial conditions set can be changed on tests even after they are saved to the real-time host.

Description Column

Description of the initial conditions set.

Initial Conditions Name

Name of the selected initial conditions set. Rename the set by clicking on the field and typing.

Description

Description of the selected initial conditions set. Edit the description by clicking in the box and typing.

Values Tab

Table of initial values of RTDB variables.

init_cond-edit.png

Name Column

Name of the RTDB variable. Names are hierarchical. Model parameters are parented by a node named the same as the model and I/O Points are parented by a node named rtdb_itemsIC.

Type Column

C language type of the RTDB variable, including its dimensionality in square brackets.

Value Column

Initial value of the RTDB variable. To edit a value, double click on it. Scalar values may be edited in place. Type an new value and press enter when done. Array values will bring up an dialog where you can enter value in the table . In the dialog, double click on each element’s value to edit it in place in the dialog’s table. Click on Accept Changes when done.

Enable Column

Only the items which have the enabled flag will be set to the final value defined here. Disabled output items will keep their last value in the RTDB when the test finishes and will not be set to the final shutdown value. The checkbox in the Enable column allows enalbing/disabling the shutdown values for multiple selected items as a group.

When the array is too large to be edited in using the table, init_cond-edit.png I.e. more than 500 elements, The value will be displayed as Too Big followed by values for the beginning of the array. You can still set the values of specific arrays by importing values from a file. The Control center supports importing values from MAT (V 5) files, CSV file or free format text file.

Double click on the value line to open the dialog that will allow you to import values from a file. init_cond-edit.png Select the file type and click on the name of the file you want to import.
The file will be parsed and the list of variables will be shown in the Imported File tab.

When you import values from a MAT file, init_cond-edit.png the list of variables found in the file will be shown in the left pane of the Imported File tab. Click on the line that defines the value you want to import and drag to the right panel and drop it on the RTDB/Parameters name for which to set the values.
The Control Center will only allow you to drop on an item that has the same number of elements as defined in the imported file.

 
The third column in the right pane will show the name of the variable to use to set the values. Once you have set all the values needed, click on the Set Values button to accept the changes.

Import Type

  • MAT: This is a MAT (V 5.0 file). The file contains a list of variables with their associated data type (double, float, int, etc) and dimensions.
  • CSV: This is a comma separated value file. The value separator can be any of SPACE, ',' or TAB characters. The file can contain multiple lines where each line defines the values for a single variable. Optionally, the first column in the file can be an identifier.
     
    Example 1
        var1, 1,2,3,4,5,6
        variable_2, 10.00,21,342.12311
        
    var1 defines an array of 6 elements while variable_2 defines an array of 3 elements.
     
    Example 2
        11 12 13 14
        var2, 101 102 103 255 173
        
    The first line defines an array of r46 elements while var2 on the second line of the file defines an array of 5 elements.
  • TXT: This is a free format ASCII file where the values are separated by any of SPACE, ',' or TAB characters. The file can contain multiple lines with a varying number of values on each line. The number of values in the file defines the size of the array that this file can initialize
     
    Example
        1 2 3 4 5 6 7 8 9 0 11 11 1231 121 
        44 123
        5 6 6 7 7 
        
    Can be used to initialize an array of 21 elements.

Logging Tab

Table that allows configuring the logging settings of all RTDB variables. init_cond-logging.png 

Name Column

Name of the RTDB variable. Names are hierarchical. Model parameters are parented by a node named the name of the model prefixed by [Model Parameters], model signals are parented by a node named the name of the model prefixed by [Model Signals], and I/O points are parented by a node named rtdb_itemsIC.

Logging Column

Whether to log the RTDB variable or not. To edit the value click on it and select the new value from the drop down menu.

Default

Selects the default value.

For model parameters and signals, the default is No, which is what the cell will display after Default is selected.

For I/O points, the default is the setting on the I/O point. See Analog Points..., Digital Points..., and String Points... for details on changing those settings. When Default is selected for an I/O point, the cell will display Default.

Yes

Enables logging of the RTDB variable. This overrides the logging setting in the RTDB for the variable. The Logging Period column will be enabled for the RTDB variable with this setting.

No

Disables logging of the RTDB variable. This overrides the logging setting in the RTDB for this variable.

Logging Period Column

Selects the frequency at which the RTDB variable is logged. It only has a value for RTDB variables whose Logging column has the Yes setting. To edit it, click on the value and select a new one from the drop down menu.

frame rate

Logs at the simulation’s frame rate.

500 μs - 500 ms

Logs every 500 microseconds to every 500 milliseconds. Logging will happen at a whole multiple of the frame rate.