The recorder block will store the minimum or maximum value of another object. It can also store “snapshots” of a given object.
When creating a recorder block, you must specify either the name of the object to record, or an expression to record. This is called the “record target”.
You can also specify a reset condition. Whenever the condition switches from “false”, or zero, to “true”, or greater than 0 a reset will be triggered. Depending on the selected option, a reset will mean different things:
From the Projects window
From the Matrix window
From the Blocks window
Note | Most block properties can be edited directly in the Blocks window. |
The block editor is shown by right-clicking the block in a window and selecting Edit. In the Blocks window, you can also show the block editor by selecting the block and clicking the button, or by double-clicking the right-most “validation” column of the block.
The block editor has three tabs:
This page lets you edit basic properties such as name, sub-system and base unit. See editing properties for more information.
This page lets you edit the visual properties of the block in the Matrix window. See Editing appearance for more information.
Operation - Select the record operation to perform
Dimension - You can specify the dimension of the block by using the Type drop down list. Depending on the dimension the index drop down lists are activated.
Data - The data table let you specify index specific properties like record target and reset conditions
Consider a model for contamination of grain. At a specific date each year the grain is harvested. The harvested grain is used for baking bread until next years harvest. When modelling the amount of contamination ingested by people in the area, the value needed is the concentration of the contaminant at harvest.
The model has a compartment called grain which accumulates contaminants during the year and which is cleared every year at harvest which is at day 240. A recorder is created to take snapshots of grain. In order to take a new snapshot every year at day 240, the following condition is written: (mod(time,365)>240), assuming of course that the time unit is in days.