private string formatSMKData(GasData data, int converteNumber)
 {
     return String.Format(":GRANAT;{0};K{8};Blasen {1};{2,7:0.00};{3,7:0.00};{4,7:0.00};{5,7:0.00};{6,7:0.00};{7,7:0.00}",
         DateTime.Now.ToString("HH:mm:ss"),
         1,
         data.H2, data.CO, data.N2, data.O2, data.AR, data.CO2,
         converteNumber);
 }
 private void onConverter1(GasData data)
 {
     try
     {
         if ((DateTime.Now - Core1lastTime).TotalMilliseconds > 500)
         {
             mainGate1.PushEvent(new OffGasAnalysisEvent()
                 {
                     iCnvNr = 1,
                     Ar = data.AR,
                     CO = data.CO,
                     CO2 = data.CO2,
                     H2 = data.H2,
                     N2 = data.N2,
                     O2 = data.O2,
                     Time = DateTime.Now
                 });
             Core1lastTime = DateTime.Now;
         }
     }
     catch { }
     //Console.WriteLine(data.ToString());
 }
 private void onConverter3DDE(GasData data)
 {
     try
     {
         if ((DateTime.Now - DDE3lastTime).TotalSeconds > 30)
         {
             string logMessage = formatSMKData(data, 3);
             DDE3lastTime = DateTime.Now;
             Console.WriteLine(logMessage);
             sendToSMK(System.Text.ASCIIEncoding.ASCII.GetBytes(logMessage));
         }
     }
     catch { }
 }