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
- QuickOPC and SIMATIC NET - reading problems
QuickOPC and SIMATIC NET - reading problems
.NET users can benefit from the fact that it is easy to define many overloads, with different combinations of parameters, for the same method name, and the compiler will sort it out based on the number of parameters and their types. This is not possible in COM; to emulate it, we would have to do something like make a large number of numbered methods (ReadValue1, ReadValue2, ...) for every overloaded method (of which there are hundreds). All overloads just manipulate and prepare arguments for one common method that actually does the work - in other words, they are just "goodies", to make the code shorter.
So the approach taken in the COM interfaces of QuickOPC is to provide, in such cases, the two "extremes":
- First, a method that is simple to use, and uses defaults for its various parameters - meant for the most common case (ReadValue, in this case)
- Second, a method that allows you to influence *any parameter - but is more complicated to use (ReadMultipleValues, in this case).
We have considered making the reading from the device the default, but that would be seriously against OPC recommendations, because reading from device requires most resources of the server/downstream device.
Best regards
Please Log in or Create an account to join the conversation.
We have a follow up question regarding setting the MaximumAge property in VBA. Is it possible to set this property globally, so that we can use the simple ReadValue method instead of more cumbersome setting of the UAReadArguments?
In general what is the best way to read values in VBA directly from device (not from cache)?
Best regards,
Miha
Please Log in or Create an account to join the conversation.
I am glad that it works now
Best regards
Please Log in or Create an account to join the conversation.
thank you for your fast reply. My colleague tested implementation of application with your suggestion and it works properly, the read values are now the latest values.
Please Log in or Create an account to join the conversation.
I will answer your questions, but there is one more thing that can be causing this behavior:
There are certain parameters associated with each Read call; one of these parameters is "maximum age". The default setting for that in QuickOPC is Int32.MaxValue, which denotes reading from cache.
Do you specify any read parameters?
If not, I suggest that you change your code to specify the maximum age zero, which denotes "reading from the device".
More information:
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...s%20of%20OPC%20UA%20Nodes.html
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...dArguments~ReadParameters.html
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...ReadParameters~MaximumAge.html
Best regards
Please Log in or Create an account to join the conversation.
Is there a way for QuickOPC UA Client to establish an active connection to the OPC UA Server? I think this would solve the issues we are currently facing.
Please Log in or Create an account to join the conversation.
Client 1 is GE Ifix which is reading and writting values from / to OPC UA Server via QuickOPC for COM.
Client 2 is our .Net Core application which is reading ang writting values from / to OPC UA Server via QuickOPC for .Net Core.
Please Log in or Create an account to join the conversation.
in your description, what are the clients "Client 1" and "Client 2"? Are they programs written with QuickOPC, or some other UA client software?
Regards
Please Log in or Create an account to join the conversation.
Time cycle 1:
1. Client 1 writes username to server
2. Client 1 writes password to server
3. Client 1 writes trigger to server (value 1)
4. Client 2 detects the trigger in its current time cycle
5. Client 2 handles the received data
6. Client 2 writes a response to the trigger location (value 2)
Time cycle 2:
1. Client 2 reads the trigger location
2. Client 2 reads value 1 from the trigger location (it should read value 2)
3. Client 2 handles received data again (data from the allready handled trigger)
4....
Time cycle 3:
1. Client 2 reads the trigger location
2. Client 2 reads value 2 from the trigger location (this value was written by Client 2 in Time cycle 1)
3. ....
To tell things short, subscribing to a variable didn't resolve the issue of receiving old data from the OPC UA server. Any suggestions how to solve this?
Please Log in or Create an account to join the conversation.
CompletesAsynchronously is se to false.
We have conducted a test Where OPC SCout was on client and the second one was UAExpert. We have written the value with UAExpert to the PLC and the read value by OPC Scout was correct.
If we execute the code from my original post the read value is the old value, wrong value. QuickOPC only gets the correct value if either OPC Scout Monitoring is active or monitoring in UAExpert is active, meaning when connection to the OPC server is established.
Is there a way to open and maintain connection to the OPC UA server by QuickOPC UA client? Apart from subscribing to desired variables.
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-UA in .NET
- Reading, Writing, Subscriptions
- QuickOPC and SIMATIC NET - reading problems