This parameter is used to get the firmware version of the device associated with a PCAN Channel. It can be used to determine if a device is up to date, or simply as informational output in an application.
It is available since PCAN-Basic version 4.4.0.
This parameter can only be read. It cannot be modified.
The firmware version value is represented as a string of the form “a.b.c”, where:
a: represents the major version number.
b: represents the minor version number.
c: represents the release version number.
All three values have a maximum size of 16 bits that allows a value of 65535 per each. The returned value is a null-terminated string with a maximum length of 18 bytes.
Does not apply.
Get: The PCAN Channel must be initialized before using this parameter.
The following code shows how to retrieve the firmware version of a USB Channel:
PcanChannel channelUsed = PcanChannel.Usb01;
if (Api.Initialize(channelUsed, Bitrate.Pcan500) == PcanStatus.OK)
{
string firmware;
if (Api.GetValue(channelUsed, PcanParameter.FirmwareVersion, out firmware) == PcanStatus.OK)
Console.WriteLine($"Firmware version of {channelUsed}: {firmware}");
else
Console.WriteLine($"Error retrieving the firmware version on channel {channelUsed}");
Api.Uninitialize(channelUsed);
}Dim channelUsed As PcanChannel = PcanChannel.Usb01
If Api.Initialize(channelUsed, Bitrate.Pcan500) = PcanStatus.OK Then
Dim firmware As String = Nothing
If Api.GetValue(channelUsed, PcanParameter.FirmwareVersion, firmware) = PcanStatus.OK Then
Console.WriteLine($"Firmware version of {channelUsed}: {firmware}")
Else
Console.WriteLine($"Error retrieving the firmware version on channel {channelUsed}")
End If
Api.Uninitialize(channelUsed)
End IfPcanChannel channelUsed = PcanChannel::Usb01;
if (Api::Initialize(channelUsed, Bitrate::Pcan500) == PcanStatus::OK)
{
String^ firmware;
if (Api::GetValue(channelUsed, PcanParameter::FirmwareVersion, firmware) == PcanStatus::OK)
Console::WriteLine("Firmware version of {0}: {1}", channelUsed, firmware);
else
Console::WriteLine("Error retrieving the firmware version on channel {0}", channelUsed);
Api::Uninitialize(channelUsed);
}