chwiede / pyads

Beckhoff ADS implementation for python
MIT License
49 stars 14 forks source link

Reason for having a thread for reading messages from PLC #3

Closed wolfc01 closed 9 years ago

wolfc01 commented 9 years ago

Hello,

I've walked through the code and I wonder what is the reason for having a separate thread for reading messages from the PLC?

am I overlooking something? Could the read be done on the main thread instead?

Best regards, Carl.

chwiede commented 9 years ago

Hi Carl,

the main reason might me my humble knowledge in python and it's libraries - but there's also a serious one.

In the client class I use select to poll data from ethernet, and that's a blocking call for the specified timeout. In my project for which i created pyads i'd needed asynchronous non-blocking communication. A thread was a fast and working solution, even on the raspberry pi.

Asyncore would help to get things done in main thread, but i'd no time (and skills?) to implement this.

Well, it's working - but suggestions and merge requests are welcome ;-)

Best regards Christoph

2015-05-18 15:57 GMT+02:00 Carl notifications@github.com:

Hello,

I've walked through the code and I wonder what is the reason for having a separate thread for reading messages from the PLC?

am I overlooking something? Could the read be done on the main thread instead?

Best regards, Carl.

— Reply to this email directly or view it on GitHub https://github.com/chwiede/pyads/issues/3.