Hello Sorry for my late reply. In this case the application is dedicated to the communication with RSLinx. Here I attach the code where I cut many non intersting lines of code so it will not run if you try. Then if yo need I can attach the complete version. Anyway the lines that i am interested in are highlighted.
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.Timers;
using RsiOPCAuto;
using System.Windows.Forms;
using System.IO;
using System.Threading;
namespace opc_ali
{
class Program
{
//static Opc.Server LinxOPCServer;
static RsiOPCAuto.OPCServer RSLinxOPCserver;
static RsiOPCAuto.OPCGroup RSLinxOPCgroup;
static RsiOPCAuto.OPCItem RSLinxOPCItem\_1;
static RsiOPCAuto.OPCItem RSLinxOPCItem\_2;
static RsiOPCAuto.OPCItem RSLinxOPCItem\_3;
static RsiOPCAuto.OPCItem RSLinxOPCItem\_4;
static int prec\_sec\_bl = 0;
static int prec\_millis\_bl = 0;
static int TimeNow\_Sec, TimeNow\_mSec;
static int tempo\_p, tempo\_s, delta;
static int\[\] DDE\_IN\_INT = new int\[50\];
static int\[\] DDE\_OUT\_INT = new int\[50\];
static double\[\] DDE\_IN\_DOU = new double\[50\];
static double\[\] DDE\_OUT\_DOU = new double\[50\];
static int numero\_word\_I;
static int numero\_word\_O;
static int tempo\_campionamento;
static int numero\_campioni;
static int new\_line;
public static void Main(string\[\] args)
{
try
{
RSLinxOPCserver = new RsiOPCAuto.OPCServer();
RSLinxOPCserver.Connect("RSLinx OPC Server", "");
RSLinxOPCgroup = RSLinxOPCserver.OPCGroups.Add("Prova");
RSLinxOPCgroup.IsActive = true;
RSLinxOPCgroup.UpdateRate = 50;
RSLinxOPCgroup.IsSubscribed = true;
RSLinxOPCItem\_1 = RSLinxOPCgroup.OPCItems.AddItem("\[ali\]Program:scrittura\_dati\_per\_out.dde\_OUT\_INT\[0\],L1,C1", 1);
RSLinxOPCItem\_2 = RSLinxOPCgroup.OPCItems.AddItem("\[ali\]Program:scrittura\_dati\_per\_out.dde\_OUT\_INT\[0\],L" + numero\_word\_I + ",C1", 2);
RSLinxOPCItem\_3 = RSLinxOPCgroup.OPCItems.AddItem("\[ali\]Program:scrittura\_dati\_per\_out.dde\_IN\_INT\[0\],L1,C1", 3);
RSLinxOPCItem\_4 = RSLinxOPCgroup.OPCItems.AddItem("\[ali\]Program:scrittura\_dati\_per\_out.dde\_IN\_INT\[0\],L" + numero\_word\_O + ",C1", 4);
Lett