Note
At the time of writing this documentation only PCAN-Chip USB based devices, with a firmware version equal to or greater than 3.3.0, support only 1 analog pin.
No error is generated by setting a bit for a nonexistent Pin.
This parameter is used for reading analog voltages from the analog input Pin of a device.
It is available since PCAN-Basic version 4.3.0.
This parameter can only be retrieved. It cannot be modified.
This parameter has a resolution of a double-word (range [0...MaxValue]). The returned value represents the direct value from the A/D converter, which is an unsigned integer value.
The returned value must be converted into a signed value, considering the external wiring.
Does not apply.
Set: The PCAN Channel must be initialized before using this parameter.
The following code shows how to retrieve the value of the analog Pin of a USB Channel:
PcanChannel channelUsed = PcanChannel.Usb01;
if (Api.Initialize(channelUsed, Bitrate.Pcan500) == PcanStatus.OK)
{
uint rawValue;
if (Api.GetValue(channelUsed, PcanParameter.IoAnalogValue, out rawValue) == PcanStatus.OK)
Console.WriteLine($"The raw value of the analog Pin of {channelUsed} is {rawValue}.");
else
Console.WriteLine($"Error retrieving the analog Pin value from {channelUsed}.");
Api.Uninitialize(channelUsed);
}Dim channelUsed As PcanChannel = PcanChannel.Usb01
If Api.Initialize(channelUsed, Bitrate.Pcan500) = PcanStatus.OK Then
Dim rawValue As UInteger
If Api.GetValue(channelUsed, PcanParameter.IoAnalogValue, rawValue) = PcanStatus.OK Then
Console.WriteLine($"The raw value of the analog Pin of {channelUsed} is {rawValue}.")
Else
Console.WriteLine($"Error retrieving the analog Pin value from {channelUsed}.")
End If
Api.Uninitialize(channelUsed)
End IfPcanChannel channelUsed = PcanChannel::Usb01;
if (Api::Initialize(channelUsed, Bitrate::Pcan500) == PcanStatus::OK)
{
UInt32 rawValue;
if (Api::GetValue(channelUsed, PcanParameter::IoAnalogValue, rawValue) == PcanStatus::OK)
Console::WriteLine("The raw value of the analog Pin of {0} is {1}.", channelUsed, rawValue);
else
Console::WriteLine("Error retrieving the analog Pin value from {0}.", channelUsed);
Api::Uninitialize(channelUsed);
}