oscargomezf

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. I've solved the problem. I've been managing the function so: private static extern bool DpcOpenData(IntPtr phif, string szdvc, ref int perc, IntPtr ptrid); Instead of: private static extern bool DpcOpenData(ref IntPtr phif, System.Text.StringBuilder szdvc, ref int perc, IntPtr ptrid); The problem is solved and works fine.
  2. Hi, I am trying to use the dpcutil.dll library with Visual .Net [C#]. I've managed to import the functions what I need to write and read registers in my BASYS2 EVB [250]. const string _dllLocation = "C:WindowsSystem32dpcutil.dll"; [DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)] private static extern bool DpcInit(ref int perc); [DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)] private static extern void DpcTerm(); [DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)] private static extern bool DpcGetDpcVersion(StringBuilder szVersion, ref int perc); [DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)] private static extern bool DpcOpenData(IntPtr phif, System.Text.StringBuilder szdvc, ref int perc, IntPtr ptrid); [DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)] private static extern bool DpcCloseData(IntPtr hif, ref int perc); [DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)] private static extern bool DpcPutReg(IntPtr hif, byte bAddr, byte bData, ref int perc, IntPtr ptrid); [DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)] private static extern bool DpcGetReg(IntPtr hif, byte bAddr, ref byte pbData, ref int perc, IntPtr ptrid);I know that I am using correctly the dll because I get the dll version from the function DpcGetDpcVersion(). My problem is when I try to use the funciton DpcOpenData. I got the error number 3103. I've read in the Digilent Port Communications Programmers Reference Manual that: ercCantConnect: 3103. Description: Can’t connect to communication module. First of all I've recored the rom flash of the BASYS2 with the reference design: https://www.inf.pucrs.br/calazans/undergrad/laborg/mat_plataformas/Nexys2/dpimref.vhd In my DEV Visual .Net Application [C#]. I've been using the following steps: 1º.- DpcInit(ref theErc) -> theErc = 0 2º.- DpcGetDpcVersion(theVersion, ref theErc) -> theErc = 0 and theVersion =2.9.2 3º-. devCount = getDevCount() -> devCount = 2 4º.- for i= 0 to i < devCount => getDevName(i, devTemp); devTemp -> Basis2 AND devTemp -> Basis2_bis 5º.- DpcOpenData(hif, theDevice, ref theErc, ptrid) -> theErc = 3103 I am stacked in this step. Could you help me out how I can solve this problem? Thank you so much. Best regards.
  3. I solved the problem. This is the way to use the dpcutil.dll functions from Visual .Net c#: const string _dllLocation = "C:WindowsSystem32dpcutil.dll"; [DllImport(_dllLocation, CallingConvention = CallingConvention.Cdecl)] private static extern bool DpcInit(ref int perc);
  4. Hi, I would like to use the adept sdk library in visual .net with c#. Anyone knows how can I do that? I've got this files from the Adept SDKv1-3: dpcdefs.h dpcutil.h dpcutil.lib But I don't know how to get a dpcutil.dll to use it in visual .net with c#. Thank you. Best regards.