How to implement ctypes in IronPython
- by Walter
I need help.
I have a code which is passing a script into a DLL and initialize the instrument. But, one of the code unable to use in IronPython beside python 2.7 and 3.3
I have attached the code as below
enter code here
import ctypes
import time, sys
DLLHANDLE=ctypes.cdll.LoadLibrary("C:\\INSTRDLL\\builds\\DCSOURCEDLL\\B2902A.dll")
INPUTSCRIPT="SYSTEM{DCSOURCE1|INIT}"
INPUTVOLTAGE=0.0
c_INPUTSCRIPT=ctypes.c_char_p(INPUTSCRIPT)
c_INPUTVOLTAGE=ctypes.c_double(INPUTVOLTAGE)
SOURCEHANDLE=DLLHANDLE.DCSOURCE(c_INPUTSCRIPT,c_INPUTVOLTAGE)
time.sleep(1)
Once "SOURCEHANDLE=DLLHANDLE.DCSOURCE(c_INPUTSCRIPT,c_INPUTVOLTAGE)" is triggered, Ironpython will crash automatically and no idea how to resolve it...
or any workaround solution?
Please advice..