Home Examples Accessing KINdata_bus, Current Block Index, and Other Task Control Variables
Coding TipsRealtime Data

Accessing KINdata_bus, Current Block Index, and Other Task Control Variables

It is possible to access various task control variables used by the Simulink blocks that make up the Dexterit-E library through the use of the Simulink’s From block (see Simulink\Signal Routing library). The From block creates an invisible connection to a Goto block elsewhere in the Simulink model (multiple From blocks can access a single Goto block). Accessing various task control variables can be desirable, for example, if something needs to be done only on the first trial (in which current_trial_number_in_set would be a useful variable to access) or if a custom block is being created that requires access to various Kinarm data (in which case KINdata_bus would be the relevant variable to access). Paste the From block into a model, double-click it, click Update Tags and then select the Goto Tag options to see a list of the available parameters that can be read from. These blocks allow the end-user to access things such as the various parameters tables (e.g. Target_Table) as well as status of the overall task (e.g. current_block_index, current_tp_index). For more information regarding which Goto tags are available, please see 14.9 Available ‘Tags’ (From and Goto Blocks).  A Sample Task is provided.

Figure 10.24: Simulink Chart for Accessing KINdata_bus, Current Block Index, and Other Task Control Variables (Note figure may not agree with Sample Task.)

Note: To find out more about what each of the possible variables are, choose the relevant Goto tag, then click Goto Source in the From block dialog to open the Simulink block in which the Goto block resides. Also, you can review the available tags in 14.9 Available ‘Tags’ (From and Goto Blocks).

Related Tasks

Coding Tips
Persistent Variables
Persistent variables are ones that hold their value between calls to the embedded MATLAB code they are defined in.
Coding Tips
Custom Control of the Trial Protocol Order
Normally, Dexterit-E manages and controls the order in which Trial Protocols (TPs) execute based on what is defined in the block table of the Task Protocol (see the Dexterit-E User Guide for more details).