11/15/2021
Hi,
I let one subscription monitor 5 integer variables (A, B, C, D and E) in a Siemens PLC. At the beginning, they are all 0. When A changes to 1, the notification data I receive should be for the A. The notifications for B, C, D and E contain theoretically only live signals. But in some sessions I get data for all of the monitored items and they are the same (1 for all A, B, C, D and E). This issue happens quite random and it is hard for me to reproduce it. Does anyone face the same problem like me? I am glad that you can help.
11/15/2021
Thank for your response,
the problem is very hard to reproduce because it is quite random. But I have figured out the circumstance that can let it happen. When the initial value of one monitored item is 1 (the rest is 0), the notification data might also be 1 for some of other items in the same subscription. I have tried to used sniffer to view the packets. But the strings are incomprehensible for me, I cannot conclude if the glitch is from the client library or from the SPS.
I am looking forward to hearing from you.
11/15/2021
Hi,
yes, you are right. That was software glitch and after many experiments I have figured it out. When the publish response is an array for 2 or 3 monitored items, the event handler gives for each of them the same array as EventArgs but the caller is different. Since my software use properties monitoredItem.displayname of caller to detect the items, it loops the values of the array to the variable in PC each time and at the result every variable has the same number.
So from there, I am looking the way to set the notification value only for 1 monitored item each time. Is there any command for that?
05/30/2017
I did find the property subscription.maxNotificationsPerPublish and set it to 1. Do you think this will impact the performance badly?
Yes. It means you are using an entire publish request for a single value. If 10 values change you need to do 10 round trips to get them all. Not a good idea.
1 Guest(s)