官方文档
Citect SCADA 7.20 Technical Reference
参考文献
基于Citect远程控制的变流量堆料控制系统 【王玉增,顾英妮,王维 济南大学,机械工程学院 ,Citect,CTAPI】
正文
组态软件内部变量支持的数据类型
Citect组态软件已被施耐德收购。通过软件提供的API,可以通过高级语言编程和组态软件内部数据点通讯。
下面是一个Python的例子,暂未测试:
https://github.com/mitchyg/Random/blob/master/pyctapi/src/pyctapi.py

#! /usr/bin/python # # File: pyctapi.py # Author: Mitchell Gayner # Date: 06/08/2009 # # Desc: # Wrapper for Citect CTAPI dll # Compatible with Citect V6.1 DLLs # # You must have the following DLLs: # - CiDebugHelp.dll # - Ct_ipc.dll # - CtApi.dll # - CtEng32.dll # - CtRes32.DLL # - CtUtil32.dll # import platform from ctypes import * import sys if platform.system() != "Windows": raise OSError class pyCtApi: def __init__(self, dllPath_ = "C:/citect/bin/"): #Load required DLLs CDLL(dllPath_ + '/CiDebugHelp') CDLL(dllPath_ + '/CtUtil32') CDLL(dllPath_ + '/Ct_ipc') self.__libc = CDLL(dllPath_ + '/CtApi') self.__cn = None # Create connection object def Open(self, address_, username_, password_, mode_ = 0): "Open connection to running citect process" if self.__cn != None: print "Already connected" return self.__cn = windll.CtApi.ctOpen(address_, username_, password_, 2) def Close(self): "Close connection to running citect process" ct = windll.CtApi.ctClose(self.__cn) self.__cn = None def Connected(self): if self.__ExecCicode("Version(0)") != "": return True return False def TagReadInt(self, tagName_): "Read tag from Citect and covert to int" str = self.__TagRead(tagName_) #try: return int(str) #except: return -1 def TagReadFloat(self, tagName_): "Read tag from Citect and covert to float" str = self.__TagRead(tagName_) #try: return float(str) #except: return -1 def TagReadStr(self, tagName_): "Read tag from Citect and covert to string" str = self.__TagRead(tagName_) return str def TagWrite(self, tagName_, value_): "Write value to Citect tag" ok = self.__TagWrite(tagName_, str(value_)) return ok def ExecuteCicode(self, function_): return self.__ExecCicode(function_) def __TagRead(self, tagName_): "PRIVATE: Read tag from Citect tag" f = create_string_buffer('