コード例 #1
0
ファイル: Tuxeip_Class.cs プロジェクト: nick1658/SharpSCADA
 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);
コード例 #2
0
ファイル: ABPLCDriver.cs プロジェクト: zz110/SharpSCADA
 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);
     }
 }
コード例 #3
0
ファイル: Tuxeip_Class.cs プロジェクト: nick1658/SharpSCADA
 public static extern int _WriteLgxData(
     Eip_Session *session,
     Eip_Connection *connection,
     string adress,
     LGX_Data_Type datatype,
     void *data,
     //int datasize,
     short number);
コード例 #4
0
ファイル: Tuxeip_Class.cs プロジェクト: nick1658/SharpSCADA
 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);
コード例 #5
0
ファイル: ABPLCDriver.cs プロジェクト: zz110/SharpSCADA
 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;
 }
コード例 #6
0
ファイル: ABPLCDriver.cs プロジェクト: zz110/SharpSCADA
 public float[] ReadFloatArray(DeviceAddress address, ushort size)
 {
     if (IsClosed)
     {
         return(null);
     }
     else
     {
         float[]   buffer = new float[size]; address.VarType = DataType.FLOAT; var addr = GetAddress(address);
         LGX_Read *data = Tuxeip_Class._ReadLgxData(session, connection, addr, size);
         if (data != null && data->Varcount > 0)
         {
             for (int i = 0; i < data->Varcount; i++)
             {
                 buffer[i] = Tuxeip_Class._GetLGXValueAsFloat(data, i);
             }
             data = null;
             return(buffer);
         }
         connection = null;
         return(null);
     }
 }
コード例 #7
0
ファイル: Tuxeip_Class.cs プロジェクト: nick1658/SharpSCADA
 public static extern LGX_Read *_ReadLgxData(
     Eip_Session *session,
     Eip_Connection *connection,
     string adress,
     ushort number);
コード例 #8
0
ファイル: Tuxeip_Class.cs プロジェクト: nick1658/SharpSCADA
 public static extern int _Forward_Close(Eip_Connection *connection);