Book a demo
  1. Home
  2. Articles
  3. Data & platform

Data & platform · worked example

WITS0 explained: records, items and turning a rig feed into WITSML

By DrillIQ engineering teamUpdated 27 November 202613 min read

Short answer. WITS0 is the ASCII level of the Wellsite Information Transfer Specification. Each frame runs from && to !!, with one item per line written as RRIIvalue: a two-digit record, a two-digit item, then the value. It carries no units or timezone, so the receiver supplies them before rows become WITSML logs.

Many rig systems still pass live data on as WITS Level 0, a plain text stream that is easy to read and easy to misread. A wrong unit, a clock read in the wrong time zone or a date sent in the wrong order can turn a healthy feed into wrong data without a single error message. This article decodes one hypothetical frame, checks its units and time by hand, and follows it into WITSML.

What is WITS0?

WITS, the Wellsite Information Transfer Specification, defines how systems at a wellsite pass data to one another. It has several levels. Level 0 is the plain ASCII one: text lines that a person can read on a terminal. Level 1 sends the same records in a binary format, and the levels above it add two-way exchange between the two ends. A Level 0 receiver simply takes the lines as they arrive, over a serial line or a network socket.

Data is grouped into numbered records, and each record holds numbered items. The WITS Rev 1.1 pre-defined record map has 25 records and 1,026 items. Of those, 175 are header items (seven at the start of every record), 134 are spares, and 717 carry data. A record also has a trigger that says when it should be sent. Record 1 is sent at a time interval, record 2 at a depth interval, record 7 when new survey values arrive, and the mud report, record 20, when an operator starts it.

WITS0 is simple to produce and simple to check by eye, which helps explain why rig equipment still sends it. WITSML, the XML standard that followed, adds wells, wellbores, units and history to the same readings. WITSML explained covers that object model. This article stays with the WITS0 side and the step between the two.

One frame, line by line

A frame starts with a line holding && and ends with a line holding !!. Each line between them is RRIIvalue: two digits for the record, two for the item, and the rest of the line is the value. The frame below is from a hypothetical rig feed, with the metric unit agreement and a rig clock at UTC+04:00.

A hypothetical record 1 frame, decoded
LineMnemonicUnitValueIn the row
0101EXAMPLEWELLIDEXAMPLEHeader, not a curve
0105261127DATE261127Builds TIME
0106101500TIME101500Builds TIME
01081000.0DEPTBITMm1000.0Curve
01101000.0DEPTMEASm1000.0Curve
011320.0ROPAm/h20.0Curve
0114100.0HKLAkdaN100.0Curve
01168.0WOBAkdaN8.0Curve
011812.0TORQAkN.m12.0Curve
0120120RPMArpm120Curve
012115000SPPAkPa15000Curve
0122CHKPkPa(empty)Left out
01302500MFIAL/min2500Curve

There are no separators between record, item and value, so 01168.0 reads as record 01, item 16, value 8.0. The meaning comes from the record map. Item 14 is average hook load only because the map says so.

A network or serial read can stop anywhere. We cut this 145-byte frame (with its line endings) after 81 bytes, part-way through the hook load line. DrillIQ's rig agent, Rig Connect, returned no record from the first part and exactly one from the second, identical to the uncut frame. The result is one row with ten curves: nine measurements and a TIME curve built from items 05 and 06.

Which records a rig sends

A rig sends only the records and items its supplier has configured, so a feed is usually a small part of the map. Record 1 is the general time-based drilling record, with 45 items. Record 2 is the depth-based one. Record 7 carries surveys, record 15 cuttings and lithology, record 16 hydrocarbon shows, record 20 the mud report, record 21 the bit report, record 22 remarks and record 23 well identification. Suppliers may also add their own records above 25. The standard gives those no names, so the receiver has to be told what each item means.

Figure 1 Items in the records that become logs and objects
  • Data items
  • Header items 01 to 07
  • Spare items
0102030405060701 Time-based drilling · Data items: 33 items1 Time-based drilling · Header items 01 to 07: 7 items1 Time-based drilling · Spare items: 5 items451 Time-based drilling2 Depth-based drilling · Data items: 20 items2 Depth-based drilling · Header items 01 to 07: 7 items2 Depth-based drilling · Spare items: 4 items312 Depth-based drilling7 Survey · Data items: 14 items7 Survey · Header items 01 to 07: 7 items7 Survey · Spare items: 5 items267 Survey15 Cuttings and lithology · Data items: 47 items15 Cuttings and lithology · Header items 01 to 07: 7 items15 Cuttings and lithology · Spare items: 5 items5915 Cuttings and lithology16 Hydrocarbon show · Data items: 34 items16 Hydrocarbon show · Header items 01 to 07: 7 items16 Hydrocarbon show · Spare items: 5 items4616 Hydrocarbon show20 Mud report · Data items: 53 items20 Mud report · Header items 01 to 07: 7 items20 Mud report · Spare items: 5 items6520 Mud report21 Bit report · Data items: 33 items21 Bit report · Header items 01 to 07: 7 items21 Bit report · Spare items: 9 items4921 Bit report22 Remarks · Data items: 3 items22 Remarks · Header items 01 to 07: 7 items1022 Remarks23 Well identification · Data items: 26 items23 Well identification · Header items 01 to 07: 7 items23 Well identification · Spare items: 4 items3723 Well identificationItems in the record

Counted from the WITS Rev 1.1 pre-defined record map that Rig Connect ships (wits_rev11.json). The figure at the end of a bar is the total. Records 1 and 2 are written as logs only; the other seven are also read as WITSML objects or names. A rig sends only the records and items it is set to send.

Show the data
Data itemsHeader items 01 to 07Spare items
1 Time-based drilling3375
2 Depth-based drilling2074
7 Survey1475
15 Cuttings and lithology4775
16 Hydrocarbon show3475
20 Mud report5375
21 Bit report3379
22 Remarks37
23 Well identification2674

The report records are the large ones: 65 items for the mud report, 59 for cuttings and lithology. Remarks are the smallest, with ten items, three of which carry data. The seven header items identify the well, the sidetrack, the record, its sequence, the date, the time and the activity code. They describe the frame, so none of them becomes a measurement curve.

How are units and time set in a WITS0 feed?

A WITS0 line carries no unit. The two ends agree a unit system, metric or imperial, and sometimes exceptions item by item. The number on the wire looks the same either way.

Record 1 items under the two unit agreements
ItemMnemonicMetricImperial
0108DEPTBITM, bit depthmft
0113ROPA, rate of penetrationm/hft/h
0114HKLA, hook loadkdaNklbf
0116WOBA, weight on bitkdaNklbf
0118TORQA, rotary torquekN.mklbf.ft
0121SPPA, standpipe pressurekPapsi
0130MFIA, mud flow inL/mingal/min
0132MDIA, mud density inkg/m³ppg

The metric force unit catches people out. The standard's metric hook load and weight on bit are in kdaN, kilodecanewtons, each equal to 10 kN. A rig may report tonnes-force instead, which needs a per-item override, such as setting item 0114 to t in Rig Connect's source settings.

Time has the same gap. Item 05 is the date, YYMMDD in the standard, and item 06 the time, HHMMSS. Rig Connect also reads YYYYMMDD and HHMM. Neither says which time zone the rig clock keeps. The receiver has to be told, and Rig Connect takes an offset such as +04:00 or UTC+3 for each source. It doesn't accept named zones such as Asia/Dubai. It then writes the time as UTC.

If a frame carries no time that can be read, Rig Connect stamps the row with the moment it received the frame, flags the row and counts it in its status. That keeps the data, at a cost shown below.

A hand check

Check the clock and one force by hand before trusting a new feed. Both take a minute.

  1. The date. Line 0105261127 is item 05 with value 261127: year 26, month 11, day 27, so 27 November 2026.
  2. The time. Line 0106101500 is 10:15:00 on the rig clock.
  3. The offset. The clock keeps UTC+04:00, so subtract 4 hours: 10:15:00 − 04:00 = 06:15:00 UTC. The row's time is 2026-11-27T06:15:00.000Z, which is what the decoder produced. Had the rig clock been read as UTC, every row would be stamped 4 hours ahead of the truth.
  4. The force units. 1 kdaN = 10,000 N. 1 klbf = 1,000 × 4.44822 N = 4,448.22 N. So 1 kdaN = 10,000 ÷ 4,448.22 = 2.2481 klbf.
  5. The hook load. The frame's 100.0 kdaN is 100.0 × 2.2481 = 224.8 klbf. Read as klbf, it shows as 100.0 klbf: 124.8 klbf low, or 55.5 % under the true value. DrillIQ's unit converter gives the same 224.8 klbf.

The mistake works both ways. An imperial rig's 100 klbf, filed as kdaN, converts to 224.8 klbf on screen when the true load is 100. Smaller errors are harder to see: 100 kdaN is 102.0 tonnes-force, so a tonnes feed read as kdaN looks believable and is out by about 2 %. Compare one reading with the driller's display, in the driller's units, to catch both.

How do you convert WITS0 to WITSML?

Conversion has two parts. Every record becomes rows of a WITSML log. Some records are also events or reports, and WITSML has an object for those.

Time and depth rows

Rig Connect turns each frame into one row: a record number, a log name, an index (time or depth), curves and units. Rows of the same record go into one growing WITSML 1.4.1.1 log. The write for the frame above looks like this.

The WITSML log write for the example frame
PartContent
Log name and uidGeneral Time-Based, wits0-rec01-time
indexType, indexCurvedate time, TIME
mnemonicListTIME,DEPTBITM,DEPTMEAS,ROPA,HKLA,WOBA,TORQA,RPMA,SPPA,MFIA
unitLists,m,m,m/h,kdaN,kdaN,kN.m,rpm,kPa,L/min
data2026-11-27T06:15:00.000Z,1000.0,1000.0,20.0,100.0,8.0,12.0,120,15000,2500

The log keeps each value as the rig wrote it, and names its unit in the unit list. Record 2, and record 13 on returns depth, are depth logs indexed by their depth item, and their rows carry no date or time curve. A record 2 frame without its depth gives no row and is counted as skipped. The other records are time logs, including records 8, 9 and 14, which the standard allows by time or depth. A source can switch any of them to a depth log.

Reports and events as objects

WITS records that Rig Connect also writes as WITSML objects
RecordWITSML objectEach frame
7, surveytrajectoryAdds a trajectory station, keyed by survey depth
15, cuttingsmudLogAdds a geology interval
16, showthe same mudLogAdds a show interval
20, mud reportfluidsReportOne report, keyed by report number
21, bit reportbhaRunOne bit run, keyed by bit number
22, remarksmessageOne message per remark
23, well identificationnoneSupplies the well name, unless one is configured

A hypothetical survey frame with depth 1000.0 m, vertical depth 995.0 m, tool type MWD, inclination 10.00°, corrected azimuth 45.00° and dogleg severity 1.50°/30 m becomes the station st-1000.00. Its elements are md, tvd, incl, azi and dls with their units, the station time in UTC and a station type of magnetic MWD. The same frame sent twice builds the same identifier, so the store replaces the station instead of adding a second. A frame without the survey depth, item 0708, builds no station. Its log row is still written, and the status records why.

Units mostly pass through. In objects, a few are respelled for WITSML, and kdaN is sent as kN: a bit report with an average weight on bit of 8.0 kdaN is written as 80 kN in the bit run, while its log row keeps 8.0 kdaN. How a reader then follows these logs is covered in WITSML explained, and the newer transport in WITSML 1.4.1 against 2.0 and ETP.

What goes wrong on real feeds

These are the faults to look for when a feed is connected and the numbers still look wrong. The behaviour in the table is that of Rig Connect and DrillIQ's store. We checked the decoding cases and the shared timestamp by running the code on made-up frames.

Faults in a WITS0 feed and what happens to them
FaultWhat happens
Split frameA frame split across two reads is held until the closing !! arrives, then decoded once.
Lost !!A frame that lost its end marker is dropped when the next frame is complete; its items don't leak into that frame.
Empty itemNo curve value for that row.
No-value marker−999.25, −9999 and −8888 are left out of WITSML objects but kept as sent in log rows, so the receiving system must treat them as empty.
Odd time formatA time written 101500.00, or 81500 without its leading zero, is not read; the row takes the receipt time.
Day-first date271126 is read as year first, so 26 November 2027, with no error.
Same secondTwo frames stamped in the same second share one index; DrillIQ's store keeps one row, and later non-empty values win.
Clock driftUsed as sent; Rig Connect doesn't correct it.
Wrong unitsThe wrong unit agreement gives plausible-looking numbers with the wrong labels.

Why the rig's own time matters

Take a feed of one record 1 frame a second. Suppose something between the rig system and the agent, such as a serial converter or a network hop, holds the frames from second 60 and delivers them all from second 120, 10 ms apart. We ran 181 such frames through the decoder twice, with and without items 05 and 06, then wrote both logs into DrillIQ's WITSML store.

Figure 2 Time stamped on each frame through a 60 s stall
  • Stamped on receipt
  • With items 05/06
  • Stall
Feed stalled03060901201501800306090120150180Rig time the frame was sent (s)Time stamped on the row (s)61 frames share one stampBoth agree

Simulation of a hypothetical feed through Rig Connect's decoder: one record 1 frame a second for 180 s; frames from 60 s are held and delivered from 120 s, 10 ms apart. Seconds are counted from the first frame.

Show the data
Sent atWith items 05/06Stamped on receipt
0.000
3.033
6.066
9.099
12.01212
15.01515
18.01818
21.02121
24.02424
27.02727
30.03030
33.03333
36.03636
39.03939
42.04242
45.04545
48.04848
51.05151
54.05454
57.05757
60.060120
63.063120
66.066120
69.069120
72.072120
75.075120
78.078120
81.081120
84.084120
87.087120
90.090120
93.093120
96.096120
99.099120
102102120
105105120
108108120
111111120
114114120
117117120
120120120
123123123
126126126
129129129
132132132
135135135
138138138
141141141
144144144
147147147
150150150
153153153
156156156
159159159
162162162
165165165
168168168
171171171
174174174
177177177
180180180

With the rig's date and time, all 181 rows keep their own second and the store holds 181 rows. Stamped on receipt, 61 frames land in second 120. They give 121 distinct times, and the store holds 121 rows: 60 readings are overwritten, and the surviving row at that second has the last frame's values. The record then has a minute with no rows, although the rig was working normally. A missing minute followed by a pile-up at one time is a reason to check where the times come from.

The stall that matters is the one ahead of the agent. Rig Connect stamps a row when the frame reaches it, before buffering, so a later outage between the rig and the office doesn't change any time. On-premises deployment and drilling data sovereignty works through that outage and its catch-up.

A checklist for the rig team

  • Agree the unit system in writing, with every item that departs from it, such as hook load in tonnes-force.
  • Set the rig clock's offset on the receiver, and keep that clock synchronised.
  • Confirm that items 05 and 06 arrive in every time-indexed record, as YYMMDD and HHMMSS with leading zeros.
  • Compare one value each of depth, hook load and standpipe pressure with the driller's display.
  • Ask the supplier what it sends when a sensor has no value.
  • Review skipped frames, rows without rig time and unmapped records in the first hour.
  • Send one survey and one report frame, and check that they arrive as objects.
  • Keep a copy of the raw stream from the source during commissioning, so a doubtful value can be traced to the wire.

How DrillIQ handles it

Rig Connect runs as a Windows service on a rig PC. It reads WITS0 over TCP (listening or connecting), UDP or a serial line, and maps record and item numbers to curves with the WITS Rev 1.1 dictionary, using a unit system and clock offset set for each source, plus overrides for single items. Its settings page shows a live value beside each item and lists items the standard doesn't define. It writes a WITSML 1.4.1.1 log for each record and the objects in the table above, buffers them on disk through link outages, and sends them only to the DrillIQ WITSML store it is enrolled with.

In DrillIQ, a well that an enrolled agent writes to is set up and followed by itself. Its data is stored raw until an engineer approves the channel mapping, and the engineering modules use it from then on.

Book a demo See all capabilities

Frequently asked questions

What does a WITS0 line mean?

The first two digits are the record number, the next two the item number, and the rest of the line is the value. The WITS record map says what that record and item measure, so 0114 is average hook load in record 1.

Which units does WITS0 use?

The line carries none. Sender and receiver agree on a metric or imperial set, with exceptions item by item. The standard's metric hook load and weight on bit are in kdaN, where 100 kdaN equals 224.8 klbf.

Does WITS0 include a time zone?

No. Items 05 and 06 give a date and a time from the rig clock, with no offset. The receiver must be told the clock's offset, for example +04:00, before it can write the time as UTC.

How does a WITS0 record become WITSML?

Each record becomes rows in a time-indexed or depth-indexed WITSML log. Rig Connect also writes survey, lithology, show, mud, bit and remark records as objects such as trajectory, mudLog, fluidsReport, bhaRun and message.

References

  1. Jantzen, R.E., Foreman, R.D., Keltner, L. and McCoy, R. Wellsite Information Transfer Specification (WITS) for Digital Rig-Site Data. SPE Drilling Engineering 4 (4): 291–299, 1989. SPE 16141.
  2. Energistics. WITSML Data Schema, version 1.4.1.1.
  3. Energistics. WITSML Store Application Program Interface (API), version 1.4.1.