DBRead method call repeatedly returns the zero byte array.
Reading occurs every 100ms from PLC Simatic S7-317 2PN/DP.
I use snap7-bugfix-1.3.0, wrapper for .NET, x86
Best regards,
Alexey Kostromin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Alexey,
What do you mean for returns zero byte array ? The array is filled with all zeros ?
What result code do you get from the function ?
Where is defined your array ? It's possible that the garbage collector is not aware that you are using it in unmanaged code ?
Let me know how I can reproduce the issue.
If I put a timer onto a form, in your opinion, can I reproduce the issue ? or are you using a very different schema ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I tested some configurations with subsequent read every 75-100 ms.
Using both timer and thread, and I never experienced problems (after some thousands of cycles).
I asked also to some people that are using Snap7 in .net environment for massive data transfer.
I suggest you to check your source code.
If the problem persists, please make a tiny .net program that reproduces the issue and send it me.
Regards
Dave
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Davide!
Sorry, but I was mistaken. Actually when I call DBRead everything works fine. But when I call AsDBRead … WaitAsCompletion(timeout) array is filled with all zeros sometimes. Reading every 100ms occurs from another thread.
This is my code:
Dear David!
I've discovered the following bug.
DBRead method call repeatedly returns the zero byte array.
Reading occurs every 100ms from PLC Simatic S7-317 2PN/DP.
I use snap7-bugfix-1.3.0, wrapper for .NET, x86
Best regards,
Alexey Kostromin
Hi Alexey,
What do you mean for returns zero byte array ? The array is filled with all zeros ?
What result code do you get from the function ?
Where is defined your array ? It's possible that the garbage collector is not aware that you are using it in unmanaged code ?
Let me know how I can reproduce the issue.
If I put a timer onto a form, in your opinion, can I reproduce the issue ? or are you using a very different schema ?
Hi,
I tested some configurations with subsequent read every 75-100 ms.
Using both timer and thread, and I never experienced problems (after some thousands of cycles).
I asked also to some people that are using Snap7 in .net environment for massive data transfer.
I suggest you to check your source code.
If the problem persists, please make a tiny .net program that reproduces the issue and send it me.
Regards
Dave
Hi Davide!
Sorry, but I was mistaken. Actually when I call DBRead everything works fine. But when I call AsDBRead … WaitAsCompletion(timeout) array is filled with all zeros sometimes. Reading every 100ms occurs from another thread.
This is my code:
Is it correct?
Regards,
Alexey
Last edit: Aleksey Kostromin 2015-02-24
So, you have a thread (not listed here) that every 100 ms calls DBRead (or AsDBRead).
I understand you correctly?
If yes, you should test the result code of AsDBRead, if it's !=0 it means that the client is busy (because it's reading the thread data).