title: Passing pointers to DLL function in Python
body: <p>I am working on a project where I have to build a GUI for a development board with python with which I am new to as well. I am given the DLL which has required functions to communicate with the development board.
  I have LabVIEW equivalent function prototype which looks something like this:</p>
  
  <pre><code>int32_t WriteFPGARegsC(int16_t *USBdev, int32_t *DUTSelect, int32_t *Array_RegsIn, int32_t *Array_RegsOut, int32_t *Array_RegEnable);
  </code></pre>
  
  <p>And the same prototype also looks like this for Visual Basic:</p>
  
  <pre><code>Public Declare Function WriteFPGARegsC Lib "USB_IO_for_VB6.dll" (ByRef USBdev As Short, ByVal DUTSelect As Integer, ByRef Array_RegsIn As Integer, ByRef Array_RegsOut As Integer, ByRef Array_RegEnable As Integer) As Integer
  </code></pre>
  
  <p>I am trying to access this function with python instead of LabVIEW because of a lot of issues.</p>
  
  <p>Last three parameters to be passed to the function needs to be an address to an array of 255 elements.</p>
  
  <p><strong>I have no clue how to pass pointers in function in python!!</strong></p>
  
  <p>I wrote the following shortcode to access this function in python:</p>
  
  <pre><code>USBdev = [0]
  DUTSelect = [0]
  RegsIn = [0] * 255
  RegsOut = [0] * 255
  RegEnable = [0] * 255
  
  from ctypes import*
  
  mydll = cdll.LoadLibrary("USB_IO_for_VB6.dll")
  retmydll = mydll.WriteFPGARegsC(USBdev, DUTSelect, RegsIn, RegsOut, RegEnable)
  </code></pre>
  
  <p>After executing this code I get following error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "D:\Kushal\ATLASS\Source_code\Atlass.py", line 12, in &lt;module&gt;
      retmydll = mydll.WriteFPGARegsC(id(USBdev), id(DUTSelect), id(RegsIn),    id(RegsOut), id(RegEnable))
  ValueError: Procedure called with not enough arguments (20 bytes missing) or wrong calling convention
  </code></pre>
  
  <p>Any help will be appreciated!!
  Thanks a lot!</p>