Note
Trying to configure a trace process will fail if tracing is already active.
This parameter is used to set the maximum size in megabytes that a single PCAN-Trace file can have.
It is available since PCAN-Basic version 1.3.0.
This parameter is read/write. It can be configured and retrieved.
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. |
The default size is 10 Megabytes. This allows to record about 166.000~ CAN messages (Standard frames, with 8 data bytes).
Get: The PCAN Channel must be initialized before using this parameter.
Set: The PCAN Channel must be initialized before using this parameter.
The following code shows how to configure the size of trace files for a USB Channel:
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);
}Dim channelUsed As PcanChannel = PcanChannel.Usb01
If Api.Initialize(channelUsed, Bitrate.Pcan500) = PcanStatus.OK Then
Dim size As UInteger = 50
If Api.SetValue(channelUsed, PcanParameter.TraceSize, size) = PcanStatus.OK Then
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}.")
End If
Api.Uninitialize(channelUsed)
End IfPcanChannel channelUsed = PcanChannel::Usb01;
if (Api::Initialize(channelUsed, Bitrate::Pcan500) == PcanStatus::OK)
{
UInt32 size = 50;
if (Api::SetValue(channelUsed, PcanParameter::TraceSize, size) == PcanStatus::OK)
Console::WriteLine("The size for traces files generated with {0} was set to {1} megabytes.", channelUsed, size);
else
Console::WriteLine("Error configuring the trace file size for {0}.", channelUsed);
Api::Uninitialize(channelUsed);
}