TraceSize

This parameter is used to set the maximum size in megabytes that a single PCAN-Trace file can have.

  Note

Trying to configure a trace process will fail if tracing is already active.

Availability

It is available since PCAN-Basic version 1.3.0.

Supported By

Access Mode

This parameter is read/write. It can be configured and retrieved.

Possible Values

A numeric value representing the number of megabytes a file can store. To use the default size, 10 megabytes, the value of 0 must be set.

Kind of Size

Value

Custom size

A value in the range [1...100].

Default size (10 megabytes)

A value of 0.

Default Value

The default size is 10 Megabytes. This allows to record about 166.000~ CAN messages (Standard frames, with 8 data bytes).

Initialization Status

Get: The PCAN Channel must be initialized before using this parameter.

Set: The PCAN Channel must be initialized before using this parameter.

Example

The following code shows how to configure the size of trace files for a USB Channel:

C#
PcanChannel channelUsed = PcanChannel.Usb01;

if (Api.Initialize(channelUsed, Bitrate.Pcan500) == PcanStatus.OK)
{
    uint size = 50;
    if (Api.SetValue(channelUsed, PcanParameter.TraceSize, size) == PcanStatus.OK)
        Console.WriteLine($"The size for traces files generated with {channelUsed} was set to {size} megabytes.");
    else
        Console.WriteLine($"Error configuring the trace file size for {channelUsed}.");
    Api.Uninitialize(channelUsed);
}

See Also