Using PCAN Basics
Using PCAN Basics
Apologies if my question is quite basic but I am new to the use of the PCAN Basics API and PCAN Linux Drivers. I have both installed on my raspberrypi3 but I have no idea how to get the C++ examples running. If anyone could point me to the proper documentation/tutorial that shows this that would be great. Otherwise, step-by-step instructions on what I would need to do to get the C++ examples running (ie. includes, which folders files should be in, etc.) that would be greatly appreciated.
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: Using PCAN Basics
Hello,
Make sure you have the CharDev version of our driver installed, for this see this forum post:
viewtopic.php?f=59&t=3381
Please follow the steps outlined in the forum post.
Once you have done this you can check via:
What name your device has.
In my example i use a PCAN-USB FD, so my device received the name "pcanusbfd32".
change into your "test" dirctory within your driver download package and execute:
this will compile the necessary files.
You can now call, for example, receivetest like this (directly refering to your device)
Another way use the test-applications is to modify the default node:
change into the directory /test/src/ within your driver download-package, it contains the code for the test-applications.
Open the file you want to use with a text-editor:
Look for this line:
replace the default node "pcan0" with your device name and save the file.
then switch back to the test directory and execute:
this will build the test-applications on your machine.
to run the test-application you can call it like so:
This is also explained in the documentation for our Linux driver package (see chapter 4.7 "test directory"):
http://www.peak-system.com/fileadmin/me ... an_eng.pdf
Best Regards
Marvin
Make sure you have the CharDev version of our driver installed, for this see this forum post:
viewtopic.php?f=59&t=3381
Please follow the steps outlined in the forum post.
Once you have done this you can check via:
Code: Select all
ls /dev
In my example i use a PCAN-USB FD, so my device received the name "pcanusbfd32".
change into your "test" dirctory within your driver download package and execute:
Code: Select all
make all
You can now call, for example, receivetest like this (directly refering to your device)
Code: Select all
./receivetest -f/dev/pcanusbfd32
change into the directory /test/src/ within your driver download-package, it contains the code for the test-applications.
Open the file you want to use with a text-editor:
Look for this line:
Code: Select all
#define DEFAULT_NODE "/dev/pcan0"
then switch back to the test directory and execute:
Code: Select all
make all
to run the test-application you can call it like so:
Code: Select all
./receivetest
This is also explained in the documentation for our Linux driver package (see chapter 4.7 "test directory"):
http://www.peak-system.com/fileadmin/me ... an_eng.pdf
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team