Closed Dhruva0707 closed 3 years ago
@Dhruva0707 I guess there is something missing ;)
@Dhruva0707 I guess there is something missing ;)
Updated
1) db_read
is not async, so it is blocking.
2) You may want to use as_db_read
and waiting until a result exists with wait_as_completion
or checking if now a result exist with check_as_completion
(last one can be used in a loop).
Thanks a lot for your response!
I will check it out.
As I am reading the documentation I see that a 'buffer' is required in the as_db_read function. Any tutorial or example code I see to get the datatype of the buffer and using 'wait_as_completion' or 'check_as_completion' ?
Found it in the tests
We can close this issue, as the async call resolved the same.
Hello I have a S7-1500 PLC, a code snippet is as follows:
The above function is called via various threads. As one can notice, if the db_read function fails, an error is logged. Intermittently, this stops the data collection for all threads. This can mean that the db_read has not returned any data and not created any exception, which can be caught by the try/except block.
My questions are the following: 1> Is the db_read command blocking? 2> If yes, is there any way to get around this issue?