Example #1
0
 public static extern PLC_Read *_ReadPLCData(
     Eip_Session *session,
     Eip_Connection *connection,
     DHP_Header *dhp,
     byte *routepath, byte routepathsize,
     Plc_Type type, short tns,
     string address, short number);
Example #2
0
 public bool Connect()
 {
     try
     {
         if (session != null)
         {
             Dispose();
         }
         session = Tuxeip_Class.OpenSession(_ip);
         byte[] path = new byte[] { _rack, _slot };
         if (session != null)
         {
             int res = Tuxeip_Class._RegisterSession(session);
             connection = Tuxeip_Class.ConnectPLCOverCNET(session, Plc_Type.LGX, path);
         }
         return(session != null && connection != null);
     }
     catch (Exception error)
     {
         if (OnError != null)
         {
             OnError(this, new IOErrorEventArgs(error.Message));
         }
         return(false);
     }
 }
Example #3
0
 public static extern int _WriteLgxData(
     Eip_Session *session,
     Eip_Connection *connection,
     string adress,
     LGX_Data_Type datatype,
     void *data,
     //int datasize,
     short number);
Example #4
0
 public static extern int _WritePLCData(
     Eip_Session *session,
     Eip_Connection *connection,
     DHP_Header *dhp,
     byte *routepath, byte routepathsize,
     Plc_Type type, short tns,
     string address,
     PLC_Data_Type datatype,
     void *data,
     short number);
Example #5
0
 private static extern Eip_Connection *_ConnectPLCOverCNET(
     Eip_Session *session,
     Plc_Type Plc,
     byte Priority,
     sbyte TimeOut_Ticks,
     uint TO_ConnID,          //originator's CIP consumed session ID
     ushort ConnSerialNumber, // session serial number
     ushort OriginatorVendorID,
     uint OriginatorSerialNumber,
     sbyte TimeOutMultiplier,
     uint RPI,// originator to target packet rate in msec
     byte Transport,
     byte[] path, byte pathsize);
Example #6
0
 public void Dispose()
 {
     if (connection != null)
     {
         Tuxeip_Class._Forward_Close(connection);
     }
     if (session != null)
     {
         Tuxeip_Class._UnRegisterSession(session);
     }
     Tuxeip_Class.CloseSession(session);
     Marshal.FreeCoTaskMem((IntPtr)connection);
     Marshal.FreeCoTaskMem((IntPtr)session);
     connection = null;
     session    = null;
 }
Example #7
0
 public static Eip_Connection *ConnectPLCOverCNET(Eip_Session *session, Plc_Type Plc, byte[] path)
 {
     return(_ConnectPLCOverCNET(session, Plc, _Priority, _TimeOut_Ticks, 0x12345678, 0x6789,
                                _OriginatorVendorID, _OriginatorSerialNumber, _TimeOutMultiplier, 5000, _Transport, path, (byte)path.Length));
 }
Example #8
0
 public static extern int _UnRegisterSession(Eip_Session *session);
Example #9
0
 public static extern void CloseSession(Eip_Session *session);
Example #10
0
 public static extern LGX_Read *_ReadLgxData(
     Eip_Session *session,
     Eip_Connection *connection,
     string adress,
     ushort number);