Skip to content

Command 1A Insulin Schedule

Joe Moran edited this page Mar 15, 2018 · 16 revisions

The 1A Command: providing insulin schedules for basal patterns, temp basals, and boluses

Several important messages include the "1A" command, which gives an insulin schedule based on the number of 0.05U ticks over 30 minute periods for all the various insulin delivery related commands: basal patterns, temp basals and boluses. This particular page describes the generic information for how these various commands are constructed. There are subsequent pages to describe the details for the three different types of insulin delivery scheduling:

The generic 1A insulin schedule command format is:

1a LL NNNNNNNN TT CCCC DD AAAA RRRR NATT [NATT]... NC...
  • 1a (1 byte): Mtype value of 1a specifies a generic insulin schedule command

  • LL (1 byte): Length of the command (i.e. # of bytes following LL, at least 0e)

  • NNNNNNNN (4 bytes): Nonce, the 32-bit validator (random looking numbers)

  • TT (1 byte): TableNum, 0 = Basal Schedule, 1 = Temp Basal, 2 = Bolus

  • CCCC (2 bytes): CheckSum, byte sum of the following 3 fields along with the bytes in the generated insulin schedule table

  • DD (1 byte): TableNum specific data, formerly called Duration

  • AAAA (2 bytes): TableNum specific data, formerly called FieldA

  • RRRR (2 bytes): TableNum specific data, formerly called UnitRate

  • NATT... (2 bytes): InsulinScheduleElement, one of more elements as described in detail below, formerly called UnitRateSchedule

  • NC (1 byte): Next Command (either $13, $16 or $17) followed by length and data

Command $1A is always followed in the same message by the following Next Commands:

TableNum

The TableNum field can have the value 0, 1 or 2 and specifies which internal table holds the schedule. Details for each of the table specific interpretation of the other various fields can be found here:

CheckSum

The CheckSum is always the sum of the bytes in case specific DD, AAAA, RRRR fields and the bytes of the generated insulin schedule table. However for some cases, CheckSum can also be a simple sum of the remaining bytes in the command. Examples of the Checksum calculation are shown within the TableNum specific case pages.

DD, AAAA and RRRR

The interpretation of the DD, AAAA and RRRR fields (formerly called Duration, FieldA and UnitRate respectively) vary based on the TableNum cases list above.

InsulinScheduleElement

All of the various $1A commands use one or more InsulinScheduleElements to describe an insulin delivery over an interval based on the number of 0.05U ticks delivered every half hour. These elements are used to generate an internal insulin schedule table that is then used to drive the Omnipod's pump.

The basic format for each of these elements is NATT:

  • N: there are N+1 half hour entries described by this element
  • A: typically 0 or 8, bitwise 'a0tt' with a being 0 or 1 to add an extra tick each alternate half hour and tt being the upper 2 bits of the 10-bit tick value
  • TT: lower 8 bits of the 10-bit number of 0.05U ticks per each half hour table entry

Since N is a 4-bit nibble, each element can describe a time interval of between 30 minutes (N=0) to 8 hours (N=f) maximum. A is typically either 0 or 8 and effectively acts as a boolean to indicate if an extra 0.05U step is applied at alternate half hours to give an hourly basal rate resolution of up to an additional 0.05 U/h (depending on the length of the interval as seen in examples below). For larger amounts that require more than 255 ticks to describe (255 * 0.05U = 12.75U), the 'A' nibble will get the top 2 bits of the 10-bit tick value. TT is the lower 8 bits of the 10-bit base number of 0.05U ticks for each of the N+1 entries in the specified insulin schedule table.

Example InsulinScheduleElement $3005

The example InsulinScheduleElement value of $3005 has N=3 (the number of additional 1/2 hour entries), A=0 (no alternating extra ticks or high order tick bits), and TT=05 (the base number of ticks for each half hour entry). Thus the generated insulin schedule table for a $3005 element creates the following N+1 = 4 entry (2 hour) insulin schedule table:

1: 5 x 0.05U = 0.25U
2: 5 x 0.05U = 0.25U
3: 5 x 0.05U = 0.25U
4: 5 x 0.05U = 0.25U
               1.00U total

This insulin schedule table of [5 5 5 5] delivers a total of 1.0U over 2 hours or 0.50 U/h for the 2 hour interval.

Example InsulinScheduleElement $0258

The example InsulinScheduleElement value of $0258 has N=0 additional 1/2 hour entries, A=2 which is binary 0010 indicating no alternating extra tick (a=0) and a top nibble of the tick value of 2, and TT=$58 for the lower 8 bits for the number of ticks for each half hour entry.

Thus the full 10-bit tick value is $258 (=600 decimal) and the generated insulin schedule table for a $0258 InsulinScheduleElement creates a single entry insulin schedule table of [600] that can be used to deliver the documented maximum bolus of 30U.

The Omnipod documentation also states that the maximum basal rate is 30 U/h(!) which 15U or 300 0.05U ticks per half hour. The InsulinScheduleElement to describe this maximum 30 U/h basal rate for 1 hour would be $112C which would create a two entry insulin schedule table of [300 300].

Example InsulinScheduleElement $000a

The example InsulinScheduleElement value of $000a has N of 0 for a one 1/2 0.5h entry and TT of $0a. Thus the generated insulin schedule table for the $000a element creates the following single entry (half hour) insulin schedule table:

1: 10 x 0.05U = 0.50U total

This single entry insulin schedule table of [10] delivers 0.5 U over 0.5h which is a rate of 1.0 U/h for a half hour interval for a basal rate or can be used to deliver a 0.5 unit bolus.

Example InsulinScheduleElement $7801

N=7 is the number of additional half hour entries, A=8 indicates adding an extra tick for alternate half hours, and TT=01 is the base number of ticks for each half hour segment. Thus the generated insulin schedule table for a $7801 element creates the following 8 entry (4 hour) insulin schedule table:

1: 1 x 0.05U = 0.05U
2: 2 x 0.05U = 0.10U
3: 1 x 0.05U = 0.05U
4: 2 x 0.05U = 0.10U
5: 1 x 0.05U = 0.05U
6: 2 x 0.05U = 0.10U
7: 1 x 0.05U = 0.05U
8: 2 x 0.05U = 0.10U
               0.60U total

This insulin schedule table of [1 2 1 2 1 2 1 2] delivers a total of 0.60U over 4 hours or 0.15 U/h for the 4 hour interval.

Example InsulinScheduleElement $4800

'N'=4 (+1 for a 5 entry table), A=8 (add an additional tick for alternate entries), TT=00 (the base number of ticks is zero) will create the following 5 entry (2.5 hour) insulin schedule table:

1: 0 x 0.05U = 0.00U
2: 1 x 0.05U = 0.05U
3: 0 x 0.05U = 0.00U
4: 1 x 0.05U = 0.05U
5: 0 x 0.05U = 0.00U
               0.10U total

This insulin schedule table of [0 1 0 1 0] delivers a total of 0.10U over 2.5 hours. This works out to be an average of 0.04 U/h for 2.5 hours. Note that because of the Omnipod can only deliver an integral number of 0.05U ticks each half hour, certain basal rates over various time intervals can only be approximated. Some more examples of what element values are generated for various bolus rates and times will help illustrate some of these boundary conditions.

Basal Rate of 0 U/h for 0.5 hour

The element value of $0000 (zero 0.05U ticks over one half hour) gives the requested 0 U/h for 0.5h and generates a single entry insulin schedule table of [0].

Basal Rate of 0.05 U/h for 1 hour

The element value of $1800 will generate a two entry insulin schedule table of [0 1] which will deliver a total of 0.05U over 1 hour which is the requested 0.05 U/h for this 1 hour interval.

Basal Rate of 0.05 U/h for 0.5 hour

Since only an integral number of 0.05U ticks can be delivered for each half hour interval, there can only be either 0 ticks (0.0 U/h) or 1 tick (0.05U total over 0.5h or 0.10 U/h) delivered in a half hour interval, the Omnipod will round down (for safety reasons) and generate 0.0 U/h using the element value of $0000. This is the exact same element value created for 0 U/h for 0.5h which generates the single entry insulin schedule table of [0].

Basal Rate of 0.25 U/h for 1 hour

The element value of $1802 will generate a two entry insulin schedule table of [2 3] which will deliver 5 * 0.05U = 0.25U total over one hour which is the requested 0.25 U/h for this 1 hour interval.

Basal Rate of 0.25 U/h over 0.5 hour

Since only an integral number of 0.05U ticks can be delivered for each half hour interval, there can either be 2 ticks (0.10 total over 0.5h or 0.20 U/h) or 3 ticks (0.15U total over 0.5h or 0.30 U/h) delivered in a half hour interval, the Omnipod will round down and generate an element value of $0002 to generate a single entry insulin schedule of [2] which will deliver 2 * 0.05U = 0.10U total over 0.5h or 0.20 U/h for 1/2 hour.

Basal Rate of 0.25 U/h over 3.5 hours

In this example, the larger time interval is specified which will allow for the Omnipod to more closely approximate the requested basal rate. An element value of $6802 generates a 7 entry insulin schedule table of [2 3 2 3 2 3 2] which will deliver a total of (7*2 + 1+1+1) ticks or 17 * 0.05U = 0.85U total over 3.5h which is 0.243 U/h for 3.5 hour.

Clone this wiki locally