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.

Writting in a Arrayvariable with OPC UA

More
21 Apr 2022 11:09 #10817 by support
Hello,

writing an array isn't much different from writing a scalar value:
' This example shows how to write a value into a single node that is an array of Int32.
 
Imports OpcLabs.EasyOpc.UA
Imports OpcLabs.EasyOpc.UA.OperationModel
 
Namespace UADocExamples._EasyUAClient
    Partial Friend Class WriteValue
        Public Shared Sub ArrayOfInt32()
 
            ' Define which server we will work with.
            Dim endpointDescriptor As UAEndpointDescriptor =
                    "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
            ' or "http://opcua.demo-this.com:51211/UA/SampleServer" (not in .NET Standard)
            ' or "https://opcua.demo-this.com:51212/UA/SampleServer/"
 
            ' Instantiate the client object
            Dim client = New EasyUAClient()
 
            ' Modify value of a node
            Try
                ' // /Data.Static.Array.Int32Value
                Dim arrayValue = New Int32() {11111, 22222, 33333, 44444, 55555, 66666, 77777}
                client.WriteValue(endpointDescriptor, "nsu=http://test.org/UA/Data/ ;i=10305", arrayValue)
            Catch uaException As UAException
                Console.WriteLine("*** Failure: {0}", uaException.GetBaseException.Message)
                Exit Sub
            End Try
        End Sub
    End Class
End Namespace

Best regards

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

More
21 Apr 2022 07:31 - 21 Apr 2022 08:38 #10816 by Nordmann447
HI,
i tried to write into a Arrayvariable but i cant find the correct Code in the discription.

Reading a array was not a Problem, i write something like that:

Dim Variable As UAAttributeData = EasyUAClient1.Read(KommunikationServer, NoteID())
lable1.text = Variable.value(5)

Do you have a simply Code to write in a Arrayvariable?
Last edit: 21 Apr 2022 08:38 by Nordmann447.

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

Moderators: support
Time to create page: 0.054 seconds