11-25-2013 06:40 AM
Hi,
I am using a CAN bus to control signal from my PC. When i run the program it gives me an error " A PCAN Channel has not been initialized yet or the initialization process has failed ". Is there anyone who can tell me how to remove this error because i am stuck with this problem.
11-25-2013 08:42 AM
So you have a problem with your PCAN hardware (Non NI hardware) ?
Have you connected/plugged in your PCAN dongle ?
Is it looking for the right port?
10-30-2018 03:39 AM
I am getting the same message but once I stop the VI. I am sending and receiving signals over a CAN-bus with two units (201/181 & 202/182) using my computer as the master. I have 3 while loops and one timed loop all are working in parallel. Two while loops contain the CAN Write VI, the timed loop contains the CAN Read VI and the last while loop to process the messages and write data in a file. All the loops have a local variable that is connected to a stop button. Once I press the button the VI don't completely stop and I get the message "A PCAN Channel has not been initialized yet or the initialization process has failed". It's worth mentioning that I am also using PCAN USB adapter and the PCAN package in Labview. Finally, sometimes the VI will stop normally when I press the stop button.
I am also new to LabView and CAN in general, so if you have any advice on best practices when writing the code in the block diagram with PCAN package that would be helpful as well.
10-30-2018 03:50 AM
Hi Adel,
Once I press the button the VI don't completely stop and I get the message "A PCAN Channel has not been initialized yet or the initialization process has failed".
Probably you get that error much earlier, but it is only shown once those loops stops - using the default error handling of LabVIEW.
Did you try to debug your VI? Are you sure where the error is created?
10-30-2018 04:15 AM
The Error Handler is inside the timed loop, so I can see the error once it happens. I tried debugging it but using highlight execution and retain wire value to see where the problem originates but I couldn't find it.
10-30-2018 04:45 AM
Import PCAN library as dll.
I am using the old one PCANBasic.
To Init use proper channel(probably 51hex, depends on connection order), and set proper speed according to your app. you can verify it PCANView(there is an infromation wchich channels are taken)
Read all data in while loop, till buffer zero.
I use this way for 5 years and works well.
Attached some cuts from my functions
12-13-2024 03:24 AM - edited 12-13-2024 03:25 AM
Hey, could you please share your Vi, it will be helpful to me i only need to read the CAN readings.
I am having trouble in communicating with PCAN USB cable.
Thanks, in advance.
I am using LabVIEW 2018.