Main Content

Realtime Data Logging with Two-Model Approach

The two-model approach is a real-time data logging method that involves the creation of two models. One running on the target, transmitting data to a serial port, and the other operating on the host, receiving data from the target. This approach offers fast data logging capabilities, enabling higher transfer rates compared to traditional methods. For more information, see Closed Loop Control of a DC-DC Buck Converter.

The following table describes the differences between External Mode and Two-Model approach.

Differences between External Mode and Two-Model approach

External ModeTwo-Model approach
Data logging supports up to a maximum rate of 20kHz.Data transfer supports up to a maximum rate of 200kHz.
Ideal for 4 to 40 signals.Ideal for up to 3 signals.
Additional processing required by the target for external mode.No additional processing is required by the target.
Extra buffer needs to be allocated by updating heap_size parameter in the configuration parameters.No need to allocate extra buffer size.

Considerations when using Two-Model approach

  • The number of signals that can be logged depends on the baud rate and the rate at which the data is transferred. For example, consider that we need to transfer 10 bytes of data at 20kHz.

    1. 10 bytes * 20,000Hz = 200,000 bytes/s

    2. 200,000 bytes/s * 10 bits/byte = 2,000,000 bits/s (baud rate) i.e, 2e6.

    3. The desired baud rate in this case is 2e6 i.e, 2 Mbps.

  • On the same lines, using two model approach, the data can be transferred at a higher rate of 200kHz. A maximum of 3 uint16 signals can be transferred at a rate of 200KHz if the baud rate is configured as 12Mbps. For more information, see https://in.mathworks.com/matlabcentral/fileexchange/61420-dc-dc-buck-converter-example

Things to Consider During Reference Modeling

See Also

| |

Related Topics