How to implement ctypes in IronPython
Posted
by
Walter
on Stack Overflow
See other posts from Stack Overflow
or by Walter
Published on 2013-10-30T15:50:34Z
Indexed on
2013/10/30
15:53 UTC
Read the original article
Hit count: 460
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..
© Stack Overflow or respective owner