Q: Why my generic cable counter driver does not read the data from my instrument?


A: You tow a sensor behind the vessel and want NaviPac to move the towed object automatically as the cable out changes. You do not want to type the cable out by hand. Your cable counter (for example, a Hydrographic Survey Products Smart Sensor Display) sends data to NaviPac, but:

  • The Generic Cable Counter driver does not read the counter's string, so the towed object does not move.
  • The User Defined Relative Position driver connects, but the dynamic object stays put when the cable out changes.
  • Each time you change the cable out by hand during a line, NaviPac starts a new NPD file, so you end up with several NPD files for one line.

Cause

The Generic Cable Counter reads most counters directly: MacArtney MKII (L=…), HSP Smart Sensor Display ($CCA…), Valeport, Hengel (CNT…) and Esters PMO 2160. What usually stops it working is the end-of-string setting, not the string format.

  • The Cable string prefix also decides which character ends a string. Prefix L, the default, makes NaviPac end each string at CR. Any other prefix makes it end each string at LF (CR/LF).
  • NaviPac writes this setting to Setup\navipac.ini the first time you start online with the driver. After one start with prefix L, the CR setting stays, even if you change the prefix later.
  • If a counter that sends CR/LF meets the CR setting, the LF ends up at the start of the next string. NaviPac then can't read any string. In Rawdata, the strings start with <0A> and Interpreted data shows Not able to interpret data.
  • If a counter that sends CR only meets the CR/LF setting, NaviPac never sees the end of a string, so no data gets through.

MacArtney MKII: according to MacArtney's manuals, the MKII protocol sends two lines every second: L = ddd,d m (cable out) and S = dd,d m/min (cable speed), each ending with LF. The Generic Cable Counter reads the speed line as a cable out of 0, and a space between L and = also gives 0. EIVA’s rental MKII boxes are reported to end their strings with CR, and work with prefix L. A raw capture from a real box has not been checked, so it is not confirmed whether they also send the speed line.

Solution

Use the Generic Cable Counter with the right prefix, and make sure the end-of-string setting matches your counter.

  1. On the towed object, add a Generic Cable Counter on the I/O port the counter is connected to.
  2. Set Cable string prefix:
    • L for a MacArtney MKII that ends its strings with CR, as EIVA's rental boxes are reported to do. On a MKII, keep Protocol set to MKII (not Extended). The default serial format is 9600, 8 data bits, no parity, 1 stop bit.
    • Your counter's own prefix for anything else, for example $CCA for an HSP Smart Sensor Display ($CCA00002.0M+0500).
    • If the counter also sends a speed line (S=…) or a space between L and =, use the DataMon alternative below with its filter steps.
  3. If the project has ever been started with prefix L and your counter ends its strings with CR/LF or LF, reset the end-of-string setting:
    1. Close NaviPac.
    2. Open C:\EIVA\NaviPac\Setup\navipac.ini. In the [dataio] section, delete the line Instrument4.401 (or Instrument4.413 for Generic Cable Counter 2).
    3. In NaviPac Config, do a cold start (Reset, then Start). NaviPac writes the line again with the correct setting.
  4. Check the result:
    • In NaviPac Rawdata, select the counter's port. Interpreted data should show Length: with the cable out.
    • In the Object Monitor, Delta Y of the towed object should show minus the cable out.
    • The towed object's coordinates follow the vessel's track. At start-up, NaviPac places the object astern along the heading at the full cable out. After that, it trails behind as the vessel moves. Paying out cable while the vessel is stationary changes Delta Y, but not the coordinates, until the vessel moves.
Counter sendsPrefixInstrument4.401 line ends withResult
Strings ending with CR only (MacArtney MKII rental boxes, as reported)L13,13,1Works
Strings ending with CR/LF or LF (HSP; MKII as its manual describes)Not L, set before the first start (or after a reset)13,10,1Works
Strings ending with CR/LFL, or changed from L without a reset13,13,1Fails: <0A> before each string
Strings ending with LF onlyL, or changed from L without a reset13,13,1Fails: no complete strings
Strings ending with CR onlyNot L13,10,1Fails: no complete strings
A speed line (S=…), or L =  with spacesAnyAnyCable out reads 0: use the DataMon filter

To see which one your counter sends, look at the raw strings in Rawdata: <0D> is CR and <0A> is LF.

Alternative: User Defined Input with port sharing

If you can't edit navipac.ini, you can route the counter through a User Defined Input (UDI) instead. The Generic Cable Counter then gets each string as one complete network packet, so the end-of-string setting doesn't matter.

  1. In NaviPac project settings, open NaviScan and enable port sharing.
  2. Add a User Defined Input on the counter's I/O port. Set Item separator to Use byte count and activate channel 1 only. Set Read item at field to where the cable out starts (counting the first character as 0) and Item length to cover the number. For $CCA00002.0M+0500, use field 5 and length 8.
  3. On the towed object, add a Generic Cable Counter. Set its I/O to an ATTU port whose number is the UDI's port number + 16000, for example 16077 for COM77.

Alternative: DataMon as a line-ending converter

DataMon can read the counter and pass each string on to NaviPac ending in CR only. This matches the CR setting that prefix L leaves in navipac.ini, so it works with any prefix and you don't need to edit navipac.ini. This was tested with HSP and MacArtney MKII strings that end in CR/LF.

  1. In DataMon, open the configuration (right-click the DataMon window) and add these components:
    • A UART Port on the counter's COM port, with the counter's baud rate, data bits, stop bits and parity. It splits strings at CR or LF and ignores empty lines.
    • A UDP Port with Remote set to 127.0.0.1 and a free port, for example 7200. Set Terminator to \r. If you leave Terminator empty, DataMon sends CR/LF and the problem comes back.
  2. Connect the UART Port's Out to the UDP Port's input.
  3. For a MacArtney MKII that sends a speed line or spaces (L = ddd,d m and S = dd,d m/min), put two components between the UART Port and the UDP Port:
    • A String Match with match value L. Connect its output L onward, so only the cable out line passes.
    • A String Replacer with Old Value L = and Replacement L=. Leave Use Regex off.
  4. Save the configuration.
  5. In NaviPac Config, set the Generic Cable Counter's I/O to UDP, 127.0.0.1, port 7200. Keep the prefix for your counter.
  6. Start DataMon with this configuration before you start NaviPac online, and keep it running while you survey. If DataMon opens with another configuration, open this one from its menu.
  7. In NaviPac Rawdata, port 7200, check that each string ends with <0D>, that no string starts with <0A> or S, and that Interpreted data shows Length:.

Layback correction for speed

In NaviPac 4.14, Correct layback for SMG and Layback constants in NaviPac Config have no effect. The driver reads its settings from two other places, so set them there:

  1. Close NaviPac.
  2. Open C:\EIVA\NaviPac\Setup\CABLE401.DEF. Under [Init], enter the number of rows and one row per speed (speed in knots, then A, then B), for example:
[Init]
No=3
1= 4 0.308 6.2
2= 6 0.208 3.5
3= 8 0.157 2.4
  1. Open C:\EIVA\NaviPac\Setup\navipac.ini and add:
[Cable]
Cable1-SMG=Yes
  1. Start NaviPac. These settings stay through later cold starts.

NaviPac then calculates depth = A × cable out + B, and layback = √(cable out² − depth²). Between two speeds in the table it interpolates A and B. Below the first speed it uses the first row, and above the last speed the last row. For example, with 100 m out at 5 kn, depth is 30.97 m and layback is 95.1 m.

Check the corrected layback as Delta Y in the Object Monitor. Rawdata's Length: shows the value for speed 0 (the first row), not the corrected layback. The same Cable1-SMG setting and table also apply to Generic Cable Counter 2. So if your counter is set up as Generic Cable Counter 2, still add Cable1-SMG=Yes. If you use two cable counters at the same time, they share this setting and table, so both are corrected the same way.

Applies to and further help

  • Product: NaviPac 4.14 (all steps tested).
  • Drivers: for the full list of instruments, see NaviPac > Help > Data Formats.
  • Still stuck? Contact EIVA Helpdesk at support@eiva.com or +45 7215 0505 (24/7). Include a sample of your cable counter string and your NPP project file.