Dymo 1761334 Technical Reference - Page 13

Conversions, Programming the LabelWriter Printer

Page 13 highlights

Programming the LabelWriter Printer To allow for longer distances to be specified, two 8-bit characters are used to specify the value, by combining them into one 16-bit character. Though the calculations are all performed within the printer itself, it is important to understand how the characters are handled. The decimal value of the first character that is sent (usually noted as n1) is multiplied by 256. The decimal value of the second character sent (usually noted as n2) is then added to this. The following illustration is a graphical representation of how this works. Conversions To send a value under 256 to a command that takes the n1 n2 parameters, simply send the first character with a 0 value. For values greater than 256 but less than 512, the first parameter should be sent with a value of 1. For values greater than 512 but less than 768, the first parameter should be set to 2, and so on. Converting from dots to inches using the n1 n2 parameters can seem a bit challenging at first, but is really no more complex than multiplication and division. The table below lists some common values and their relationship. Inches Dots n1 n2 0.5 101 0 101 1.0 203 0 203 1.5 304 1 48 2.0 406 1 150 2.5 507 1 251 3.0 609 2 97 3.5 710 2 198 4.0 812 3 44 To convert from a value shown in the Dots column, convert the Dots value to binary, and then convert the top eight bits to base 10 for n1 and the bottom eight bits to decimal for n2. For example: 7

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76

Programming the LabelWriter Printer
To allow for longer distances to be specified, two 8-bit characters are used to specify the
value, by combining them into one 16-bit character. Though the calculations are all
performed within the printer itself, it is important to understand how the characters are
handled.
The decimal value of the first character that is sent (usually noted as
n1
) is multiplied by
256. The decimal value of the second character sent (usually noted as
n2
) is then added to
this.
The following illustration is a graphical representation of how this works.
To send a value under 256 to a command that takes the
n1 n2
parameters, simply send the
first character with a 0 value. For values greater than 256 but less than 512, the first
parameter should be sent with a value of 1. For values greater than 512 but less than 768,
the first parameter should be set to 2, and so on.
Conversions
Converting from dots to inches using the
n1 n2
parameters can seem a bit challenging at
first, but is really no more complex than multiplication and division. The table below lists
some common values and their relationship.
Inches
Dots
n1
n2
0.5
101
0
101
1.0
203
0
203
1.5
304
1
48
2.0
406
1
150
2.5
507
1
251
3.0
609
2
97
3.5
710
2
198
4.0
812
3
44
To convert from a value shown in the Dots column, convert the Dots value to binary, and
then convert the top eight bits to base 10 for
n1
and the bottom eight bits to decimal for
n2
.
For example:
7