- Posts: 46
- Thank you received: 0
Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
- Forum
- Discussions
- QuickOPC-UA in .NET
- Reading, Writing, Subscriptions
- "SubscribeDataChange" using the read function
"SubscribeDataChange" using the read function
Please Log in or Create an account to join the conversation.
The equivalent of OPC DA "Read" in OPC UA is "Read" again. In QuickOPC, this is invoked using various methods whose name starts with "Read", such as ReadMultiple and so. QuickOPC, in addition, takes care of connections (sessions) - there is no need to explicitly connect.
So, in order to read something, you just need to call the Read.
What makes you believe that this is not enough, and that you need to subscribe as well?
Best regards
Please Log in or Create an account to join the conversation.
The "SubscribeMultipleMonitoredItems" inside "procedure TOPCClient.InternConnect; " is kind of event handler. It should update the variables every 1000 milliseconds. It is called one time at the beginning. When my Delphi client is connected to the OPC Server, it updates the variables every second. We get every second new values from our PLCs (from pressure gauge, temperature sensors and ...) and these values are changing continuesly.
Moreover, what I still don't understand is the "read" function of QuickOPC! In our current software version we are using OPC DA (DCOM) and the only thing we are using to read variables from OPC DA Server is the standard "read" function (single read or multiple read). This function delievers every second new values without any need to subscribe any data change or so! I am wondering why it is not the case with the "read" function from QuickOPC! What is the exact equivalent function in Quick OPC to read the current value from OPC UA Server without any extra effort?
Best regards,
Moien
Please Log in or Create an account to join the conversation.
thanks for the numbers.
What I plan to do is to set up a similar test here and measure the usage, to understand what is happening. Please give me some time. I will post here then again.
I would not be surprised if reading 300 variables once per second would be relatively demanding, but subscriptions should be less demanding than that.
But, I am afraid there might be some profound misunderstanding in play. I have not found any processing of the subscribed items in your code. That is, the part that in our example (opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...es%20for%20data%20changes.html ) is initiated by the statement
Client.OnDataChangeNotification := ClientEventHandlers.OnDataChangeNotification;
But that's not the whole story. If you actually wanted to have the data of these variables available to you for extended periods of time and not just once, the *highly preferred* approach is to use subscription only. So, in that case, you would keep the subscription call, add an event handler to process the incoming data, but completely remove the periodic calls to Read.
Regards
Please Log in or Create an account to join the conversation.
2. No it's not kind of spike in the CPU usage. It goes up and remains up to about 60%.
2b. I would say "SubscribeMultipleMonitoredItems" and "ReadMultiple" have the same effect on the CPU usage which means equal shares 50-50.
Best regards,
Moien
Please Log in or Create an account to join the conversation.
thank you for the code.
Can you please clarify:
1. Are you calling the procedures you listed just once, or in some kind of loop? If in loop, how often (frequency)?
2. Are we talking about a temporary "spike" in the CPU usage, or does it - after one call to the procedure - go high and remain that way?
2b. If so, is that even the case after calling the procedure with the "Read"?
Thank you
Please Log in or Create an account to join the conversation.
I ran my application commenting out the parts related to the subscribing data and reading more than 300 variables on the OPC Server! you can see the commented out parts in the attached file. This leads to a total CPU usage of 13 % which was about 60 % before commenting out those parts!
Best regards,
Moien
Attachments:
Please Log in or Create an account to join the conversation.
procedure TClientEventHandlers123.OnDataChangeNotification(
ASender: TObject;
sender: OleVariant;
const eventArgs: _EasyUADataChangeNotificationEventArgs);
begin
// Display the data
//...
if eventArgs.Succeeded then
WriteLn(eventArgs.Arguments.NodeDescriptor.ToString, ': ',
eventArgs.AttributeData.ToString)
else
WriteLn(eventArgs.Arguments.NodeDescriptor.ToString, ' *** Failure: ',
eventArgs.ErrorMessageBrief);
end;
In the example, the method just displays the incoming data. In your application, I would expect the method to do the actual processing you need with the data. So, I wanted to keep the procedure but leave it basically empty - no executable code inside it, everything commented out.
Regards
Please Log in or Create an account to join the conversation.
Best regards
Moien
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-UA in .NET
- Reading, Writing, Subscriptions
- "SubscribeDataChange" using the read function