Page 1 of 1
Error Running 2 PCANBASIC based applications
Posted: Fri 27. Nov 2020, 18:12
by blipton
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?
Re: Error Running 2 PCANBASIC based applications
Posted: Sun 29. Nov 2020, 12:57
by PEAK-Support
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.
Re: Error Running 2 PCANBASIC based applications
Posted: Sun 29. Nov 2020, 22:06
by blipton
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?
Re: Error Running 2 PCANBASIC based applications
Posted: Mon 30. Nov 2020, 09:08
by PEAK-Support
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)