Python Forum
Python 3 Serial communication need help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: Python 3 Serial communication need help (/thread-25025.html)



Python 3 Serial communication need help - jegatheesans - Mar-16-2020

I am develop a data logger in raspberry pi. I want to fetch data from a temperature controller. Previously i develop a data logger application using vb.net and its currently working. We want to send the data in the format chr(12) + chr(3) + chr(0) + chr(0) + chr(0)+ chr(2) + CRC(chr(12) + chr(3) + chr(0) + chr(0) + chr(0)+ chr(2)). In phyton3 i easily create the CRC and the result is converted in to char and send the 8 characters. In phyton3 we cant able to send the unicode so we want to encode it. If encode in phyton3 the crc chr created are 191, 163 so in phyton3 its split in to two characters for each chr. So total chractor send is 10. If we decode in phyton3 the output is correct. But the instrument never respond for that command. If i create a byte array with the crc with 8 charactor the instrument reply correctly. When go through articles in phyton3 if the char greater then 127 while encode phyton automatically split in to two charactor. Need help in this. Thanks in Advance.