DeviceGUID

This parameter is used to identify a device connected to a computer. A global unique identifier (GUID) is a persistent, distinctive, and immutable value stored in the flash memory of each device.

As the name suggests, this type of value ensures that devices do not have the same identifier. This makes unambiguous recognition of a PCAN device possible.

This parameter can be used when it is necessary to work only with a specific device, i.e. to unequivocally identify a PCAN device connected to the system at a given time.

  Important

At the time of writing this documentation only PCAN-USB Pro FD, and PCAN-USB FD allow reading the GUID of the device.

Availability

It is available since PCAN-Basic version 4.10.0.

Supported By

  Important

Only FPGA based devices. Requires a firmware version equal to or greater than 3.5.1, and a device driver version equal to or greater than 4.6.0.

Access Mode

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

Possible Values

A string representing a 128-bit label as hexadecimal values using the 8-4-4-4-12 format, RFC 4122.

Default Value

Does not apply.

Initialization Status

Get: This parameter can be used on both, initialized and uninitialized PCAN Channels.

Example

The following code shows how to distinguish USB Channels using their device IDs:

C#
PcanChannel channelUsed = PcanChannel.Usb01;

PcanStatus stsResult = Api.GetValue(channelUsed, PcanParameter.DeviceGUID, out string deviceGUID);
if (stsResult == PcanStatus.OK)
    Console.WriteLine("The GUID associated to 0x{0:X} is {1}.", channelUsed, deviceGUID);
else
    Console.WriteLine("Error! Could not get the GUID for channel 0x{0:X}.", channelUsed);

See Also