Page 1 of 1

PCANBasicExample_py3.pyw freeze initialization when CANFD with Python3 , have solution.

Posted: Fri 13. Mar 2020, 10:48
by Pe3ucTop
Hello PEAK-Systems.

I tried to use Python3 PCANBasic Example and find it freeze at Initialize when CAN-FD is selected.
I do a bit research and find that problem is in initialization Bitrate string.
In python3 all string are unicode, but to c_dll need pass bytestring, so line:

Code: Select all

result =  self.m_objPCANBasic.InitializeFD(self.m_PcanHandle, self.m_BitrateTXT.get())
need be replaced to

Code: Select all

result =  self.m_objPCANBasic.InitializeFD(self.m_PcanHandle, self.m_BitrateTXT.get().encode())
there could be other similar problems if strings are passed to "c" functions from python3 .
Please update example.

Re: PCANBasicExample_py3.pyw freeze initialization when CANFD with Python3 , have solution.

Posted: Fri 13. Mar 2020, 11:18
by K.Wagner
Hello,

this a known issue that we have already fixed. This will be delivered with the next release of PCAN-Basic