PDA

View Full Version : Prodave .net/C#


MikeMechEng
January 22nd, 2008, 05:10 PM
Anyone have a .net example of prodave communications? Specifically over ethernet if possible, but I'll take anything.

MikeMechEng
January 22nd, 2008, 05:58 PM
Finally got this working. If anyone is ever trying, here is what I got to work (this is first iteration and not very robust):



[DllImport("Prodave6.dll",EntryPoint="LoadConnection_ex6",ExactSpelling=true,CharSet=CharSet.Ansi,CallingCo nvention=CallingConvention.Cdecl)]private static extern int LoadConnection_ex6(ushort ConNr,char[] pAccessPoint, int ConTableLen,byte[] ConTable);

public int connection()

{

char[] pAccessPoint ={ 'S', '7', 'O', 'N', 'L', 'I', 'N', 'E' };

//IP Address = 192.168.1.200, connection type =2 (IP)
byte[] conn = new byte[] { 192, 168, 1, 200, 0, 0, 2, 0, 0 };
int length = (int)conn.Length;
int res = LoadConnection_ex6((ushort)0, pAccessPoint, length, conn);

return res;

}