![]() set is_open to False when closing socket I didn't take the time to check how the contributors (if any) are credited so I just added that quickly.) (Regarding the copyright notices, you can keep or reject them, I don't mind. And I understand that in RTU, since there is no end of frame character, timeouts are critical.Īnyway, I'll be glad is this can be improved and made available to the community. I entered into Modbus two days ago, all of this is new to me. This timeout issue is what bothers me the most. And I didn't think about the possible latency we can expect from the network connection. We can live with this kind of trick if we don't want to modify the rest of the code, but the values I entered are more or less random. I tried to fit in the interCharTimeout / baudrate / timeout the rest of the code expects. My test code works, but it might not be so secure. More importantly, I kind of stubbed the whole timeout management. Is this really what we want to do ? And flushOutput is just void as I didn't know what to fit in. ![]() I'm not sure whether the port should be opened in _init_() or in open(), and whether it should be closed in close() or at instance destruction I only created the methods that are called in the rest of the code, I may have missed some There is only a master example, no slave I didn't even test connection loss, wrong register number, etc. Again, this was rather a first draft that happened to work in my case. However, please note that this code is not complete and probably not safe either. Integrating this shouldn't bring any regression since I don't touch existing code. > I'll be glad to know what everyone think about it and to merge it on trunk if no one find I've just had a quick look on your fork but it looks very good.
0 Comments
Leave a Reply. |