I am trying to write an API in python for reading and writing tags from citect app, so I am loading the dlls files: "Ctapi.dll" and else of "Aveva-Citect 2018R2" details:
- Python version:3.6.5/3.8.0 32 bit
- Citect version:2018 R2
- CtAPI dlls: I took from the folder: C:...\Citect 2018 R2\Citect SCADA 2018 R2\Extras\CtApi\CtApi.Win32.Redist.zip
The program fails when I try to call to the function:"ctOpen"
import ctypes
import os
IP_ADDRESS = "172.16.11.222"
CITECT_USERNAME = "Analyst"
CITECT_PASSWORD = "1"
CITECT_PATH = "C:/Users/ryfrach/PycharmProjects/TrainingCallDll/dlls/CtApi32"
CITECT_MODE = 0x00000002
os.chdir(CITECT_PATH)
ct_api = ctypes.CDLL(CITECT_PATH + '/CtApi.dll')
function = ct_api.ctOpen
function.argtypes = [ctypes.c_wchar_p, ctypes.c_wchar_p,ctypes.c_wchar_p,ctypes.c_int]
function(IP_ADDRESS,CITECT_USERNAME,CITECT_PASSWORD,CITECT_MODE)
This is the error I get:
File "C:/Users/ryfrach/PycharmProjects/TrainingCallDll/main.py", line 27, in <module>
function(IP_ADDRESS,CITECT_USERNAME,CITECT_PASSWORD,CITECT_MODE)
OSError: [WinError -532462766] Windows Error 0xe0434352
Does someone know the solution? PLEASE!!