Professional OPC
Development Tools

logos

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.

OPC UA COM C++

More
19 Dec 2022 11:06 #11356 by simona.magni@growermetal.com
Ok,
the licensing issue is clear.
I'm waiting for the trial license on the email entered during registration.

Thank you

Please Log in or Create an account to join the conversation.

More
19 Dec 2022 10:22 #11355 by support
Replied by support on topic OPC UA COM C++
Hello.

I will send you an evaluation license key to the email address you have used to register on the forums.

Any commercial license is for versions thar are "up to" the version that is current at the time of purchase (or 1/2/3/4/5 years later, if you also purchase Upgrade Assurance). So, for example, if you have purchased today, the current version is 2022.2, you would receive a license key that works with version 2022.2, but also any older version (including 2019.2). But we do not officially support the older versions, which means that if something goes wrong, and you are using an older version and the problem does not happen with the current version, you might be out of luck.

Best regards

Please Log in or Create an account to join the conversation.

More
19 Dec 2022 10:00 #11354 by simona.magni@growermetal.com
Hello,
I downloaded both the 2022.2 and 2019.2 versions.
For development environment reasons I would like to test if the 2019.2 version works. Can I have a test key for this version?
But then the definitive license is linked to the chosen version? (2019 or 2022 ...)
Thank

Please Log in or Create an account to join the conversation.

More
16 Dec 2022 15:37 #11347 by support
Replied by support on topic OPC UA COM C++
Hello.

To test it out, you do not need to purchase anything, it works the built-in trial license (or, if it reports licensing error because it is one of the older QuickOPC versions, we can send you an evaluation license key, free of charge - just ask).

For actual development and production, you need QuickOPC Enterprise (opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...e.html#Product%20Editions.html ); most customers are fine with Single Developer + Runtime Free license (www.opclabs.com/purchase/license-types ).

Best regards.

Please Log in or Create an account to join the conversation.

More
16 Dec 2022 15:33 #11346 by simona.magni@growermetal.com
Hello,
to use the code indicated with the _EasyUAClient object, to read and write, what is the minimum license that I have to purchase?

_EasyUAClient ClientPtr=_EasyUAClient();
ClientPtr.CreateDispatch("OpcLabs.EasyOpc.UA.EasyUAClient");
COleVariant varName = ClientPtr.ReadValue(par1,par2);
ClientPtr.WriteValue( par1,par2,par3);

Thank you

Please Log in or Create an account to join the conversation.

More
14 Dec 2022 15:54 #11343 by simona.magni@growermetal.com
Hello,
With the right progIDS now it works ! the CreateDispatch("OpcLabs.EasyOpc.UA.EasyUAClient") correctly initialize the variable.
Now I can continue to do tests to see if we can integrate it.
thank you

Please Log in or Create an account to join the conversation.

More
13 Dec 2022 19:36 #11337 by support
Replied by support on topic OPC UA COM C++
Hello,
thank you for the additional information.

There are many ways to use COM objects from C/C++. If you are accustomed to one way, you can probably continue doing so. For example, an equivalent of CreateDispatch("Excel.Application") with QuickOPC-UA would be CreateDispatch("OpcLabs.EasyOpc.UA.EasyUAClient") (the ProgIDs are in the Reference documentation; for this particular object, here: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...bs_EasyOpcUA~EasyUAClient.html ).

In our own examples we do it differently, see e.g. opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...Read%20a%20single%20value.html :

 
// This example shows how to read value of a single node, and display it.
 
#include "stdafx.h" // Includes "QuickOpc.h", and other commonly used files
#include "ReadValue.h"
 
namespace _EasyUAClient
{
    void ReadValue::Main()
    {
    // Initialize the COM library
CoInitializeEx(NULL, COINIT_MULTITHREADED);
    {
    // Instantiate the client object
_EasyUAClientPtr ClientPtr(__uuidof(EasyUAClient));
 
    // Perform the operation
_variant_t value = ClientPtr->ReadValue(
    //L"opcua.demo-this.com:51211/UA/SampleServer",
L"opc.tcp://opcua.demo-this.com:51210/UA/SampleServer",
L"nsu=http://test.org/UA/Data/ ;i=10853");
 
    // Display results
_variant_t vString;
vString.ChangeType(VT_BSTR, &value);
_tprintf(_T("value: %s\n"), (LPCTSTR)CW2CT((_bstr_t)vString));
    }
    // Release all interface pointers BEFORE calling CoUninitialize()
CoUninitialize();
    }
}
 
 


The missing piece that causes your error might be the argument in _EasyUAClientPtr ClientPtr(__uuidof(EasyUAClient)). Please add that to see if it helps.

Best regards

Please Log in or Create an account to join the conversation.

More
13 Dec 2022 12:01 #11335 by simona.magni@growermetal.com
Hello,
yes there is more error. auto_awesome. Due to the fact that the _EasyUAClient variable is not initialized correctly, but I don't know how to do it. In other application I must use the function "createdispath(), for instance to use excel I do CreateDispatch("Excel.Application") to initialize my ole object.
In the attachment the screeshot of debug.
Do you have a suggestion for resolve it ?
If I use your "EasyOpcUADemo.exe" I can connect to my server and read and write the variables. (see other attachment).
Thank you for your help.
Attachments:

Please Log in or Create an account to join the conversation.

More
13 Dec 2022 07:16 #11330 by support
Replied by support on topic OPC UA COM C++
Hello.

Can you still post more details about the errors? I doubt that "invalid variable type" is the full message text. And, is that a C++ runtime exception, or what? If so, what is its type (such as COleException)? Ideally, please post a screenshot from the debugger.

Also, have you tried the same code but with our demo server and a node from it (such as in our ReadValue example)? If so, did it work with our server?

Best regards

Please Log in or Create an account to join the conversation.

More
12 Dec 2022 16:00 #11328 by simona.magni@growermetal.com
Ok,
I will also wait for your feedback.
thank you.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.079 seconds