This parameter is used to retrieve the version of this API implementation. It can be used to determine whether or not a feature is available, or simply as an informational output in an application.
Available since PCAN-Basic version 1.0.0.
Any Channel: Due to the API structure, a Channel value is needed to get a the value of a PcanParameter, when using the GetValue. But since the API version doesn’t depend on a specific Channel, any defined PcanChannel value can be used, including None.
This parameter can only be read. It cannot be modified.
The API version value is represented as a string of the form “a.b.c.d”, where:
a: represents the major version number.
b: represents the minor version number.
c: represents the release version number.
d: represents the build number.
All four 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 24 bytes.
Does not apply.
Get: Not relevant since this parameter is not channel dependent.
The following code shows how to retrieve the API version:
string apiVersion;
if (Api.GetValue(PcanChannel.None, PcanParameter.ApiVersion, out apiVersion) == PcanStatus.OK)
Console.WriteLine($"The PCAN-Basic version used is: {apiVersion}");Dim apiVersion As String = Nothing
If Api.GetValue(PcanChannel.None, PcanParameter.ApiVersion, apiVersion) = PcanStatus.OK Then
Console.WriteLine($"The PCAN-Basic version used is: {apiVersion}")
End IfString^ apiVersion;
if (Api::GetValue(PcanChannel::None, PcanParameter::ApiVersion, apiVersion) == PcanStatus::OK)
Console::WriteLine("The PCAN-Basic version used is: {0}", apiVersion);