freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

opc接口技術(shù)-文庫吧

2025-07-21 00:44 本頁面


【正文】 mation must be included into Visual Basic or C (if missing: copy to C:\WINNT\System32\opddaauto) and register it: C:\regsvr32 C:\WINNT\System32\opddaauto. A simple way to do it: install Software Toolbox39。s TopServer (freeware) 查找 OPC服務(wù)器 The GetOPCServers function applied to a dummy Server object allow to list the existing servers on this node or on another node (over DCOM security must be set correctly) The information about which OPC servers exist is taken from the registry, where it has been put by each server at its installation time。 Private Sub ShowServers(NodeName As String) Dim dummyServer As OPCServer Dim Servers As Variant 39。 this is an array of strings Dim tServers As Integer Set dummyServer = New OPCServer 39。 create a dummy server object Servers = (NodeName) 39。 returns all available servers For tServers = LBound(Servers) To UBound(Servers) 39。 display the names MsgBox Servers(tServers) Next tServers Set Getserver = Nothing 39。 delete this object (was created by New) Exit Sub 連接到 OPC服務(wù)器 Set MyServer = New OPCServer 39。 create server object () 39。 connect to Matrikon server Before connecting, it is safe to check the name of the server from the server39。s list. Also, it is preferable to include the connection in a separate routine since it can fail: Function ServerGetCare(Name As String, ServerNode As String) As OPCServer On Error GoTo ServerGetCareErr Dim MyOPCServer As New OPCServer ServerName, ServerNode 39。 connect risky Set ServerGetCare = MyOPCServer Exit Function ServerGetCare_Err: 39。 error handler if connect fails MsgBox Could not connect Set MyServer = Nothing Exit Function 瀏覽服務(wù)器 The object OPCBrowser (of type collection) acts as a pointer to the server39。s tree: Dim MyServer As OPCServer Dim MyBrowser As OPCBrowser Dim vName As Variant , Orion 39。server and node name (DCOM) Set MyBrowser = 39。 create an OPC browser 39。 show the branches For Each vName In MyBrowser MsgBox Branch: amp。 vName 39。 display the branch name Next vName 39。 explore the leaves For Each vName In MyBrowser MsgBox Leaf: amp。 vName 39。 display the leaves39。s name Next vName 瀏覽 (strBranch) 39。 go down the selected branch tree 39。 go up the selected branch tree site properties TAG Server root Level Temperature Valve_On TAG TAG TAG Site A Store Machine Room Grinder Wash Room Climate server Tank There may be leaves at every branch, since a branch may have properties 獲得 ItemID (TankArea) (Tank1) FQI = (Level) Of course, one can write an Item ID directly when defining a group, but it is safer to browse the server and get the FQI from there, since the delimiter depends on the server. To get the fully qualified itemID, one positions the browser at the place where the leaf is attached to the branch and calls GetItemID . FQI could be Controller1。Tanks!Level 創(chuàng)建 OPCGroups and OPCItems Set MyGroups = 39。 create groups collection Set MyGroup1 = (GRP1) 39。 add group, name private Set MyItems = 39。 define the OPCItems of group FQItemIDs(1) = 39。 fully qualified itemID ClientHandles(1) = 5 39。 arbitrary FQItemIDs(2) = 39。 fully qualified itemID ClientHandles(2) = 6 39。 arbitrary (but different) nrItems = 2 _ 39。 adds the items tocollection nrItems, _ 39。 input parameter FQItemIDs, _ 39。 supply fully qualified ID ClientHandles, _ 39。 supply ClientHandles ServerHandles, _ 39。 return parameterServerHandles ServerErrors 39。 return parameter ServerErrors = 1 39。 handle of the group (no s) ! = True 39。 now ready to send and receive = True 39。 and to generate events The role of the ServerHandles and ClientHandles will be explained later… 客戶端 的數(shù)據(jù)結(jié)構(gòu) FullyQualifiedItemID ClientHandle ServerHandle municated to server by registering group ServerError Value Quality TimeStamp 100 34543 0 OK 12: 102 22532 0 OK 12: 203 534676 0 0 OK 12: 204 787234 0 1 OK 12: 205 58432 0 0 BAD 12: returned by server when registering dynamic changes (refreshed on change) The client prepares data structures for its items and gives the server the corresponding pointers so the server can update them. Items to be written and read can be mixed in the same group. The type of the item (Boolean, Float,…) is implicit, but known at the server .. .. .. .. .. .. Dim thisGroup As OPCGroup Dim tItems As Integer Dim source As Integer Dim serverHandles(2) As Long Dim values() As Variant Dim errors() As Long serverHandles(1) = ServerHandle(11) 39。 copy from global variables serverHandles(2) = ServerHandle(14) source = OPCcache 39。 could also be OPCDevice source, nrItems, serverHandles, 39。 identifies the items to be read ! values, 39。 returns be a dynamic array errors 39。 returns a dynamic array For tItems = LBound(serverHandles) To UBound(serverHandles) 39。 1..n MsgBox CStr(tItems) amp。 : amp。 values(tItems) Next tIte
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1