I just bought the package PCAN-Developer. Together I received also an example for Delphi XE.
Everything installed without error, also the example compiles without error. When starting the sample program I always get the error 512 (no driver) from the function RegisterThisClient, Unit1, line 1358 (helper function for CAN_RegisterClient). Below are the details:
1) Hardware PCAN-PRO-USB driver just updated, version 126.96.36.19947 PCAN-USB.sys
2) CanApi2.dll version 188.8.131.52
3) Embarcadero ® RAD Studio XE2 Version 16.0.4256.43595
4) also tested with Embarcadero ® Delphi ® Version 17.0.4625.53395 XE3
5) windows 7 64bit (compile platform 32bit)
I need suggestions.
it seems like the active CAN device is not set to USB. There are two ways to set this:
- Using the Control Panel: Go to the control panel and start the PCAN-Hardware applet. In the tab "CAN Hardware" select USB from the Drop-Down box "Active Device" and click OK.
- Using the function CAN_SetdeviceName: This function sets the PCAN device to be used for subsequent CanApi2 function calls.
Code: Select all
just one question: my understanding was that the canapi2 was suitable also for exchanging can msgs between two client without the need of a hardware connected to the pc. just using net name. Is this correct?
Note that in case of the USB, its driver is initialized after it is first plugged-in (at least one time after a computer is booted). If you only want to use internal nets without hardware, consider using the virtual driver.
switch to USB on the control panel make the examample software work.
The problem is that on the control panell applet there is not "virtual" on the LIstbox, but only "USB".
If I open the CAN NetConfig software there is no way to add virtual.
I'm sure i miss some information. Can you explain?
You will find the setup for it inside the folder "VirtualDriver", in the PCAN-Developer installation directory (commonly C:\Program Files\PCAN-Developer 3\). Use the file according with your system, PcanVirtual.msi for 32-Bit, PcanVirtual64.msi for 64-Bit.
After installing it you will be able to create virtual nets and to use them for communication. Remember to set the active device to Virtual.
I recommend you to read the Introduction chapter of the help file CanApi2 documentation. It is short and precise and allows a fast understanding of the CanApi2.