Erst mal ein Hallo,
Mein Problem besteht darin (wie der Name schon sagt) eine Verbindung über Visual Basic 2008 zu einem OPC Server (WinAc RTX herzustellen).
Hatte mir dazu auch ein Beispielprojekt:
https://a248.e.akamai.net/cache.auto...DOKU_v10_d.pdf
besort.
(Läuft auch alles super --> wenn alles richtig eingestellt ist)

Nun wollte ich es für meine Anwendung Testen --> zum Start nur 2 Variablen lesen. Aber ich komme einfach mit dem VB Code nicht weiter.
An der Stelle

Code:
     OPCXMLDataAccess.Read(optReadWrite, OPCReadItemList, _
                OPCItemValues, OPCErrors)
ist es aus. Mit dem Fehler der "mir" nix sagt. Da mir die Funktion an der Stelle nicht ganz klar ist.

Bin für jede Hilfe dankbar.
Oder Codebeispiele für



Code:
Imports System
Imports System.Net
Imports V10.OpcXmlWebService



Public Class Form1

    Dim OPCXMLDataAccess As OPCXML_DataAccess
    Dim OPCReadItemList As New ReadRequestItemList
    Dim OPCWriteProcessItemList As New WriteRequestItemList
    Dim OPCReadOnceItemList As New ReadRequestItemList
    Dim OPCSubscribeRequestList As New SubscribeRequestItemList
    Dim optReadWrite As New RequestOptions
    Dim optSubscription As New RequestOptions
    Dim OPCSubscribePolledReplyList() As SubscribePolledRefreshReplyItemList
    Dim OPCServerHandles(0) As String
    Dim XReadActive As Boolean

    Dim Servername As String = "http://localhost/OPC.Simatic.NET/sopcweb.asmx"


    Public Sub Variablen_Zuweisen()
        'Zwei Variabeln zum Lesen
        OPCReadItemList.Items(0) = New ReadRequestItem
        OPCReadItemList.Items(1) = New ReadRequestItem
        'Zuweisen
        OPCReadItemList.Items(0).ItemName = "S7:[S7-Verbindung_1]DB1,Int0"
        OPCReadItemList.Items(1).ItemName = "S7:[S7-Verbindung_1]DB1,Int2"

        optSubscription.ReturnItemName = True
        'Set ClientRequestHandle = "sub1" to identify the Subscription
        optSubscription.ClientRequestHandle = "sub1"
    End Sub

    Private Function ConnectOPC() As Integer
        'Array which contains the OPC items (and their values) returned by the Read method
        'Dim OPCItemValues() As ReplyItemList = Nothing
        Dim OPCItemValues As ReplyItemList = Nothing

        'Array which contains OPC errors returned by the Read method
        Dim OPCErrors() As OPCError = Nothing

        Try
            If OPCXMLDataAccess Is Nothing Then
                'Assign new OPCXML_DataAccess object
                OPCXMLDataAccess = New OPCXML_DataAccess

                'Setup the Timeout value for the OPCXMLDataAccess object
                OPCXMLDataAccess.Timeout = 10000
            End If

            'Prüfen ob Server i.O.
            Dim OPCRequest As WebRequest = WebRequest.Create(Servername)
            Dim OPCResponse As WebResponse = OPCRequest.GetResponse
            OPCResponse.Close()

            'Assiging the url to the proxy class for the WebService
            OPCXMLDataAccess.Url = Servername

            'Checking the webservice status
            Dim OPCStatus As ServerStatus
            'OpcReply contains all return values from the OPC-Server
            Dim OPCReply As ReplyBase
            'Get status of OPC-Server
            OPCReply = OPCXMLDataAccess.GetStatus("en", "1", OPCStatus)
            'Check, if the OPC-Server is running
            If OPCReply.ServerState = serverState.running Then

                OPCXMLDataAccess.Read(optReadWrite, OPCReadItemList, _
                OPCItemValues, OPCErrors)

                'Check for errors
                If OPCErrors.Length > 0 Then
                    'An error has occured -> throw event
                    Throw New Exception(OPCErrors(0).Text.ToString)
                End If

                'If item quality ist good, then write the following values

                'Temp_Max
                If OPCItemValues.Items(0).Quality.QualityField = qualityBits.good Then
                    txt_wert1.Text = OPCItemValues.Items(0).Value.ToString
                Else
                    txt_wert1.Text = "---"
                End If

                'Temp_Out
                If OPCItemValues.Items(1).Quality.QualityField = qualityBits.good Then
                    txt_wert1.Text = OPCItemValues.Items(1).Value.ToString
                Else
                    txt_wert2.Text = "---"
                End If


                Return 0
            Else
                'OPC server not running
                OPCXMLDataAccess = Nothing
                Return 1
            End If

        Catch ex As Exception
            'Error, e.g. web service not available
            MessageBox.Show("Error while contecting to OPC-Server:" & vbCrLf & vbCrLf & _
            ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

            OPCXMLDataAccess = Nothing
            Return 2
        End Try
    End Function



    Private Sub B_Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B_Start.Click
        ConnectOPC()
    End Sub
End Class