Engee documentation

From Workspace

Loads data from the workspace as a signal.

blockType: FromWorkspace

Path in the library:

/Basic/Sources/From Workspace

Description

The From Workspace block reads data into the model from the workspace and represents it as a signal. Block From Workspace can be located at any level of model nesting and can be used to transfer data to any model or subsystem from the workspace.

Features of data loading

Block From Workspace is designed to read data from variables in the form of vector, matrix or WorkspaceArray type (special type, which is obtained either as a result of data unloading using block To Workspace, or can be created manually, see details). Working with WorkspaceArray in Engee).

The name of the variable to be read is set in the parameters Data.

Depending on the loaded data, the output signal can be scalar, vector or matrix.

Parameters value Data

Value of parameter Time Values

`vector

`matrix

matrix N by 1

WorkspaceArray type :pair

WorkspaceArray type :time

WorkspaceArray type :value

enabled

error

vector

error

value type WorkspaceArray

error

error

disabled

scalar

vector

vector

value type WorkspaceArray

error

WorkspaceArray value type

Ports

Output

# OUT_1 — workspace data
scalar | vector | matrix

Details

Data loaded from the workspace as a signal. Depending on the loaded data, the output signal can be scalar, vector or matrix.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Complex numbers support

No

Parameters

Main

# Data — data to be loaded from the workspace object

Details

A variable in the workspace in the form of a vector, matrix or WorkspaceArray type (for details see Working with WorkspaceArray in Engee).

If the variable is specified as a vector, it is always a single column of data (the Time Values checkbox cannot be selected).

If the variable is specified as a matrix, the first column can be treated as both a time column and a data column, depending on whether the Time Values checkbox is selected.

See table for details.

Default value

workspace_in

Program usage name

VariableName

Tunable

No

Evaluatable

No

# Sample time — interval between calculation steps
SampleTime (real number / vector of two real numbers)

Details

Specify the interval between calculation steps as a non-negative number. To inherit a calculation step, set this parameter to -1.

Default value

0

Program usage name

SampleTime

Tunable

No

Evaluatable

Yes

# Time Values — time data interpretation
Logical

Details

Select the check box to enable interpretation of time data.

Default value

true (switched on)

Program usage name

TimeValues

Tunable

No

Evaluatable

No

# Interpolate — interpolate data
Logical

Details

Interpolation method used to calculate intermediate signal values (not present in the source data). If the box is checked, the From Workspace block uses linear interpolation of intermediate values, if unchecked - constant interpolation.

The value of the Interpolate parameters also affects how the From Workspace block extrapolates the output values for the simulation time to the first data point. When the checkbox is checked, the block uses the first two points to linearly extrapolate the output values. When unchecked, the output is 0.

Default value

true (switched on)

Program usage name

Interpolate

Tunable

No

Evaluatable

No

# Output After Final Value — method of determining the block output after the data endpoint
Extrapolation | Setting to zero | Holding final value | Cyclic repetition

Details

The block From Workspace uses the parameters Interpolate and Output After Final Value, to calculate the block output for the simulation time after the last point available in the loaded data.

Parameter value Output After Final Value Parameter value Interpolate Value of block output after last data value

Extrapolation

included

Extrapolated from the last two data points

disabled

Error

Setting to zero

enabled

Zero

`off

Holding final value

`on

Last value

`off

Cyclic repetition

enabled

Error

enabled

This mode can only be used if the parameters Interpolate and Time Values are disabled and the discrete Sample time is set. In this case the data is cycled from the first value, otherwise an error occurs.

Values

Extrapolation | Setting to zero | Holding final value | Cyclic repetition

Default value

Extrapolation

Program usage name

OutputAfterFinalValue

Tunable

No

Evaluatable

No