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.

Error with node registration

More
19 Jul 2023 06:41 #11929 by JDP
Replied by JDP on topic Error with node registration
Hey,

ok i see. I checked without a license and then it works.
Thank you very much for solving my issue!!!

I will get an license upgrade to get it run!

Best Regards and Thanks!
The following user(s) said Thank You: support

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

More
19 Jul 2023 05:26 #11928 by support
Hello again.
I have realized what the reason is.

You have a license for the Standard edition, but the node registration and operation control services need at least the professional edition: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...e.html#Product%20Editions.html .

Temporarily uninstall/do not embed your license key to test this out. I can also send you an evaluation license key. For the real usage, you will need an edition upgrade.

The error message we give should be better in the "unlicensed" case, so that the reason is immediately apparent; this is an oversight on our side.

Best regards

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

More
18 Jul 2023 18:02 #11926 by support
Hello.

I do not see a problem in the way you are doing the node registration. It should work, it's not clear why it does not.

I tried the following minimal program, with QuickOPC 5.70.1202:

Imports Microsoft.Extensions.DependencyInjection
Imports OpcLabs.EasyOpc.UA
Imports OpcLabs.EasyOpc.UA.Services
Module Module1
 
    Sub Main()
        Dim client As New EasyUAClient
        Dim clientNodeRegistration As IEasyUAClientNodeRegistration = client.GetRequiredService(Of IEasyUAClientNodeRegistration)
    End Sub
 
End Module

It does not throw either. I am targeting .NET Framework (4.7.2); which OPC runtime are you targeting please?

It might be necessary that you create a project with which I can reproduce the problem. Or send me your current project, if that's not a confidentiality problem (can be done privately by email).

Bets regards

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

More
18 Jul 2023 16:23 #11925 by JDP
Replied by JDP on topic Error with node registration
Hey,

I checked the program again.
First concerning the declaration of "client", its done at the same spot where i declarate the Dim nodeDescriptorArrayTX() As UANodeDescriptor so
Private endpointDescriptor As UAEndpointDescriptor
    Private client As EasyUAClient
    Private HeartbeatLast As Integer = 0
    Private HeartbeatSend As Integer = 0
    Public HeartbeatCounter As Integer = 0
    Public HeartbeatTimeout As Integer = 0
 
    Dim nodeDescriptorArrayTX() As UANodeDescriptor


Concerning the calls of the methods.
When i start my program, with the start, Checkserver() is called. In Checkserver() I do the initialisation of "client" and only after that I when i verify that the Server is running, i do the registration.
Public Sub RegisterNodes()
        OPClog("Register Nodes")
        OPClog(client.InstanceParameters.ToString())
        Try
            Dim clientnoderegistration As IEasyUAClientNodeRegistration = client.GetRequiredService(Of IEasyUAClientNodeRegistration)
            Dim clientConnectionControl As IEasyUAClientConnectionControl = client.GetRequiredService(Of IEasyUAClientConnectionControl)


result was: {DiscoveryHost="localhost"} (Default)

and
Public Sub RegisterNodes()
        OPClog("Register Nodes")
        OPClog(client.GetType.ToString())
        Try
            Dim clientnoderegistration As IEasyUAClientNodeRegistration = client.GetRequiredService(Of IEasyUAClientNodeRegistration)
            Dim clientConnectionControl As IEasyUAClientConnectionControl = client.GetRequiredService(Of IEasyUAClientConnectionControl)

result was: OpcLabs.EasyOpc.UA.EasyUAClient

The logs that im writing are giving me the following info:

18:18:41 client serial no.: 1999223851
18:18:41 trying to connect to OPC...
18:18:43 Server: running
18:18:43 trying to connect to PLC…
18:18:44 PLC: connection running
18:18:44 Register Nodes
18:18:44 OpcLabs.EasyOpc.UA.EasyUAClient
18:18:44 No service for type 'OpcLabs.EasyOpc.UA.Services.IEasyUAClientNodeRegistration' has been registered.

So i guess the sequence should be fine.

Best Regards

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

More
18 Jul 2023 15:27 #11924 by support
Hello,

I can see that you are initializing the 'client' variable in the CheckServer() method (but I do not see where 'client' is declared).

Are you sure that you are calling CheckServer() *before* you call RegisterNodes() (where 'client' is used)?
Ideally, you would move the initialization of 'client' out of 'CheckServer', maybe even initialize it right at the point where it is declared.

I cannot be sure that this is the reason, but needs to be checked first.

Or, put a breakpoint onto the line that throws in RegisterNodes(), and verify that 'client' is not null.

Regards

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

More
18 Jul 2023 09:45 - 18 Jul 2023 15:13 #11921 by JDP
Replied by JDP on topic Error with node registration
Hey,

thanks for the quick reply.

Im running with Version 5.70.1202, i also tried an earlier version but same issue.

Im not sure about the second question, i dont work that often with VB.net hope i post what you were asking for!
Dim nodeDescriptorArrayTX() As UANodeDescriptor
 
    'Methods
    Public Sub New(ByVal address As String, ByVal port As String)
        Me.Address = address
        Me.Port = port
    End Sub
 
    Public Sub SetClientAtributes()
        'cancel all old subscriptions
        client.UnsubscribeAllMonitoredItems()
        ' Define which server to work with.
        url = Address + ":" + Port
        endpointDescriptor = New UAEndpointDescriptor(url) '.WithAnonymousIdentity()
        ' Set the application name, which determines the subject of the client certificate.
        EasyUAClient.SharedParameters.EngineParameters.ApplicationParameters.ApplicationManifest.ApplicationName = "GfAMMS - OPC UA client"
        EasyUAClient.SharedParameters.EngineParameters.ApplicationParameters.ApplicationManifest.InstanceOwnStorePath = "C:\MMS\CertificateStores"
        EasyUAClient.SharedParameters.EngineParameters.CertificateAcceptancePolicy.TrustedEndpointUrlStrings.Add(url)
    End Sub
 
Public Sub CheckServer()
        Try
            client = New EasyUAClient()
            Dim serialNumber As Long = CUInt(client.LicenseInfo("Multipurpose.SerialNumber"))
            SetClientAtributes()
            OPClog($"{Text20}: {serialNumber}")
            OPClog(Text01)
            Dim attributeData As New UAAttributeData
            'Read
            attributeData = client.Read(endpointDescriptor, "ns=0;i=2259") '0   2259
            'Display results
            If attributeData.HasValue Then
                If Not Integer.TryParse(attributeData.Value.ToString(), ServerState) Then
                    ServerState = 7
                End If
                Select Case ServerState
                    Case 0
                        OPCconnection = True
                        OPCstateMsg(False, Text02) '"Server: running"
                        StartPLCcommunication()
                    Case 1
                        OPCconnection = False
                        OPCstateMsg(True, Text03) '"Server: failed"
                    Case 2
                        OPCconnection = False
                        OPCstateMsg(True, Text04) '"Server: no configuration"
                    Case 3
                        OPCconnection = False
                        OPCstateMsg(True, Text05) '"Server: suspended"
                    Case 4
                        OPCconnection = False
                        OPCstateMsg(True, Text06) '"Server: shutdown"
                    Case 5
                        OPCconnection = False
                        OPCstateMsg(True, Text07) '"Server: test"
                    Case 6
                        OPCconnection = False
                        OPCstateMsg(True, Text08) '"Server: communication fault"
                    Case 7
                        OPCconnection = False
                        OPCstateMsg(True, Text09) '"Server: unknown"
                End Select
            End If
        Catch uaException As UAException
            OPClog($"F01 {Text11}: {uaException.GetBaseException.Message}")
            OPCstate = Text13
            OPCstateColour = New SolidColorBrush(Color.FromRgb(249, 144, 114))
            Exit Sub
        End Try
    End Sub
 
    Public Sub StartPLCcommunication()
        OPClog(Text33) '"trying to connect to PLC..."
        'check PLC connection
        Try
            client.WriteValue(endpointDescriptor, ConfigurationManager.AppSettings.Get("opcTagPrefix") + Chr(34) + "Var" + Chr(34) + "." + Chr(34) + "EGA" + Chr(34) + "." + Chr(34) + "I_Heartbeat" + Chr(34), 1)
        Catch uaException As UAException
            OPClog(Text34) '"PLC: connection failed"
            PLCconnection = False
            Exit Sub
        End Try
        OPClog(Text35) '"PLC: connection running"
        PLCconnection = True
        If ConfigurationManager.AppSettings.Get("RecipeManagement") Then
            UpdateRecipeData()
            UpdateRecipeMaxLimits()
            UpdateRecipeMinLimits()
        End If
        'SetAllDataIntervals()   Only if MMS functionallity is activated
        RegisterNodes()
     End Sub
 
    Public Sub RegisterNodes()
        OPClog("Register Nodes")
        Try
            Dim clientnoderegistration As IEasyUAClientNodeRegistration = client.GetRequiredService(Of IEasyUAClientNodeRegistration)
etc....

Thanks again and best regards!
Last edit: 18 Jul 2023 15:13 by support.

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

More
18 Jul 2023 09:12 #11920 by support
Hello.

Please provide some additional information.

1. Which version of QuickOPC are you using?
2. Please provide the code that instantiates the value in the 'client' variable.

Best regards

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

More
18 Jul 2023 08:23 - 18 Jul 2023 15:12 #11919 by JDP
Hello Everyone,

Im trying to register some nodes to speed up my OPC_UA connection. I took some C# code as example from the manual, but somehow its crashing all the time with this message:

System.InvalidOperationException: No service for type 'OpcLabs.EasyOpc.UA.Services.IEasyUAClientNodeRegistration' has been registered.

OPC Connection is up and running (Heartbeat is going back and forth). Im connected to a PLC1500 from Siemens.
Public Sub RegisterNodes()
        OPClog("Register Nodes")
        Try
            Dim clientnoderegistration As IEasyUAClientNodeRegistration = client.GetRequiredService(Of IEasyUAClientNodeRegistration)
            Dim clientConnectionControl As IEasyUAClientConnectionControl = client.GetRequiredService(Of IEasyUAClientConnectionControl)
 
            nodeDescriptorArrayTX = {
         ConfigurationManager.AppSettings.Get("opcTagPrefix") + Chr(34) + "Var" + Chr(34) + "." + Chr(34) + "EGA" + Chr(34) + "." + Chr(34) + "UWL_AB_I_Nodes_TxPDO1_L" + Chr(34) + "[0,0]." + Chr(34) + "StatusWord" + Chr(34),
 ...... etc.... 
    }
 Dim registrationHandleArray As Integer() = clientnoderegistration.RegisterMultipleNodes(endpointDescriptor, nodeDescriptorArrayTX)
 
 Dim lockHandleTX As Integer = clientConnectionControl.LockConnection(endpointDescriptor)
 
        Catch ex As Exception
            OPClog(ex.Message)
        End Try
Has anyone done this before and has some idea on how to solve that issue?

Thanks already in advance!
Last edit: 18 Jul 2023 15:12 by support.

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

Moderators: support
Time to create page: 0.065 seconds