Using PCAN Basics

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
aidanCNI
Posts: 1
Joined: Wed 4. Mar 2020, 22:26

Using PCAN Basics

Post by aidanCNI » Wed 4. Mar 2020, 22:33

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.

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Using PCAN Basics

Post by M.Heidemann » Thu 5. Mar 2020, 08:51

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:

Code: Select all

ls /dev
ShowDevices.PNG
ShowDevices.PNG (23.23 KiB) Viewed 2337 times
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:

Code: Select all

make all
this will compile the necessary files.

You can now call, for example, receivetest like this (directly refering to your device)

Code: Select all

 ./receivetest -f/dev/pcanusbfd32
receivetestdevicereference.PNG
receivetestdevicereference.PNG (9.29 KiB) Viewed 2334 times
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:

Code: Select all

#define DEFAULT_NODE "/dev/pcan0"
replace the default node "pcan0" with your device name and save the file.

then switch back to the test directory and execute:

Code: Select all

make all
this will build the test-applications on your machine.

to run the test-application you can call it like so:

Code: Select all

./receivetest
receivetest.PNG
receivetest.PNG (8.69 KiB) Viewed 2336 times

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

Post Reply