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.

vb6 connection parameters

More
13 Sep 2021 09:16 #10202 by support
Replied by support on topic vb6 connection parameters
Hello.

ValueResult is an object that, in case of success, holds the value that was read (in the .Value property), or, in case of failure, the information about the error (in the .Exception property, and some other properties).

- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...perationModel.ValueResult.html
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...Model.ValueResult_members.html

I do not quite understand what you mean by "vb6 gives me an 'undefined object error'". When you run the program, does it stop and show you this error? If so, on which line? (can you provide a screenshot)? Or, are you intentionally, stepping through it in a debugger, and you get this at some place/in some moment? Please try to describe very clearly what is happening; thank you.

Best regards

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

More
13 Sep 2021 09:03 #10201 by ulix86
Replied by ulix86 on topic vb6 connection parameters
thank you, the endpoint descriptor is the solution but I don't understand this code:
' Display results
    Dim i: For i = LBound(results) To UBound(results)
        Dim Result As ValueResult: Set Result = results(i)
        If Result.Succeeded Then
            OutputText = OutputText & "Value: " & Result.Value & vbCrLf
        Else
            OutputText = OutputText & "*** Failure: " & Result.ErrorMessageBrief & vbCrLf
        End If
    Next

what's ValueResult in the variable Result declaration? vb6 gives me an 'undefined object error'...

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

More
09 Aug 2021 07:25 #10099 by support
Replied by support on topic vb6 connection parameters
Hello.

The simple "ReadValue" method cannot do that.

You need to use the ReadMultipleValues method instead, because it gets passed an "endpoint descriptor" which can in turn contains the user name and password. You can use ReadMultipleValues for reading just one value, too.

An example of using the ReadMultipleValues: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...0Read%20multiple%20values.html .

In the endpoint descriptor, the code to set the user name and password will look similar to this:
EndpointDescriptor.UserIdentity.UserNameTokenInfo.UserName = "appadmin"
EndpointDescriptor.UserIdentity.UserNameTokenInfo.Password = "demo"
Best regards

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

More
06 Aug 2021 07:24 #10097 by ulix86
Hi,
I have a problem with connecting to the OPCUA SERVER and VB6.
I installed QuickOPC 2019.2 for compatibility with windows7 so.

I found Vb6 code in Documentations and Helps for read a node value and display it
but I didn't find how to specified username and password and type of autentication.

This how I read the node:

' Read node value and display it
Me.Text1 = Client.ReadValue("opc.tcp://172.16.108.35:4840", "ns=2;i=4179")


but return a runtime error BadUserAccessDenied.
I think i should specify username and password and type of connection, right?

Is there documentations about this type of connection in vb6?

thank you (and sorry for my english ;) )

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

Moderators: support
Time to create page: 0.059 seconds