How to use xSCOPE to capture floating point data
version
1.1.1
scope
Example.
This code is provided as example code for a user to base their code on.
description
How to use xSCOPE to capture floating point data
boards
Unless otherwise specified, this example runs on the SliceKIT Core Board, but can easily be run on any XMOS device by using a different XN file.
xSCOPE is fully supported on hardware platforms which provide an XMOS link between the target device and the XSYS development connector, it is also supported using xSIM.
View the document (xSCOPE overview) for further information on tracing data from XMOS applications.
This example provides a simple demonstration of using the xSCOPE continuous event type for data logging from within an xCORE application. The continuous event type is used for recording the value of a variables within an application. The data type captured by the xSCOPE probe can be specified by the user and in this case we look at capturing a floating point value.
The probe configuration is handled by the user providing a config.xscope file which is picked up as part of the application build.
This example assumes you are familiar with creating a run configuration and enabling the associated xSCOPE options in that run configuration in the xTIMEcomposer Studio or using the command line tools.
In order to used xSCOPE the correct header file must be included in the application
#include <xscope.h>
The xscope_float() function is used to send the contents of user variable value to the specified XSCOPE probe. The floating point type is recorded for correct display when the data is processed on the host machine. In this example data is sent to the registered probes SIN_1 - SIN_9.
xscope_float(SIN_1, value * 100);