Home Examples Analog Inputs
Data Recording

Analog Inputs

The Analog Inputs option in the DataLogging block allows a Task Program to save data recorded from an analog input device synchronously with other automatically recorded information from the Kinarm robots. Examples of data that might be recorded include electromyograms, torque outputs from the motor’s servo amps, or even non-analog signals such as custom data streams derived internally to the Task Program.

Note: Recording of analog inputs requires an analog input card supplied with a Kinarm Lab.

10.3.1   Simulink Code for Analog Inputs Example

In this example, the Log Analog Inputs option in the DataLogging block has been checked, which causes an input port to appear in the DataLogging block. The Analog Inputs block from the Kinarm I/O library of the TDK is added to the Simulink diagram and then configured and wired into this new input on the DataLogging block. The Analog Inputs block from the TDK is able to detect which type of analog input card you have and, therefore, acquire data appropriately.

This means that tasks can be built without needing to know which card you have. As with data logging, the analog data are only recorded when the logging_enable input of the DataLogging block is equal to 1 (True).

Figure 10.9: Simulink Code for Analog Inputs Example

Attention: The Analog Inputs block in the Simulink diagram must be present to record the actual torque values of the motors for Kinarm Classic Labs if desired. By default, only the commanded torques are recorded as part of the Kinarm data.

Note: Kinarm Labs purchased in 2011 or later may want to use a default of 16 or 32 channels to avoid having to re-build a task if they decide later that they want to record additional data (e.g. EMG). The Task Protocol manages the channels that are saved. Older systems that have not replaced or updated their Robot Computer (e.g. with PN 11103 or greater) may have trouble dealing with this many default channels.

10.3.2   NI PCI-6071E or PCI-6229 Data Acquisition Cards

Human Kinarm Labs optionally include a National Instruments (NI) PCI-6071E or PCI-6229 card. If you plan to collect the data from the analog channels on the card you are encouraged to use the Analog Inputs block in the Kinarm I/O library. This block allows you to control the sampling time (i.e. scan interval) for the analog-to-digital acquisition, and will make your task portable between older and newer Kinarm models. Reasons for controlling the scan interval are to ensure that you do not get cross-talk between channels (if the scan interval is too short), and avoiding CPU overload (if the scan interval is too long). See 8.2 Error – “CPU Overload” for more information related to this block.


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).