Data Write

This MotoHawk™ block writes value(s) to data defined by a Data Definition block.

Block ID

motohawk_data_write

Library

MotoHawk_lib/Data Storage Blocks

Description

This MotoHawk™ block writes value(s) to data defined by a Data Definition block.

The 'Data Source' may be resolved by name, or by explicitly providing a dynamic reference signal. If "Structure Name" is selected, then the name of the structure instance must be specified along with the name of the field. If "Structure Reference" is selected, then the field is selected and a structure reference is provided as an input.

The 'Data Structure' may be a Scalar, Vector, or Matrix. An option is available when Vector or Matrix is selected to either output the entire data structure as a vector or matrix signal, or to use zero-based index inputs to determine the appropriate item(s) within a larger data structure.

The selection for 'Data Structure' and 'Data Type' must match the definition.

See also Data Coherency for a discussion on ensuring data coherency when accessing global data across multiple threads of execution.

Block Parameters

Parameter Field Values Comments/Description
Data Source Select method of obtaining source of data.
  Lookup by Name Get data from source selected by name as entered in Data Definition block. If this option is selected the "Data Name" field is available for name entry.
Input Reference Signal Get data from explicitly provided dynamic reference signal.
Lookup by Name in Structure Get data from source selected by name of data and of structure as entered in Data Definition block (for Data Type "struct"); if this option is selected the "Data Name" field is available for name entry.
Lookup by Name in Structure by Reference Get data from explicitly provided dynamic reference signal in structure.
Data Structure Select Structure of Data (must match that of Data Definition Block)
  Scalar Single discrete value.
Vector Array of values (single row or column). Enables Operation selection field.
Matrix Table of Values (rows/columns). Enables Operation selection field.
Data Type Drop-down list Specify data type (must match the referenced Data Definition Block), or choose to obtain by reference.
Data Name Alpha-numeric text, single-quote enclosed The referenced Data Definition when Lookup by Name is selected for Data Source
Allow writes to read-only data. Check box (enable) Check to enable writes to read-only data. The over-written data is not included in generated code.
Operation Select method for obtaining structured data (field not available for "Scalar" selection in "Data Structure").
  Write scalar from location by index Write scalar according to coordinate(s) index. Supplying a vector of indexes will allow a vector of values to be written.
Write entire data structure at once Write entire vector or matrix; enables size fields per structure selected (Vector Size for Vector, or Numbers of Rows/Columns for Matrix).
Vector Size Numeric The vector's size must be specified when Vector data structure is selected and the entire data structure is to be read or protected access is to be used. This value should match the referenced Data Definition specification.
Number of Rows Numeric The matrix's row dimension must be specified when a Matrix data structure is selected and the entire data structure is to be read or protected access is to be used. This value should match the referenced Data Definition specification.
Number of Columns Numeric The matrix's column dimension must be specified when a Matrix data structure is selected and the entire data structure is to be read or protected access is to be used. This value should match the referenced Data Definition specification.
Use Protected Access Check box (enable) The protected access option is available when a matrix or vector data structure is in use and the selected operation is to read via an index. When checked the target will generate bounds checking code that will skip the write when an illegal index is detected. When not checked an illegal memory access will result if the supplied index is out of bounds.
Show Protected Access Status Check box (enable) This option (which is only visible when Use Protected Access is checked) will expose an output port that returns true if the bounds checking identified an illegal index value and false otherwise.
Structure Instance Name Alpha-numeric text, single-quote enclosed Name of data source structure. This filed is visble if Lookup by Name in Structure is selected for Data Source.
Structure Declaration Name Alpha-numeric text, single-quote enclosed Name of structure declaration. A structure declaration is basically the type. This field is visble if Lookup by Name in Structure is selected for Data Source.
No operation when null reference is input Check box (enable) Check to enable no operation when an input by reference option is selected and the input reference is detected to be null(0).