客户端连接OpenOPC Gateway

import OpenOPC

gateway='192.168.1.90'
opchost='testbox'

opcserv='KEPware.KEPServerEx.V4'
taglist =['Channel_4.Device_6.Bool_15']
print 'Connecting to Gateway Server on: ',gateway
opc = OpenOPC.open_client(gateway)
opc.connect(opcserv)
v = opc.read(taglist)
opc.close()
for i in range(len(v)):
    (name, val, qual, time) = v[i]
    print '%-15s %-15s %-15s %-15s'%(name,val,qual,time)

 

相关文章:

猜你喜欢
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-09-27
  • 2022-12-23
相关资源
相似解决方案