2500_Users_Manual- - 第403页
Q1 0C 4C 41 42 45 4C 0D 54 45 58 54 0D 34 Q2 02 01 FC Q6 02 02 FB Q7 02 13 EA Q9 01 Computer Remote Control Label record type — QI indicates a data record containing labeling information. The ASCII character CR (OD hex) …

Q70213EA.
Q001FE
Q10C4C4142454C0D544558540D34
Q20201FC
Q60202FB
Q70213EA
Q901FE
Q0
01
FE
INTO RECEIVING
TUBE = 01 (1)
PIN 1
LABEL
ORIENTATION = 0
DIRECTION OF TRAVEL
TXT
PIN 1
PIN 1
OUT OF
INPUT TUBE = 11 (3)
1393-1
Computer
Remote
Control
Q8
Q9
Creating
Hex
Label
Records
Example
of
the
Hex
Label
File
Format
The
following
diagram
illustrates
an
example
of
pin
1
orientations
for
the
three
locations:
The
rotation
byte
in
binary
is
00010011.
Convert
00010011
binary
to
13
hex.
The
record
becomes
Reserved
for
future
use.
A
termination
record
for
a
block
of
label
records.
There
is
no
data
field.
Only
one
termination
record
is
used
in
a
Label
Hex
Format
file.
Usually,
only
one
header
record
is
used,
although
multiple
header
records
are
allowed.
You
can
create
a
Hex
Label
Format
file
using
a
standard
text
editor,
although
it
is
easier
to
use
a
program
that
can
create
a
Hex
Label
Format
file,
such
as
the
LABEL
program
included
with
the
ProMaster
2500.
You
can
use
this
program,
which
is
written
in
the
C
programming
language,
on
any
computer
able
to
run
a
C
compiler.
The
LABEL
program
creates
a
file
named
label.hex
after
you
enter
the
labeling
information.
You
can
compile
the
source
for
this
program,
included
in
this
chapter,
using
any
C
compiler.
A
typical
Hex
Label
Format
file
used
for
downloading
labeling
and
device
information
to
the
2500
is
shown
below:
The
elements
of
this
file
are
one
Q0
record,
one
QI
record
defining
the
labeling
information
“LABEL,”
CR,
“TEXT,”
CR
a
Q2
record
defining
the
device
type,
a
Q6
record
defining
print
density
information,
a
Q7
record
defining
pin
1
orientation,
and
one
Q9
record.
One
Q0
record
comprised
of
the
following
character
pairs:
Label
record
type
—
Q0
indicates
a
header
record.
Record
length
—
Indicates
that
1
hex
byte
follows
in
the
record.
Checksum.
The
QI
record
consists
of
the
following
components:
E-14
ProMaster
2500
User
Manual

Q1
0C
4C
41
42
45
4C
0D
54
45
58
54
0D
34
Q2
02
01
FC
Q6
02
02
FB
Q7
02
13
EA
Q9
01
Computer
Remote
Control
Label
record
type
—
QI
indicates
a
data
record
containing
labeling
information.
The
ASCII
character
CR
(OD
hex)
forces
a
new
line
(may
contain
up
to
8
lines).
Record
length
—
Indicates
that
12
hex
bytes
follow
in
the
record:
L
A
S
E
R
cr
T
E
X
T
cr
Checksum
The
Q2
record
consists
of
the
following:
Label
record
type
—
Q2
indicates
a
data
record
containing
device
type
information.
Record
length
—
Indicates
that
2
hex
bytes
follow
in
the
record.
Indicates
28
pin
PLCC
device
type
Checksum
The
Q6
record
consists
of
the
following:
Label
record
type
—
Q6
indicates
a
data
record
containing
labeling
information.
Record
length
—
Indicates
that
2
hex
bytes
follow
in
the
record.
Indicates
26
s
CPI
text.
Checksum.
The
Q7
record
consists
of
the
following:
Label
record
type
—
Q7
indicates
a
data
record
containing
pin
1
orientation
data.
Record
length
—
Indicates
that
2
hex
bytes
follow
in
the
record.
Indicates
the
following:
Parts
exiting
the
input
tube
are
pin
1
=
3.
Label
orientation
with
respect
to
pin
1
=
0.
Parts
entering
receiving
tube
are
pin
1
=
1.
Checksum.
The
Q9
record
consists
of
the
following:
Label
record
type
—
Q9
indicates
a
termination
record.
Record
length
—
Indicates
that
1
hex
byte
follows
in
the
record,
representing
1
byte
of
binary
data,
follows.
ProMaster
2500
User
Manual
E-15

#include <stdio.h> /* include standard IO file */
FILE *fp; /* declare file pointer */
char lb[] = /* initialize input buffer */
" ";
.()
{
int i = 0; /* index variable */
char l, c, d, chksum; /* work and checksum variables */
fp = fopen("LABEL.HEX","w"); /* open output file */
fputs("Q001FE\n",fp); /* write header record to file */
fputs("Q20201FC\n",fp); /* write part type record to file*/
/* select 28 pin PLCC */
fputs("Q7020EEF",fp); /* write rotation record to file */
/* get label information */
l = 1; /* init length */
fputc('\n',stdout);
for (d = 0; d 4; d++){
fputs("Enter label line ",stdout);
fputc(d+49,stdout);
fputs(": ",stdout);
while ((c = getchar()) != '\n'){
lb[i++] = c; /* store character in buffer */
++l; /* inc length counter */
}
lb[i++] = 13; /* write a cr to delimit each line */
++l;
}
fputs("\nQ1",fp); /* write data record */
cput(l); /* write length */
for (i=0,chksum=l; i1; ++i){ /* write re.der data record */
cput(lb[i]); /* write character */
chksum += lb[i]; /* update checksum */
}
cput(~chksum); /* write checksum */
fputs("\nQ901FE\n",fp); /* write termination record */
fclose(fp); /* close output file */
} /* exit */
cput(a) /* write byte in ASCII format */
char a; /* input parameter */
{
char c; /* temporary character variable */
c = ((a > 4) & 15)+48; /* convert left nibble */
if (c 57) c += 7;
fputc(c,fp); /* write character */
c = (a & 15)+48; /* convert right nibble */
if (c 57) c += 7;
fputc(c,fp); /* write character */
} /* return to caller */
Computer
Remote
Control
Source
Code
of
LABEL.
C
Program
*
LABEL.
C
-
Create
Hex
Label
Format
containing
label
info
*
*
*
*
This
program
is
written
using
only
standard
C
file
functions
*
*
and
can
be
compiled
with
any
C
compiler.
*
E-16
ProMaster
2500
User
Manual