利用hollias comm opcserver 与Python实现交互。代码如下:
# -*- coding: utf-8 -*-
from sys import *
from getopt import *
#from os import * 造成f = open('test.txt', 'r') TypeError: an integer is required错误
import signal
import sys
import os
import types
import datetime
import re, time, csv
import Openopc
import Pyro
import pypyodbc
import random
print os.name
opc_class='Matrikon.OPC.Automation;Graybox.OPC.DAWrapper;HSCOPC.Automation;RSI.OPCAutomation;OPC.Automation'
client_name='OpenOPC'
opc_server='Hollysys.HOLLiASComm.1'
opc_host='127.0.0.1'
taglist=[]
f=open('test.txt','r')
f.seek(0)
for line in f:
print line,
line=line.rstrip('
&#