Technical Forum

Communication / Networks

Prodave 6.0 & Ethernet from .NET framework

Thread Starter: Ramsing   Started: 1/24/2006 11:50 AM   Replies: 1

« Previous thread Next thread »
Page 1 of 1 (2 items)
  1/24/2006, 11:50 AM
Joined 1/24/2006
Last visit: 7/22/2009
Posts: 19
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I have a problem with communication using the new Prodave 6.0 to a 400 PLC using ethernet.

Description:
The program on the PLC does not contain any network information except it designated IP number.
I am on an XP machine, no firewall, .NET 1.1 and the Prodave 6.0 installed.

The old prodave worked fine ( 5.6 ) using the MPI, but this time I need ethernet communication - therefore 6.0 MPI/IE

I get the following error if the formatting for LoadConenction_ex6 is ok
0x42C2:Eine Verbindung zwischen Ihrem PG/PC und dem Automatisierungsgert kann nicht hergestellt werden.

and 7000h if it is not.
Subnets etc. is OK, and I can ping the PLC.

I have tried the PG/PC on ISO, TCP/IP(auto) and TCP/IP protocols, and tried both MAC and IP communications.

Does the PLC need to know anything about a communications parther before the connection can be set up ?

I am kind of lost here, and Prodave 6.0 is shipped with antique codesamples :-)

Regards

Jes Ramsing

Top
  2/7/2006, 7:47 AM
Joined 1/24/2006
Last visit: 7/22/2009
Posts: 19
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I have done a bit of interop mapping, here is the basic mappings.

[DllImport("Prodave6.dll",EntryPoint="LoadConnection_ex6",ExactSpelling=true,CharSet=CharSet.Ansi,CallingConvention=CallingConvention.Cdecl)]

private static extern int LoadConnection_ex6(ushort ConNr,char[] pAccessPoint, int ConTableLen,byte[] ConTable);

[DllImport("Prodave6.dll",EntryPoint="UnloadConnection_ex6",ExactSpelling=true,CharSet=CharSet.Ansi,CallingConvention=CallingConvention.Cdecl)]

private static extern int UnloadConnection_ex6(ushort ConNr);

[DllImport("Prodave6.dll",EntryPoint="SetActiveConnection_ex6",ExactSpelling=true,CharSet=CharSet.Ansi,CallingConvention=CallingConvention.Cdecl)]

private static extern int SetActiveConnection_ex6(ushort ConNr);

[DllImport("Prodave6.dll",EntryPoint="db_read_ex6",ExactSpelling=true,CharSet=CharSet.Ansi,CallingConvention=CallingConvention.Cdecl)]

private static extern int db_read_ex6(ushort no_of_db,byte datatype,ushort startaddr, ref uint read_request_length,uint bufferlength, byte[] buffer,ref uint returnlength);

[DllImport("Prodave6.dll",EntryPoint="db_write_ex6",ExactSpelling=true,CharSet=CharSet.Ansi,CallingConvention=CallingConvention.Cdecl)]

private static extern int db_write_ex6(ushort no_of_db,byte datatype,ushort startaddr, ref uint write_request_length,uint bufferlength, byte[] buffer);

//Connection creation

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

byte[] conn = new byte[] {10,140,132,6,0,0,2,3,0};

int length = (int)conn.Length;

res=LoadConnection_ex6((ushort)0, pAccessPoint,length,conn);

//Simple read operation - buffer is a byte array

int res = 0;

uint amount_to_read = (uint)buffer.Length;

try{

res = db_read_ex6(no_of_db,type,start_address_in_db,ref amount_to_read,(ushort)buffer.Length,buffer,ref realread);

}

Top
Page 1 of 1 (2 items)
Actions