PCANBasicExample_py3.pyw freeze initialization when CANFD with Python3 , have solution.
Posted: Fri 13. Mar 2020, 10:48
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:
need be replaced to
there could be other similar problems if strings are passed to "c" functions from python3 .
Please update example.
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())
Code: Select all
result = self.m_objPCANBasic.InitializeFD(self.m_PcanHandle, self.m_BitrateTXT.get().encode())
Please update example.