TraceConfigure

This parameter is used to configure the trace process and the file generated in a trace session.

  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

The trace process is configured as a numeric “flag” value, that matches the fields defined within the type ParameterValueTrace.

Default Value

The default value of this parameter is SingleFile, which means a single file is created and filled out until the maximum configured file size is reached.

  Note

The base name of the trace file is always the name of the PCAN Channel being used, as specified in the native PCAN-Basic library (PCAN_USBBUS1.trc, for example).

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 tracing process for a USB Channel:

C#
PcanChannel channelUsed = PcanChannel.Usb01;

if (Api.Initialize(channelUsed, Bitrate.Pcan500) == PcanStatus.OK)
{
    if (Api.SetValue(channelUsed, PcanParameter.TraceConfigure, ParameterValue.Trace.MultiFiles) == PcanStatus.OK)
        Console.WriteLine($"The tracing process was successfully configured for {channelUsed} to generate multiple files.");
    else
        Console.WriteLine($"Error configuring tracing for {channelUsed}.");
    Api.Uninitialize(channelUsed);
}

See Also