Apr-15-2019, 03:05 AM
message = f'{message}\n' ser.write(message.encode('ascii')f-string require python 3.6 or newer
alternative:
message = '{}\n'.format(message)
Problem to sent message with pyserial and ser.write
|
Apr-15-2019, 03:05 AM
message = f'{message}\n' ser.write(message.encode('ascii')f-string require python 3.6 or newer alternative: message = '{}\n'.format(message)
Apr-15-2019, 09:40 AM
(This post was last modified: Apr-15-2019, 09:40 AM by DJ_Depannage.)
Thank you Larz60+ :)
Is it possible to have the equivalent of the following line in python please ? ReadInterval=2147483647, ReadTotalTimeoutMultiplier=0, ReadTotalTimeoutConstant=1100, WriteTotalTimeoutMultiplier=0, WriteTotalTimeoutConstant=0
Apr-15-2019, 11:23 AM
Are you asking how to add CRLF to these?
if so use same method as with message example: ReadInterval = '{}\n'.format(2147483647)
Apr-15-2019, 01:56 PM
(This post was last modified: Apr-15-2019, 01:57 PM by DJ_Depannage.)
Sorry, english is not my native language.
I need to improve the communication of the script to the serial port. The display is very capricious on receiving the data. The display captures only 1 word. If I send 10 words for example, it blocks and displays nothing. I should be able to regulate the speed of sending the order or something like that. The sniper give me this value when I send the orders :
Is it possible to import its values into pyserial, and if so how?
Apr-15-2019, 08:37 PM
(This post was last modified: Apr-15-2019, 08:37 PM by DJ_Depannage.)
I read in the pyserial documentation that XonXoff can have the value: True or False.
It is not possible to have? Xon = 32768 Xoff = 8192 With cutecom, everything works perfectly. It's why I think I have problem with RS232 communication in my python script.
Apr-15-2019, 08:38 PM
Xon, Xoff is (usually, and hopefully with this package as well ) serial flow control and stands for pause transmission and resume transmission so would be a Boolean value.
Apr-15-2019, 08:41 PM
Thank you for your help Larz60+ :)
YES, I think you are rigth ! Do you have any idea how I can improve my code?
Apr-15-2019, 08:43 PM
Don't have time to look at it now, perhaps later
Apr-15-2019, 08:45 PM
Thank you Larz60+, I will try to continue my research :)
|
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
write to csv file problem | jacksfrustration | 11 | 5,532 |
Nov-09-2023, 01:56 PM Last Post: deanhystad |
|
little problem with read out and write into a file | hello_its_me | 11 | 10,507 |
Sep-04-2017, 11:54 AM Last Post: wavic |