OPC客户端读取程序报错...

已锁定

风子言

  • 帖子

    144
  • 精华

    0
  • 被关注

    2

论坛等级:游侠

注册时间:2010-03-15

普通 普通 如何晋级?

OPC客户端读取程序报错...

1770

1

2010-11-15 12:41:39

Dim WithEvents opc_server As OPCAutomation.opcSERVER
Dim WithEvents opc_group As OPCAutomation.OPCGroup
Dim opc_item As OPCAutomation.OPCItem
Dim ClientHandles As Long
Dim serverhandless(1) As Long
Dim Errors(1) As Long
Dim cannel As Long
Dim transactionID As Long
Const numitem = 1

Private Sub Command1_Click()
Set opc_server = New OPCAutomation.opcSERVER
opc_server.Connect ("Kepware.KepServerEX.V4")
Debug.Print opc_server.ServerState '1为连接成功
'建立组对象
Set opc_group = opc_server.OPCGroups.Add
'设置好组的基本属性
opc_group.IsActive = True
opc_group.IsSubscribed = True
opc_group.UpdateRate = 1000
'建立项
Set opc_item = opc_group.OPCItems.AddItem("_System._Time_Second", 1)
serverhandless(1) = opc_item.ServerHandle
Debug.Print opc_item.ServerHandle
'异步读取
opc_group.AsyncRead numitem, serverhandless, Errors, transactionID, cannel
End Sub
这是一个简单的所有程序,就是最后异步读取的时候报错:类型不匹配 错误类型13

服务器连接是正常的...
OPC客户端读取程序报错... 已锁定
编辑推荐: 关闭

请填写推广理由:

本版热门话题

通信与网络组件

共有4536条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
X 图片
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。