ApiVersion

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.

Availability

Available since PCAN-Basic version 1.0.0.

Supported By

  • 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.

Access Mode

This parameter can only be read. It cannot be modified.

Possible Values

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.

Default Value

Does not apply.

Initialization Status

Get: Not relevant since this parameter is not channel dependent.

Example

The following code shows how to retrieve the API version:

C#
string apiVersion;

if (Api.GetValue(PcanChannel.None, PcanParameter.ApiVersion, out apiVersion) == PcanStatus.OK)
    Console.WriteLine($"The PCAN-Basic version used is: {apiVersion}");

See Also