Getting PCAN_ERROR_NODRIVER on Windows 10 UWP Project
Posted: Tue 20. Feb 2018, 11:31
Hello,
Currently I am working on Porting existing Windows Forms project to Windows 10 (UWP) Project. The programming language is C#. UWP-> Universal Windows Platform. When I am trying to use same piece of code which was used earlier I am receiving the PCAN_ERROR_NODRIVER error. Do PCAN has support for Windows 10 UWP?
If i try the same piece of sample code in winforms it works fine but not in UWP.
for (int i = 0; i < m_HandlesArray.Length; i++)
{
// Includes all no-Plug&Play Handles
if (m_HandlesArray <= PCANBasic.PCAN_DNGBUS1) { }
// cbbChannel.Items.Add(FormatChannelName(m_HandlesArray));
else
{
// Checks for a Plug&Play Handle and, according with the return value, includes it
// into the list of available hardware channels.
stsResult = PCANBasic.GetValue(m_HandlesArray, TPCANParameter.PCAN_CHANNEL_CONDITION, out iBuffer, sizeof(UInt32));
if ((stsResult == TPCANStatus.PCAN_ERROR_OK) && (iBuffer == PCANBasic.PCAN_CHANNEL_AVAILABLE))
// I dont get iBuffer =1 that is what the reason I am suspecting
FormatChannelName(m_HandlesArray);
}
}
private void InitPCANDriver_Click(object sender, RoutedEventArgs e)
{
TPCANStatus stsResult;
m_PcanHandle = 81;
m_Baudrate = TPCANBaudrate.PCAN_BAUD_500K;
// Connects a selected PCAN-Basic channel
//stsResult = PCANBasic.Initialize(
// m_PcanHandle,
// m_Baudrate,
// m_HwType,
// Convert.ToUInt32(cbbIO.Text,16),
// Convert.ToUInt16(cbbInterrupt.Text));
stsResult = PCANBasic.Initialize(m_PcanHandle, m_Baudrate);
if (stsResult != TPCANStatus.PCAN_ERROR_OK)
{ }
//MessageBox.Show(GetFormatedError(stsResult));
else
{ }
}
Also i am using the Latest PEAK-Drivers 4.1.3. Also attached the .cs files for your reference.
Please do the needful at the earliest.
Currently I am working on Porting existing Windows Forms project to Windows 10 (UWP) Project. The programming language is C#. UWP-> Universal Windows Platform. When I am trying to use same piece of code which was used earlier I am receiving the PCAN_ERROR_NODRIVER error. Do PCAN has support for Windows 10 UWP?
If i try the same piece of sample code in winforms it works fine but not in UWP.
for (int i = 0; i < m_HandlesArray.Length; i++)
{
// Includes all no-Plug&Play Handles
if (m_HandlesArray <= PCANBasic.PCAN_DNGBUS1) { }
// cbbChannel.Items.Add(FormatChannelName(m_HandlesArray));
else
{
// Checks for a Plug&Play Handle and, according with the return value, includes it
// into the list of available hardware channels.
stsResult = PCANBasic.GetValue(m_HandlesArray, TPCANParameter.PCAN_CHANNEL_CONDITION, out iBuffer, sizeof(UInt32));
if ((stsResult == TPCANStatus.PCAN_ERROR_OK) && (iBuffer == PCANBasic.PCAN_CHANNEL_AVAILABLE))
// I dont get iBuffer =1 that is what the reason I am suspecting
FormatChannelName(m_HandlesArray);
}
}
private void InitPCANDriver_Click(object sender, RoutedEventArgs e)
{
TPCANStatus stsResult;
m_PcanHandle = 81;
m_Baudrate = TPCANBaudrate.PCAN_BAUD_500K;
// Connects a selected PCAN-Basic channel
//stsResult = PCANBasic.Initialize(
// m_PcanHandle,
// m_Baudrate,
// m_HwType,
// Convert.ToUInt32(cbbIO.Text,16),
// Convert.ToUInt16(cbbInterrupt.Text));
stsResult = PCANBasic.Initialize(m_PcanHandle, m_Baudrate);
if (stsResult != TPCANStatus.PCAN_ERROR_OK)
{ }
//MessageBox.Show(GetFormatedError(stsResult));
else
{ }
}
Also i am using the Latest PEAK-Drivers 4.1.3. Also attached the .cs files for your reference.
Please do the needful at the earliest.