Important
This feature is only supported by FPGA based devices with a firmware version equal to or greater than 2.4.0.
This parameter allows the configuration of a delay, with microsecond resolution, between CAN frames being sent within a PCAN Channel. Other applications working with the same PCAN-Hardware (for instance, a PCAN-View) are not influenced when configuring this delay.
This parameter can be used by applications that want to increase the separation time of consecutive transmitted CAN frames.
It is available since PCAN-Basic version 4.2.0.
This parameter is read/write. It can be configured and retrieved.
This is a numeric value in the range of [0...1023]) microseconds. If the value to be set is bigger than the resolution supported by the firmware, then the value is truncated.
The default value of the delay is 0, which means that this feature is deactivated. After configuring a value bigger than 0, the delay will be used until it is expressly deactivated (set to 0), or the Channel is disconnected, i.e., using the Uninitialize method.
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 set a 20 microseconds delay between CAN frames within a USB Channel:
PcanChannel channelUsed = PcanChannel.Usb01;
if (Api.Initialize(channelUsed, Bitrate.Pcan500) == PcanStatus.OK)
{
uint delay = 20;
if (Api.SetValue(channelUsed, PcanParameter.InterframeDelay, delay) == PcanStatus.OK)
Console.WriteLine($"A delay of {delay} microseconds between frames was configured for {channelUsed}.");
else
Console.WriteLine($"Error configuring a delay on channel {channelUsed}.");
Api.Uninitialize(channelUsed);
}Dim channelUsed As PcanChannel = PcanChannel.Usb01
If Api.Initialize(channelUsed, Bitrate.Pcan500) = PcanStatus.OK Then
Dim delay As UInteger = 20
If Api.SetValue(channelUsed, PcanParameter.InterframeDelay, delay) = PcanStatus.OK Then
Console.WriteLine($"A delay of {delay} microseconds between frames was configured for {channelUsed}.")
Else
Console.WriteLine($"Error configuring a delay on channel {channelUsed}.")
End If
Api.Uninitialize(channelUsed)
End IfPcanChannel channelUsed = PcanChannel::Usb01;
if (Api::Initialize(channelUsed, Bitrate::Pcan500) == PcanStatus::OK)
{
UInt32 delay = 0;
if (Api::SetValue(channelUsed, PcanParameter::InterframeDelay, delay) == PcanStatus::OK)
Console::WriteLine("A delay of {0} microseconds between frames was configured for {1}.", delay, channelUsed);
else
Console::WriteLine("Error configuring a delay on channel {0}.", channelUsed);
Api::Uninitialize(channelUsed);
}