Error Running 2 PCANBASIC based applications

The free CAN Software API (Application Programming Interface) for Windows®
Post Reply
blipton
Posts: 17
Joined: Sat 11. Jul 2020, 02:22

Error Running 2 PCANBASIC based applications

Post by blipton » Fri 27. Nov 2020, 18:12

I've written 2 python applications that work fine when run by themselves , but when I try to open both, I get this error on whichever app I open last:
returned value= 67108864
returned value= 0x4000000

I'm using the PCANBasic.dll driver (7/9/2020), and both applications are accessing the same CAN device so the baud rate initialization is identical.

Interestingly, PEAK-View works fine, whether it's opened before or after my application.. but my application won't work if PEAK-View is opened first (same baud rate).

How can I run my 2 applications simultaenously?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Error Running 2 PCANBASIC based applications

Post by PEAK-Support » Sun 29. Nov 2020, 12:57

Any used CAN Channel that is initialized by the PCAN-Basic API could not be used by a second PCAN-Basic based API.
This is not possible. Our Low Level Tools (like PCAN-View, PCAN-Explorer etc.) are build with the PCAN-Developer API (commercial version) which handle this different.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

blipton
Posts: 17
Joined: Sat 11. Jul 2020, 02:22

Re: Error Running 2 PCANBASIC based applications

Post by blipton » Sun 29. Nov 2020, 22:06

If we purchase 'PCAN-Developer 4', would the applications need to be modified (to support simultaneous running via the commercial API), or would it be just a matter of replacing the DLL?

Also, if Peak-View is used to Initialize the CAN interface, could the applications be made to run without re-initializing, just the using the interface opened by PeakView?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Error Running 2 PCANBASIC based applications

Post by PEAK-Support » Mon 30. Nov 2020, 09:08

The PCAN-Developer is not compatile with the very simple PCAN-Basic API. The PCAN-Developer work completly differnet from the "basics" so you need to change your code to be compatible.
The Driver itself is the same - it is only a Wrapper with a simple Interface (PCAN-Basic) and a Interface where you have many more options and access to the Device (PCAN-Developer)
A initialized CAN Hardware create a "internal CAN Network" where other Tools could connect to (Clients) - like PCAN-View or PCAN-Basic. PCAN-Basic simply use a unique Client conection that could be used only once per Hardware.
In PCAN-View we are able to use multipble Clients as Connections and so you could run it x times. (up to 64 "Clients" could be run at the same time)
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply