我想从Python的外部脚本访问我们的Citect SCADA系统。我在这里找到了一些示例代码:https://github.com/mitchyg/Random/blob/master/pyctapi/src/pyctapi.py
当我运行这段代码时:
def ct_tag_read(self, tag_name):
buffer = create_string_buffer('\000' * 32)
ok = windll.CtApi.ctTagRead(self.hCTAPI, tag_name, byref(buffer), sizeof(buffer), None)
return buffer.value
我得到这个错误:
^{pr2}$我使用的是python3.5。在
下面是Citect API函数ct_TagRead的说明:
http://www.citect.schneider-electric.com/webhelp/vijeo740/Content/ctTagRead.html
首先,我混淆了ctCicode和ctTagRead的参数,所以代码应该看起来像(没有“,”None“参数):
我切换到Python2.7,一切正常。在
相关问题 更多 >
编程相关推荐