python如何读取wincc的某一个归档变量的时间段数据?

在西门子提供的文档中,用VBS 程序在SQLsever中查询数据,代码为: "TAG:R,(1;2),'2004-10-13 17:00:00.000','0000-00-00
00:02:00.000', 'TIMESTEP=15.261'" 可读取ID 1和2的 某一时间段数据,那么在python中如何实现把这个数据读出来呢?

你可以用Python调用ADO对象 执行这些vbs的代码,Python是一门胶水语言,这个我项目中真实使用过,如果需要代码上面的支持请私聊我


import pymssql
 
 
conn = pymssql.connect(host='localhost', user='***', password='***', database='earth_pressure')
cur = conn.cursor()
#ringNumber pressureAverage forwardVelocity conveyorSpeed为列名,earth_pressure_100_250为标名,where后面为筛选条件
sql = 'select ringNumber,pressureAverage,forwardVelocity,conveyorSpeed from earth_pressure_100_250 where ringNumber>='+str(currentRingNumber-20)+' and ringNumber <='+str(currentRingNumber)
dataDf = pd.read_sql(sql, conn)
 
conn.commit()
cur.close()
conn.close()