The C function from DLL:
Multi(double Freq, double Power, int ports[], int Size)
Need to pass the 3rd parameter as an array from python
Tried the following different codes:
A:
import ctypes
pyarr = [2,3]
arr = (ctypes.c_int * len(pyarr))(*pyarr)
lp = CDLL(CDLL_file)
lp.Multi(c_double(Freq), c_double(Power), arr ,c_int(Size))`
This code shows an error ## exception :: access violation reading 0x00000000000
B:
retarr = (ctypes.c_int*2)()
retarr[0] =2
retarr[1] =3
lp = CDLL(CDLL_file)
lp.Multi(c_double(Freq), c_double(Power), retarr ,c_int(Size))`
This code shows an error
## exception :: access violation reading 0x00000000000
C: The same code using ctypes.byref also tried ......
My understanding is the function expects an array as argument , Tries passing an array as such as well address. Both cases , it didn't work Do anyone sees any mistake in my understanding or any other to work this out ??
Sizeset to?