![]() ![]() Optional parameters are a source for common mistakes. Reply = Srv.Read(ReqOptions, ReadReqList, ReadReplyList, Errors)ĭim i As Int32 For i = 0 To - 1 If ReadReplyList.Items(i).ResultID Is Nothing Then ' display valueĬonsole.WriteLine(ReadReplyList.Items(i).ItemName + " = " + _Ĭonvert.ToString(ReadReplyList.Items(i).Value))Ĭonsole.WriteLine( " Error: " + ex.Message) While 1 = 1 ' periodically read the items Try ' access the server ReadReqList.Items( 1).ItemName = " Test/Float" ' Data structures for the read reply data Dim reply As localhost.ReplyBaseĭim ReadReplyList As localhost.ReplyItemList ![]() ReadReqList.Items( 1) = New localhost.ReadRequestItem ' item 2 ReadReqList.Items( 0).ItemName = " Test/Integer" ReadReqList.Items( 0) = New localhost.ReadRequestItem ' item 1 ReDim ReadReqList.Items( 1) ' Item request list for 2 items ReqOptions.ReturnItemName = True ' Data structures for an XML-DA Read call, initialized to read 2 items Dim ReadReqList As localhost.ReadRequestItemList = New ReadRequestItemList Srv.Url = " " Dim ReqOptions As localhost.RequestOptions = New localhost.RequestOptions ' create the server object and set the call options Dim Srv As localhost.OpcXmlDA = New localhost.OpcXmlDA The XML-DA Read function is self contained and not dependent on any previous calls. The code snippet shown below uses the Read function to periodically read the value of two items from the server. XML-DA has a stateless design that fits well into ASP.NET applications. Desktop and ASP.NET applications can access OPC XML-DA servers in the same way. VB and C# applications typically use the. NET based OPC XML DA servers a clients can be downloaded. Read the XMLDA.NET White Paper for a description of how web services differ from DCOM and how this influences the design of client applications. NET web services support, the HTML/ASP scripts use the MSSOAP toolkit. The sample client applications show how the Read and Subscribe/ Poll functions are used from different kinds of applications. Developers of OPC client applications have to be aware of these differences. The OPC XML-DA standard and the currently widely used OPC DA V2 standard address the same tasks but the server interface is quite different, due to their different base, web services respectively DCOM. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |