Index: /branches/BNC_2.12/src/RTCM/RTCM2Decoder.cpp
===================================================================
--- /branches/BNC_2.12/src/RTCM/RTCM2Decoder.cpp	(revision 9088)
+++ /branches/BNC_2.12/src/RTCM/RTCM2Decoder.cpp	(revision 9089)
@@ -154,6 +154,5 @@
           frqObs1P->_phaseValid = true;
           frqObs1P->_phase = _ObsBlock.resolvedPhase_L1(iSat);
-          //frqObs1P->_slipCounter = _ObsBlock.slip_L1[iSat];
-          frqObs1P->_slipCounter = -1; // because RTCM2 definition is vice versa to RTCM3
+          frqObs1P->_slipCounter = _ObsBlock.slip_L1[iSat];
           obs._obs.push_back(frqObs1P);
 
@@ -164,6 +163,5 @@
           frqObs2P->_phaseValid = true;
           frqObs2P->_phase = _ObsBlock.resolvedPhase_L2(iSat);
-          //frqObs2P->_slipCounter = _ObsBlock.slip_L2[iSat];
-          frqObs2P->_slipCounter = -1; // because RTCM2 definition is vice versa to RTCM3
+          frqObs2P->_slipCounter = _ObsBlock.slip_L2[iSat];
           obs._obs.push_back(frqObs2P);
 
Index: /branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp
===================================================================
--- /branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp	(revision 9088)
+++ /branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp	(revision 9089)
@@ -148,8 +148,7 @@
       frqObs->_codeValid = frqObs->_phaseValid = true;
     }
-    GETBITS(i, 7);
-    frqObs->_lockTime = lti2sec(type,i);
+    GETBITS(frqObs->_lockTimeIndicator, 7);
+    frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator);
     frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
-    frqObs->_slipCounter = i;
     if (type == 1002 || type == 1004) {
       GETBITS(amb, 8);
@@ -194,8 +193,7 @@
         frqObs->_phaseValid = true;
       }
-      GETBITS(i, 7);
-      frqObs->_lockTime = lti2sec(type,i);
+      GETBITS(frqObs->_lockTimeIndicator, 7);
+      frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator);
       frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
-      frqObs->_slipCounter = i;
       if (type == 1004) {
         GETBITS(i, 8);
@@ -768,5 +766,5 @@
                   frqObs->_lockTime = lti2sec(type,ll[count]);
                   frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
-                  frqObs->_slipCounter = ll[count];
+                  frqObs->_lockTimeIndicator = ll[count];
                 }
                 break;
@@ -777,5 +775,4 @@
                   frqObs->_codeValid = true;
                 }
-
                 if (cp[count] > -1.0 / (1 << 8)) {
                   frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl
@@ -784,5 +781,5 @@
                   frqObs->_lockTime = lti2sec(type,ll[count]);
                   frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
-                  frqObs->_slipCounter = ll[count];
+                  frqObs->_lockTimeIndicator = ll[count];
                 }
                 break;
@@ -799,5 +796,5 @@
                   frqObs->_lockTime = lti2sec(type,ll[count]);
                   frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
-                  frqObs->_slipCounter = ll[count];
+                  frqObs->_lockTimeIndicator = ll[count];
                 }
                 frqObs->_snr = cnr[count];
@@ -816,5 +813,5 @@
                   frqObs->_lockTime = lti2sec(type,ll[count]);
                   frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
-                  frqObs->_slipCounter = ll[count];
+                  frqObs->_lockTimeIndicator = ll[count];
                 }
                 frqObs->_snr = cnr[count];
@@ -837,5 +834,5 @@
                   frqObs->_lockTime = lti2sec(type,ll[count]);
                   frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
-                  frqObs->_slipCounter = ll[count];
+                  frqObs->_lockTimeIndicator = ll[count];
                 }
 
@@ -855,5 +852,5 @@
                   frqObs->_lockTime = lti2sec(type,ll[count]);
                   frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
-                  frqObs->_slipCounter = ll[count];
+                  frqObs->_lockTimeIndicator = ll[count];
                 }
 
@@ -943,8 +940,7 @@
       frqObs->_codeValid = frqObs->_phaseValid = true;
     }
-    GETBITS(i, 7);
-    frqObs->_lockTime = lti2sec(type,i);
+    GETBITS(frqObs->_lockTimeIndicator, 7);
+    frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator);
     frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
-    frqObs->_slipCounter = i;
     if (type == 1010 || type == 1012) {
       GETBITS(amb, 7);
@@ -989,8 +985,7 @@
         frqObs->_phaseValid = true;
       }
-      GETBITS(i, 7);
-      frqObs->_lockTime = lti2sec(type,i);
+      GETBITS(frqObs->_lockTimeIndicator, 7);
+      frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator);
       frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
-      frqObs->_slipCounter = i;
       if (type == 1012) {
         GETBITS(i, 8);
Index: /branches/BNC_2.12/src/bnccaster.cpp
===================================================================
--- /branches/BNC_2.12/src/bnccaster.cpp	(revision 9088)
+++ /branches/BNC_2.12/src/bnccaster.cpp	(revision 9089)
@@ -164,4 +164,8 @@
     obs._staID = staID.data();
 
+    // Update/Set Slip Counters
+    // ------------------------
+    setSlipCounters(obs);
+
     // Output into the socket
     // ----------------------
@@ -560,2 +564,44 @@
                    .arg(_miscSockets->size()).toAscii(), true) );
 }
+
+
+// Set/Update Slip Counters
+////////////////////////////////////////////////////////////////////////////
+void bncCaster::setSlipCounters(t_satObs& obs) {
+
+  double minLockTime = -1.0;
+  for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
+    const t_frqObs* frqObs = obs._obs[ii];
+    if (frqObs->_lockTimeValid) {
+      if (minLockTime == -1.0 || minLockTime < frqObs->_lockTime) {
+        minLockTime = frqObs->_lockTime;
+      }
+    }
+  }
+
+  if (minLockTime == -1.0) {
+    return;
+  }
+
+  QMap<t_prn, double>& ltMap = _lockTimeMap[obs._staID];
+  QMap<t_prn, int>&    jcMap = _jumpCounterMap[obs._staID];
+
+  QMap<t_prn, double>::const_iterator it = ltMap.find(obs._prn);
+  if (it == ltMap.end()) {
+    ltMap[obs._prn] = minLockTime;
+    jcMap[obs._prn] = 0;
+  }
+  else {
+    if (ltMap[obs._prn] < minLockTime) {
+      ltMap[obs._prn] = minLockTime;
+      jcMap[obs._prn] += 1;
+      if (jcMap[obs._prn] > 9999) {
+        jcMap[obs._prn] = 0;
+      }
+    }
+  }
+  for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
+    t_frqObs* frqObs = obs._obs[ii];
+    frqObs->_slipCounter = jcMap[obs._prn];
+  }
+}
Index: /branches/BNC_2.12/src/bnccaster.h
===================================================================
--- /branches/BNC_2.12/src/bnccaster.h	(revision 9088)
+++ /branches/BNC_2.12/src/bnccaster.h	(revision 9089)
@@ -64,4 +64,5 @@
    static int myWrite(QTcpSocket* sock, const char* buf, int bufLen);
    void reopenOutFile();
+   void setSlipCounters(t_satObs& obs);
 
    QFile*                          _outFile;
@@ -84,4 +85,6 @@
    QTcpServer*                     _miscServer;
    QList<QTcpSocket*>*             _miscSockets;
+   QMap<std::string, QMap<t_prn, double> > _lockTimeMap;
+   QMap<std::string, QMap<t_prn, int> >    _jumpCounterMap;
 };
 
Index: /branches/BNC_2.12/src/bncrinex.cpp
===================================================================
--- /branches/BNC_2.12/src/bncrinex.cpp	(revision 9088)
+++ /branches/BNC_2.12/src/bncrinex.cpp	(revision 9089)
@@ -640,5 +640,6 @@
           << left  << setw(3) << "L" + frqObs->_rnxType2ch << ' '
           << right << setw(14) << setprecision(3) << frqObs->_phase << ' '
-          << right << setw(4)                     << frqObs->_slipCounter;
+          //<< right << setw(4)                     << frqObs->_slipCounter;
+          << right << setw(4)                     << frqObs->_lockTimeIndicator;
     }
     if (frqObs->_dopplerValid) {
Index: /branches/BNC_2.12/src/bncutils.cpp
===================================================================
--- /branches/BNC_2.12/src/bncutils.cpp	(revision 9088)
+++ /branches/BNC_2.12/src/bncutils.cpp	(revision 9089)
@@ -1002,5 +1002,5 @@
 }
 
-// Convert RTCM3 lock-time indicator to lock time in seconds
+// Convert RTCM3 lock-time indicator to minimum lock time in seconds
 ////////////////////////////////////////////////////////////////////////////
 double lti2sec(int type, int lti) {
@@ -1016,5 +1016,5 @@
     else if (lti< 127) return  32*lti-3096; // [744  32  905]
     else if (lti==127) return  937;
-    else               return  -1;
+    else               return  -1.0;
   }
   else if (type%10==2 || type%10==3 ||
@@ -1037,5 +1037,5 @@
       case(14) : return 262144e-3;
       case(15) : return 524288e-3;
-      default  : return     -1;
+      default  : return     -1.0;
     };
   }
@@ -1064,8 +1064,8 @@
     else if (lti< 704) return (1048576*lti-671088640 )*1e-3;
     else if (lti==704) return (2097152*lti-1409286144)*1e-3;
-    else               return (     -1               );
+    else               return (     -1.0               );
   }
   else {
-    return -1;
+    return -1.0;
   };
 };
Index: /branches/BNC_2.12/src/satObs.h
===================================================================
--- /branches/BNC_2.12/src/satObs.h	(revision 9088)
+++ /branches/BNC_2.12/src/satObs.h	(revision 9089)
@@ -15,17 +15,18 @@
  public:
   t_frqObs() {
-    _code            = 0.0;
-    _codeValid       = false;
-    _phase           = 0.0;
-    _phaseValid      = false;
-    _doppler         = 0.0;
-    _dopplerValid    = false;
-    _snr             = 0.0;
-    _snrValid        = false;
-    _lockTime        = 0.0;
-    _lockTimeValid   = false;
-    _slip            = false;
-    _slipCounter     = 0;
-    _biasJumpCounter = 0;
+    _code              = 0.0;
+    _codeValid         = false;
+    _phase             = 0.0;
+    _phaseValid        = false;
+    _doppler           = 0.0;
+    _dopplerValid      = false;
+    _snr               = 0.0;
+    _snrValid          = false;
+    _lockTime          = -1.0;
+    _lockTimeValid     = false;
+    _slip              = false;
+    _slipCounter       =  0;
+    _biasJumpCounter   =  0;
+    _lockTimeIndicator = -1;
   }
   std::string       _rnxType2ch;
@@ -39,8 +40,9 @@
   bool              _snrValid;
   double            _lockTime;
-  bool              _lockTimeValid;  
-  bool              _slip;
-  int               _slipCounter;
-  int               _biasJumpCounter;
+  bool              _lockTimeValid;
+  bool              _slip;              // RINEX
+  int               _slipCounter;       // RTCM2 or converted from RTCM3
+  int               _lockTimeIndicator; // RTCM3
+  int               _biasJumpCounter;   // ??
 };
 
