PCAN Developer problem

CAN Development Packages for Windows®
Post Reply
rampinia
Posts: 26
Joined: Sat 5. Mar 2011, 11:37

PCAN Developer problem

Post by rampinia » Tue 26. Feb 2013, 12:08

hello

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 3.5.4.9547 PCAN-USB.sys
2) CanApi2.dll version 2.56.2.0
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.

thanks

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN Developer problem

Post by K.Wagner » Tue 26. Feb 2013, 12:27

Hello rampinia,

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.
    PCAN-Hardware Applet
    PCAN-Hardware Applet
    ControlPanel.jpg (51.87 KiB) Viewed 7310 times
  • Using the function CAN_SetdeviceName: This function sets the PCAN device to be used for subsequent CanApi2 function calls.

    Code: Select all

    CAN_SetDeviceName('pcan_usb');
    
Best regards,
Keneth

rampinia
Posts: 26
Joined: Sat 5. Mar 2011, 11:37

Re: PCAN Developer problem

Post by rampinia » Tue 26. Feb 2013, 12:54

Thank for your support.

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?

regards,

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN Developer problem

Post by K.Wagner » Tue 26. Feb 2013, 13:22

Yes this is correct. With the Canapi2 all connections go through PCAN-Nets (CAN Network extension). All clients connected to the same net communicate with each other since they are participants of the same CAN network. Nets are parked, i.e. marked as "Internal", when the hardware they belong is absent.

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.
Best regards,
Keneth

rampinia
Posts: 26
Joined: Sat 5. Mar 2011, 11:37

Re: PCAN Developer problem

Post by rampinia » Tue 26. Feb 2013, 13:57

Thank you again,

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?

Thanks again

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN Developer problem

Post by K.Wagner » Tue 26. Feb 2013, 14:18

If you cannot see the Virtual driver is because it is not installed on your system.

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.
Best regards,
Keneth

rampinia
Posts: 26
Joined: Sat 5. Mar 2011, 11:37

Re: PCAN Developer problem

Post by rampinia » Tue 26. Feb 2013, 14:24

Ok, I'll check.

Another question: can the two driver co-hexists? I mean can one application connect to a net1@virtual_driver and another application connect to net2@usb_driver?

Thanks

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN Developer problem

Post by K.Wagner » Tue 26. Feb 2013, 14:41

Yes. All PCAN drivers can work simultaneously in a computer. That's why there is a CAN_SetDeviceName function and the possibility to set an active device in the PCAN-Hardware applet.

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.
Best regards,
Keneth

rampinia
Posts: 26
Joined: Sat 5. Mar 2011, 11:37

Re: PCAN Developer problem

Post by rampinia » Tue 26. Feb 2013, 15:53

Thank you again,

very helpful conversation.

I'll read the chapter for sure.

Ciao,

Post Reply