Important
At the time of writing this documentation only PCAN-USB Pro FD, and PCAN-USB FD allow reading the GUID of the device.
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.
It is available since PCAN-Basic version 4.10.0.
This parameter can only be read. It cannot be modified.
A string representing a 128-bit label as hexadecimal values using the 8-4-4-4-12 format, RFC 4122.
Does not apply.
Get: This parameter can be used on both, initialized and uninitialized PCAN Channels.
The following code shows how to distinguish USB Channels using their device IDs:
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);Dim channelUsed As PcanChannel = PcanChannel.Usb01
Dim deviceGUID As String = Nothing
Dim stsResult As PcanStatus = Api.GetValue(channelUsed, PcanParameter.DeviceGUID, deviceGUID)
If (stsResult = PcanStatus.OK) Then
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)
End IfPcanChannel channelUsed = PcanChannel::Usb01;
String^ deviceGUID;
PcanStatus stsResult = Api::GetValue(channelUsed, PcanParameter::DeviceGUID, 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);