extra care must be taken when connecting up to an RS232 or other system that utilises different voltage levels. An adapter must be used to convert the voltage levels between the two protocols.
Indeed. They are incredibly cheap, and 'just work'.
USB serial adaptors should appear as serial devices, you can then use any serial software (lots of examples in C and Python on the net) to do what ever communications you need.LinuxKoku wrote: ↑Mon Jun 18, 2018 11:48 amHello
I have indeed a USB / RS232 adapter (https://www.digikey.it/product-detail/i ... ND/3103022), so if I look at this solution, you think that flinching enough to do the exchange of data? Or should there be a python program to do that?
For a better understanding of my questions, here is the explanation and purpose of my research in more detail ( viewtopic.php?f=36&t=216052&p=1328688#p1328688)
You can close one of the two post, if you find this is repetitive
Thanks for your feedback,
You need to know exactly what data it is you need to send and you need to know exactly what data you will receive.
That seems about right.
There are a number of different interpretations on what may be meant by "a hexadecimal string" so you would have to ask your tutor which it is or provide some details of the device you are communicating with.
I am guessing that, in Python, one of these will do the job where 'hh' and 'll' are your CRC values -
Code: Select all
def ToHexString(n): return "0"+( hex(n)[2:] )[-2:].upper() ser.write( "7E"+"7E"+"73"+"02"+ToHexString(hh)+ToHexString(ll) )
Code: Select all
ser.write( chr(0x7E)+chr(0x7E)+chr(0x73)+chr(0x02)+chr(hh)+chr(ll) )