I have a device which communicates via RS-232 Port, there are some commands for reading and writing. To make the communication automatic I am using Python(PySerial Library) language, But I am facing a little problem while working, that is, initially everything works fine but after some time I get consistent error of communication failure. I searched a lot on the internet but did not found any relevant solution for that. Programming wise everything is correct from my side, maybe there are some issue with hardware I am not able to figure out.
So please help me to make a robust serial communication system.
Any SOP(Standard Operating Procedure) regarding serial communication programming would be highly appreciated.
PS: I am using USB to RS-232 Cable to connect my RS-232 device and PC.