Brother Brolib Instruction Manual

Instructions for BROLIB.DLL functions
© 2020 Brother Industries, Ltd. All rights reserved.
Version 02
printer driver is installed on your PC.
1. Int openport(a)
Description: Start the Windows printer spool.
Parameter:
a: String,
(1). Please specified the printer driver name.
Make the printer driver name the same as the name indicated on the
device and printer of the control panel.
Example: Brother TD-4750TN
(2).
For network printer, please specified the UNC path and printer name.
Example: \\server\TD-4750TN
(3). For Centronics interface directly, please specify LPT1 to LPT4.
Example: LPT1
(4). For USB interface directly, please specify USB.
Example: USB
Return value:
1: Success
0: Fail
2. Int closeport()
Description: Close Windows printer spool.
Parameter: None
Return value:
1: Success
0: Fail
1
3. Int setup(a,b,c,d,e,f,g)
Description: Set up label width, label height, print speed, print density,
sensor type, gap/black mark vertical distancegap/black mark
shift distance
Parameter:
a: String, set label width; unit: mm
b: String, set label height; unit: mm
c: String, set print speed, (selectable print speeds vary on different printer
models)
1.0: Set print speed at 1.0"/sec
1.5: Set print speed at 1.5"/sec
2.0: Set print speed at 2.0"/sec
3.0: Set print speed at 3.0"/sec
4.0: Set print speed at 4.0"/sec
6.0: Set print speed at 6.0"/sec
8.0: Set print speed at 8.0"/sec
10.0: Set print speed at 10.0"/sec
d: String, set print density
0~15the greater the number, the darker the printing
e: String, set the sensor type to be used
0: Vertical gap sensor
1: Black mark sensor
f: String, set vertical gap height of the gap/black mark. Unit: mm
g: String, set shift distance of the gap/black mark. Unit: mm.
Return value:
1: Success
0: Fail
4. Int clearbuffer()
Description: Clear image buffer
Parameter: None
Return value:
1: Success
0: Fail
2
5. Int barcode(a,b,c,d,e,f,g,h,I)
Description: Cerate barcode
Parameter:
a: String, the starting point of the bar code along the X direction, given in
points
(203 DPI, 1 mm=8 dots, 300 DPI: 1 mm=12 dots)
b: String, the starting point of the bar code along the Y direction, given in
points
(203 DPI, 1 mm=8 dots, 300 DPI: 1 mm=12 dots)
c: String
Barcode Description
128 Code 128, switching code subset A, B, C automatically
128M Code 128, switching code subset A, B, C manually
EAN128 Code 128, switching code subset A, B, C automatically
25 Interleaved 2 of 5
25C Interleaved 2 of 5 with check digits
39 Code 39
39C Code 39 with check digits
EAN13 EAN13 EAN13+2 EAN 13 with 2 digits add-on EAN13+5 EAN 13 with 5 digits add-on
EAN8 EAN8 EAN8+2 EAN 8 with 2 digits add-on EAN8+5 EAN 8 with 5 digits add-on
CODA Codabar
POST Postnet
UPCA UPC-A UPCA+2 UPCA with 2 digits add-on UPCA+5 UPCA with 5 digits add-on
UPCE UPCE UPCE+2 UPCE with 2 digits add-on UPCE+5 UPCE with 5 digits add-on
d: String, set up bar code height, given in points
e: String, set up whether to print human recognizable interpretation (text)
or not.
0: prints no interpretation
1: prints interpretation
f: String, set up rotation degrees
3
0: rotates 0 degree
90: rotates 90 degrees
180: rotates180 degrees
270: rotates 270 degrees
g: String, sets up narrow bar ratio, refer to BPL programming manual
h: String, sets up narrow bar ratio, refer to BPL programming manual
I: String, bar code content
Return value:
1: Success
0: Fail
4
6. Int printerfont(a,b,c,d,e,f,g)
Description: Use printer built-in fonts to print
Parameter:
a: String; the starting point of text (character string) along the X direction,
given in points (203 DPI, 1 mm=8 dots, 300 DPI: 1 mm=12 dots)
b: String; the starting point of text (character string) along the Y direction,
given in points
(203 DPI, 1 mm=8 dots, 300 DPI: 1 mm=12 dots) c: String; built-in font type name 1: 8*12 dots 2: 12*20 dots 3: 16*24 dots 4: 24*32 dots 5: 32*48 dots
TST24.BF2
1
: Traditional Chinese 24*24 TST16.BF2 1: Traditional Chinese 16*16 TTT24.BF2 1: Traditional Chinese 24*24 (Telecommunication Code) TSS24.BF2 1: Simplified Chinese 24*24 TSS16.BF2 1: Simplified Chinese 16*16 K 1: Japan, Korean font 24*24, L 1: Japan Korean font 16*16
d: String, set the rotation degree of the text (character string)
0: rotates 0 degree 90: rotate 90 degrees 180: rotate 180 degrees 270: rotate 270 degrees
e: String, set the magnification rate of text (character string) along the X
direction, range: 1~8
f: String, set the magnification rate of text (character string) along the Y
direction, range: 1~8
g: String; Print the content of text (character string)
Return value:
1: Success 0: Fail
1
Download and use fonts.
For downloading instructions, refer to "4. File Manager" in the Brother Printer
Management Tool Quick Start Guide.
[File Manager] - [Browse] - [Memory Devices] - [Download]
5
7. Int sendcommand(command)
Description: Send the built-in commands to the bar code printer
Parameter: Refer to BPL for details
Return value:
1: Success
0: Fail
8. Int printlabel(a,b)
Description: Print label content
Parameter:
a: String, set the number of label sets
b: string, set the number of print copies
Return value:
1: Success
0: Fail
9. Int downloadpcx(a,b)
Description: Download mono PCX graphic files and BMP files to the printer
Parameter:
a: string; file name (including file retrieval path)
b: string, names of files that are to be downloaded in the printer memory
(Please use capital letters)
Return value:
1: Success
0: Fail
10. Int formfeed()
Description: Skip to next page (of label); this function is to be used after
setup
Parameter: None
Return value:
1: Success
0: Fail
6
11. Int nobackfeed()
Description: Disable the media back feed to top of form when print the
next media
Parameter: None
Return value:
1: Success
0: Fail
12. Int windowsfont(a,b,c,d,e,f,g,h)
Description: Use Windows font to print text.
Parameter:
a: Integer, the starting point of the text along the X direction, given in
points
b: Integer, the starting point of the text along the Y direction, given in
points
c: Integer, the font height, given in points.
d: Integer, rotation in counter clockwise direction
0 -> 0 degree
90-> 90 degree
180-> 180 degree
270-> 270 degree
e: Integer, font style
0-> Normal
1-> Italic
2-> Bold
3-> Bold and Italic
f: Integer, font with underline
0-> Without underline
1-> With underline
g: String, font type face. Specify the true type font name.
Example: Arial, Times new Roman.
h: String, text to be printed.
Return value:
1: Success
0: Fail
7
13. Void about()
Description: Display the DLL version on the screen.
Parameter: None
Return value: Void
14.
Int rfidWrite(a,b,c,d,e,f)
Description: Write data to memory bank of RFID tag.
Parameter:
a: string; optional parameter to lock the data block to prevent it from
being overwritten.
0: write only
1 to FFFFFFFF in hex
b: string; a letter specifying the representation format of the field data.
A = ASCII
B = Binary
D = decimal
H = Hex
c: string; specifies the number of blocks to read.
0 to FFFF in hex
d: string; wrtie data size from 1 to n in decimal number.
e: string; memory bank
EPC – EPC 12 bytes data area
USR – User 32 bytes area
ACS – 4 bytes access code area
KIL – 4 bytes kill code area
PC – 2 bytes PC code area (Gen 2 tags only)
f: string; data to be written
Return value:
1: Success
0: Fail
*Support Model: TD-4650TNWBR/TD-4750TNWBR
8
15. Int rfidRead(a,b,c,d,e)
Description: Read data of specified memory bank from RFID tag.
The data will be returned after printlabel command is called.
Parameter:
a: string; optional parameter to unlock the data block so it can be
overwritten later.
0: write only
1 to FFFFFFFF in hex
b: string; a letter specifying the representation format of the field data.
A = ASCII
B = Binary
D = decimal
H = Hex
c: string; specifies the number of blocks to read.
0 to FFFF in hex
d: string; read data size from 1 to n in decimal number.
e: string; memory bank
EPC – EPC 12 bytes data area
TID – Tag identification 8 bytes area
USR – User 32 bytes area
ACS – 4 bytes access code area
KIL – 4 bytes kill code area
PC – 2 bytes PC code area (Gen 2 tags only)
Return value:
· 1: Success
· 0: Fail
*Support Model: TD-4650TNWBR/TD-4750TNWBR
16. String rfidGetReadData()
Description: Return the received tag data specified by rfidRead
command. This command needs to be called immediately
after printlabel command.
Parameter: None
*Support Model: TD-4650TNWBR/TD-4750TNWBR
9
Windows SDK Example for Print
BROLIB_DLL.openport("Brother TD-4750TN");
BROLIB_DLL.setup("100", "63.5", "4", "8", "0", "0", "0");
BROLIB_DLL.clearbuffer();
BROLIB_DLL.barcode("100", "100", "128", "100", "1", "0", "2", "2", "Barcode
Test");
BROLIB_DLL.printerfont("100", "250", "3", "0", "1", "1", "Print Font Test");
BROLIB_DLL.windowsfont(100, 300, 24, 0, 0, 0, "ARIAL", "Windows Arial
Font Test");
BROLIB_DLL.downloadpcx("UL.PCX", "UL.PCX");
BROLIB_DLL.sendcommand("PUTPCX 100,400,¥"UL.PCX¥"");
BROLIB_DLL.printlabel("1", "1");
BROLIB_DLL.closeport();
Windows SDK Example for RFID
BROLIB_DLL.openport("Brother TD-4750TN");
BROLIB_DLL.clearbuffer();
BROLIB_DLL.rfidWrite("0", "H", "0", "12", "EPC", "123456789012");
BROLIB_DLL.rfidRead("0", "H", "0", "12", "EPC");
BROLIB_DLL.printlabel("1", "1");
label2.Text = BROLIB_DLL.rfidGetReadData();
BROLIB_DLL.closeport();
10
Loading...