Data Logger
With the data logger you can log the values of variables within a component or project during offline, or a project during online experimentation. The values are written to a file and can later be analyzed with a measurement data analysis application (e.g., the MDA). There are three logging modes:
Logging all value changes requires a change in the code generation settings (see Preparing to Log All Value Changes). Code is then generated so that every time the value of a logged variable is changed, that change is automatically recorded. That way all changes in a variable can be logged.
If desired, you can reduce this mode to logging only the last change in a time stamp for each logged variable (see Selecting the Logging Mode).
Because the code is changed, logging all value changes influences the runtime behavior of the model. The amount of data generated by the data logger increases, because a time stamp has to be generated for each logged variable.
Periodic sampling does not require any code modifications and therefore only minimally influences the runtime behavior of the model. Here, logging is triggered by a particular task, i.e. every time a selected task is triggered, the current value of all logged variables is recorded. This does not influence the runtime behavior of the selected task, as logging is performed only after the task is finished. If the value of a logged variable changes several times between subsequent logging operations, only the last change is recorded. No time stamp needs to be generated, because logging happens at pre-defined, fixed intervals.
Logged data is stored on a ring buffer in the target and written to the PC-host after the recording is stopped, where it is written to another ring buffer. A ring buffer always stores a pre-defined number of values and, once that number is exceeded, overwrites the previously stored values on a first-in-first-out basis. Therefore, data can be logged only for a limited time. To avoid this problem, you can activate Continuous Polling. With that, data is transferred to the PC-host at regular intervals during the logging operation. However, the communication with the host may affect the target processor, and gain and loss have to be weighed for each application.
If a longer registering time is desired, the target, as a rule, cannot provide sufficient RAM for the recording. In that case, you can use the Periodic to File mode. Here, too, logging is triggered by a particular task, but, different from Periodic Sampling, the data is transferred to the PC-host at regular intervals during the logging operation. Thus, data can be registered
For each of the three logging modes, data is written from the PC-host to a file once the logging operation is stopped (see Stopping Data Logging).
There are three limiting factors on the number of variables that can be logged and the rate at which data can be recorded:
- A portion of the target RAM is allocated to storing the logged data. The more RAM the target has, the more values can be logged.
- The data transfer between host and target influences the data logging. If, for instance, the target has little RAM, but the data can be transferred to the host very quickly, more values can be recorded.
- The logged values are stored on the host RAM (physical plus virtual), the more free RAM the PC has, the more data can be held.
Before you can log data in Log all value changes mode, you have to modify the code generation settings.
Note |
|---|
The Log all value changes mode can only be activated from within a project. |
See also
Preparing to Log All Value Changes