Copyright This manual is copyrighted with all rights reserved. No portion of this manual may be copied or reproduced by any means without the prior written consent of Brady Worldwide, Inc. While every precaution has been taken in the preparation of this document, Brady assumes no liability to any party for any loss or damage caused by errors or omissions or by statements resulting from negligence, accident, or any other cause.
Table of Contents Introduction................................................................................................................. 1 Scope ....................................................................................................................... 1 Programming Overview .............................................................................................. 2 Basic print language overview ................................................................................
Label Format Field Replacement (STX U) ........................................................... 24 Send ASCII Touch Cell Data (STX V) ................................................................. 25 Printer’s Firmware Version Information (STX v) ................................................. 25 Request Memory Information (STX W) ............................................................... 25 Delete File (STX x) ....................................................................................
Introduction Scope The TLS PC LinkTM Programmer’s Guide is intended for technical personnel who have basic programming knowledge and intend to create their own programs to send controls down to the printer for printing labels (design their own labelcreation software). A programming language allows the printer to be integrated with a piece of equipment such as a portable data terminal (PDT), scanner, wire tester, electrical meter, or medical device.
Programming Overview Basic print language overview The TLS PC Link Printer control language is based on Datamax DPL, revision D2. The print language can be implemented as completely 7-bit ASCII characters. The ASCII table is shown in Appendix C: ASCII Control Chart. All commands and responses are sent as printable ASCII characters with a few exceptions: 1. Some control codes (non-printable ASCII characters) are sent to inform the printer that a command is to be received or terminated.
Command Type Description configuration and image downloading. Label-Formatting Commands Used to control the position of text and images. The label format termination commands can selectively store and print the label and end the formatting process. Control Codes Control codes are used to inform the printer that a command is to be received or terminated.
with a feedback character denoting success or an error. Feedback characters are defined in Appendix A. Each command lists the possible feedback characters. Immediate Commands never send these feedback characters. They will send a response if the Immediate Command requires one, such as Read Status String. Generating and Printing a Label With the TLS PC Link Programming Language The printer is capable of storing only one label format at a time. A label format specifies what is to be placed on the label.
Determining Printer Status There are two methods to determine the printer status: ! Feedback Characters ! Immediate Command to Request Status If feedback characters are used, a response is given after each System Level or Label Formatting Command is completed. If an error occurs on a command, it is known immediately by the response. When a print command is sent, a print complete character is sent by the printer when the print is done.
COM Port Settings In order to establish communication between the TLS PC Link printer and your PC, you must have the correct COM port settings: 6 Setting BPS Value 9600 Data Bits Parity Stop Bits 8 None 1 Flow Control Hardware TLS PC LinkTM Programmer’s Guide
Immediate Commands When the printer receives an immediate command it will stop whatever it is doing and perform that command. After the command is complete, the printer will resume the operation it interrupted. Immediate commands are turned off on power up, and can be turned on with the System-Level Command “Enable SOH Commands (STX H)”. When Immediate Commands are enabled, they may be issued at any time.
Printer Response: Version 01.01 12/21/00 The printer always sends out the Version on power up. Send ASCII Status String (SOH A) This command allows the host computer to check the printer for its current status. The printer returns a string of eight characters to the host computer, followed by a carriage return. Each character is either Y or N indicating whether the associated condition is true or false (Y = true). Byte 1 is the first character transmitted by the printer.
Toggle Pause (SOH B) This command toggles the printer’s paused state between on and off. Sample: B This command will illuminate the pause/stop light and suspend printing. Printing will not be suspended in the middle of a label. If a label is being printed, the printer will finish the label and then pause. Printing will resume when the SOH B command is sent to the printer again.
Cancel (SOH C) The stop/cancel function will immediately stop the printer and cancel the current print job. If currently in the middle of printing a label, it will stop printing and feed the label to the cut position. Sample: C Disable SOH (SOH D) This command causes the printer to ignore immediate commands (^A). The SOH shutdown command must be sent before loading graphic images that are sent using 8-bit data.
System-Level Commands The most commonly used commands are the system-level commands. These commands are used to load and store graphic information and to control the printer. System-level commands may be used before or after immediate commands but cannot be issued among label-formatting commands. System-level commands can be used to override default parameter values. System commands consist of: 1. Attention Character 2. Command Character 3. Parameters (if any).
System Level Command Page Set Printer to Inches (STX n) 19 Set Start of Print Offset (STX O) 19 Horizontal Alignment Offset (STX o) 20 Clear All Memory (STX Q) 20 Printhead Dot Pattern Test Label (STX T) 21 Send Binary Touch Cell Data (STX t) 22 Label Format Field Replacement (STX U) 24 Send ASCII Touch Cell Data (STX V) 25 Printer’s Firmware Version Information (STX v) 25 Request Memory Information (STX W) 25 Delete File (STX x) 26 Pack Memory (STX z) 26 Disable Feedback Character
Enter Heat Setting Offset (STX b) This command changes the "on time" of dots on the printhead. The printer powers up with a default setting determined from the media type installed. Varying this number changes the amount of time the dots are "turned on" which in turn changes the amount of heat transferred from the printhead to the media. The range of valid settings is -5 to +5 that corresponds to an offset of +/- 500 microseconds.
Enable Feeding to Cut Position after Print and Perform a Feed to Cut (STX c) This command will feed the printer to the cut position. It will also enable feeding to the cut position after all future print commands. It is to be used in conjunction with STX C. c Feedback possibilities (only sent if feedback characters are turned on): 1,2,6,7,8,A,B,E,F,J Set Quantity for Stored Label (STX E) This command sets the number of labels to print for the label format currently stored in the print buffer.
Form Feed (STX F) This command feeds one label to the top of form. Sample: F Feedback possibilities: 0,1,2,6,7,8,A,B,E,F Set Form Stop Position (STX f) This command is used to adjust the cutter stop position. When a label is printed, the printer will feed the label to the cut position. This command adjusts the stop position to allow for desired cutting alignment. When the next label format is sent to the printer, it will automatically backfeed to the start-of-print position.
Print Last Label Format (STX G) This command prints a previously formatted label. This command is used when there is a label format in the buffer. The STX E command is used to enter the quantity. (If the STX E command is not used only one label will print.) Sample: G Feedback possibilities: 1,2,6,7,8,A,B,C,D,E,F,G,H Enable SOH Commands (STX H) This command is used to enable Immediate Commands on power-up or to reenable them if they have been turned off for downloading image data.
Input Image Data (STX I) This command precedes the download of image data from the host to the printer. The data that immediately follows the command string will be image data. If Immediate Commands have been enabled and if any of the 8-bit input formats are to be used, it is necessary to disable the immediate level command interpreter by executing a SOH D command before issuing this command. To print an image, select font type Y, (see ‘Generating Label Formats’).
Sample: D IBpTest data...data H The above sample instructs the printer to receive an 8-bit .PCX image sent by 8bit data, named ‘Test’. It disables immediate commands first, then re-enables them after. Feedback possibilities: 0,1,2,3,4 Extended System Commands (STX K) This command allows for expansion of the DPL-system commands. Enter Label Formatting Command (STX L) This command switches the printer to the label-formatting command input mode.
Set Printer to Inches (STX n) This command sets the printer to interpret measurements in inches in terms of in./100, (e.g., M0500 will be interpreted as 5.00in.). See STX m. Sample: n Default setting: Inches Feedback possibilities: 0,1,2 Set Start of Print Offset (STX O) This command sets the point where printing starts, relative to the top-of-form position. Top-of-form is the point where a label edge is detected by the label edge sensor.
Horizontal Alignment Offset (STX o) This command sets the point where printing starts relative to the left edge of the label. This is an offset value from the default position. osnn Where: s- sign of offset, ‘+’ or ‘-’ nn- two digit value of offset The valid range is -05 to +99. Feedback possibilities: 0,1,2 Set Continuous Label Length (STX P) This command will set the label length for continuous material. The label length can be set from 0.00 inches to 6.00 inches (0.0mm to 152.4mm).
This sample creates a label format with “TEST1” placed at the upper left corner of the label, and “TEST2” placed 1” below this. The first P sets the paper length to 1”. Thus, the following G will print this label only 1” long and only “TEST1” will be printed. The second P command sets the paper length to 0”, thus putting it in banner mode. The following G command will print both text strings and stop printing immediately after “TEST2”.
G This example will print 3 serialized labels: “TEST01”, “TEST02”, and “TEST03”. The label length is 0.5” and the spacing between labels is set to zero. Feedback Possibilities: 0,1,2 Printhead Dot Pattern Test Label (STX T) This command instructs the printer to print a dot pattern test label. To view the full test pattern use the media as wide as the print width and at least 1.5-in. (38.1mm) long. Sending this command will clear the current label format that is stored.
the following: Byte 2,3: 0x0078 means there are 0x78 or 120 labels remaining.
Label Format Field Replacement (STX U) This command places new label data into format fields. Format fields are used to build a label. The new data string must equal the original string length and contain valid data. To easily keep track of fields put all of the fields to be updated with the command at the beginning of the label format. A maximum of 99 format fields can be updated. Fields are numbered consecutively 01 to 99 in the order in which they are received. Unnss..
Send ASCII Touch Cell Data (STX V) This command causes the printer to send back the touch cell data from the media in a user-readable 7-bit ASCII Hex format. For interpretation of this data, see t. Sample: V Response: 01007800001B00000000012B012B11C63200020001010000029400000000 00F1 This sample reads the same data as the sample in t. Feedback Possibilities: 0,1,2,E Printer’s Firmware Version Information (STX v) This command causes the printer to respond by sending a version string.
LOGO2 MEM 8C30 This shows that there are two images stored called “LOGO1” and “LOGO2”. The remaining memory is in hex. There are 0x8C30 bytes remaining (35,888 decimal). Notes on Image Storage: Image Files are not stored directly. Excess header information is removed. Following are typical storage sizes for each file type: File Type B,b: BMP Files are stored with a reduced header size. Typical size = BMP File size 45 bytes. File Type P,p: PCX Files are stored with a reduced header size.
Pack Memory (STX z) This command causes the printer to reclaim all storage space associated with all deleted files.
Extended-System Commands K Command Character Command None Implemented 28 TLS PC LinkTM Programmer’s Guide
Label-Formatting Commands An L command switches the printer from the system level to the labelformatting command processor. All commands after L are interpreted as label-formatting commands. These commands define the format of the label to be printed.
Set Format Attribute (A) This command specifies the type of format operation and remains in effect until another format command is specified or another label format has begun (L). Each label format defaults to attribute 1 - XOR. An Where: n- is either a 1, 2, 3 or 5 1 = XOR Mode: This is the default mode regions, where text strings, images, or barcodes intersect will not be printed, (an odd number of overlapping objects will print).
Set Column Offset Amount (C) This command allows horizontal adjustment of the point where printing begins. This is a left margin The ‘C’ command instructs the printer to print label formats nnnn units to the right of the position that the format specifies. Cnnnn Where: nnnn- is a four-digit number for the column offset, in/100 or mm/10— the printer default is 0 for offset. Sample: L C0050 190000901000100PCLINK The above sample will shift all format data .
nnnn increments above the position the format specifies. Valid input values are numbers between 0000 and 9999, (refer to the C, Set Column Offset Amount Command.) Rnnnn Where: nnnn = is a four-digit offset 0000-9999, in/100 or mm/10 Sample: L R0037 190000901000100SAMPLE LABEL E The above sample sets the printer's offset row amount to 37 hundredths of an inch, unless the printer is in metric mode.
+ (-) Make Last Field Entered Increment (Decrement) Numeric The printer is capable of automatically incrementing and decrementing fields on each label of a batch printed. This command is useful for serializing labels.
> (<) Make Last Field Entered Increment (Decrement) AlphaNumeric The printer is capable of automatically incrementing and decrementing fields on each label of a batch printed. This command will increment or decrement an alphanumeric field. This command is useful for serializing labels.
Set Count By Amount (^) An application using incrementing or deincrementing fields (+, -, >, <) will occasionally require that more than one label be printed with the same values before the field data is updated. This situation is handled with the ^nn command. All printers default to 1. This command is set once for the whole label format and affects all serialized fields in that label format.
Generating Label Formats Example 1 Example 2 A label format is all the data, in the form of records, that lies between an L and either a terminating E or X. Other system level commands may procede the L command for printer setup. A record is a data string that contains the information to be printed on the labels. Every record must end with a termination character (a carriage return ). A record is made of three parts.
The structure of a record The 15-byte header portion of a record is composed as follows: a b c d eee ffff gggg a b c d eee ffff gggg = rotation* 1 = 0° 2 = 90° 3 = 180° 4 = 270° *Rotation is only supported for fonts and barcodes. Images cannot be rotated.
Examples of a Label Format: Example 1 (1.5” x 1.5” Label, PTL-32): Note: The bitmaps shown are not supplied. For reference to insert your own bitmaps, the brady.bmp file is 168 pixels x 142 pixels. The logo.bmp bitmap is 139 pixels x 124 pixels. STX>Q ;clear image memory n ;put printer in inches mode IBBbrady ;Store brady.bmp file IBBlogo ;Store logo.bmp file L ;enter label format mode 1Y0000000250000brady ;specify brady image at X=0.00”,Y=0.
Method 1 (New label format): L ;enter label format mode 1Y0000000250000brady ;specify brady image at X=0.00”,Y=0.25” 1Y0000000100082logo ;specify logo image at X=0.82”,Y=0.10” 190000600700005PART NUMBER: ;specify text at X=0.05”,Y=0.70” 190000600950005DESCRIPTION: ;specify text at X=0.05”,Y=0.95” 190000601200005QUANTITY: ;specify text at X=0.05”,Y=1.20” 19000060070010056789 ;specify text at X=1.00”,Y=0.70” 190000600950100LABEL ;specify text at X=1.00”,Y=0.
Example 2 (1.9” x 4.0” Label, PTL-38): 40 n ;put printer in inches mode L ;enter label format mode 490000803000030Sample Rotated Label ;specify text at X=0.30”,Y=3.00” 490000603500090270 Degree ;specify text at X=0.90”,Y=3.50” 490000601100090Rotate ;specify text at X=0.90”,Y=1.10” 4a000500255008012345678 ;specify barcode at X=0.80”,Y=2.55” 49000060225013512345678 ;specify text at X=1.35”,Y=2.
Q0002 ;set print quantity to 2 labels G ;print two identical labels Serialize Barcode: This requires sending the label format again. Since Bar Code “12345678” and Text “12345678” are separate fields, they must both be serialized in order for the text to match the bar code. L ;enter label format mode 490000803000030Sample Rotated Label ;specify text at X=0.30”,Y=3.00” 490000603500090270 Degree ;specify text at X=0.90”,Y=3.50” 490000601100090Rotate ;specify text at X=0.
Example 3 (0.24” continuous terminal block material, PTLTB-400240): To print a terminal block label, it is necessary to set the label size and spacing. In order to obtain this spacing, the printer must not be fed to the cut position between terminal block positions on the label. The C command is used to disable this function. This example is for a terminal block with a 0.5” pitch.
G ;print 3 copies of this label c ;feed to cut position TLS PC LinkTM Programmer’s Guide 43
Troubleshooting Common Problems and Corrective Action The best method for troubleshooting development with the TLS PC Link Programming Language is to use feedback characters. When these are enabled, all System Level and Label Formatting Commands have a feedback character sent after them. Looking at these feedback characters is very helpful in determining where an error has occurred. If a command’s response is an ASCII ‘2’, this means that a bad command was sent.
Problem Possible Cause/Corrective Action be processed until the print job is complete. Corrective Action: When disabling and enabling immediate commands, it is best to use feedback characters. With feedback characters enabled, wait until an Immediate Commands Enabled response is sent by the printer before sending an immediate command. If it is not desired to have feedback from all commands, it is possible to enable and disable feedback characters around the command you desire a response from.
Problem Possible Cause/Corrective Action Corrective Action: Use hardware flow control. When the serial buffer fills up, the printer will stop the host from sending more data. It will re-enable the serial flow when it catches up. 46 Unable to store an image even though there is enough memory available. Possible Cause: If trying to store an image that already exists, the printer will only overwrite that image if it is the only image that exists.
Appendix A: Feedback Characters Definition No error Serial timeout error Command error Memory full error Image already exists so it was not stored Immediate commands enabled Out of labels Printhead open Out of ribbon Battery cell is shorted Low battery Printing is complete Did not print because no label format has been given Error reading memory touch cell on media Media has changed Printhead is too hot Error Building Label Field Error Feed to cut complete Hex Value 0x30 0x31 0x32 0x33 0x34 Decimal 48 49
Appendix B: Image File Definitions Image Type U: Record Types: Dot-Row Record This record defines the pixel data for one dot-row. After each Dot-Row record, the Y cursor is incremented so that the next Dot-Row is on the next line. 0x80 ndd...d where: n number of data bytes dd...d dd...d data Repeat Record This record will repeat the last Dot-Row Record sent. 0x00 0x00 0xFF n where: n number of duplicates X Cursor Record This record will place the X cursor at an absolute location.
sent first Terminator This record must be at the end of the file. 0xFF 0xFF Data Format This image file can be sent as 8-bit data or 7-bit ASCII Hex. The 7-bit version sends the same data as the 8-bit version, but each byte is sent as two ASCII Hex characters. Example: A 50-pixel by 50-pixel box located 10 pixels down and 10 pixels to the right of the origin. Note that the X-Cursor is set to pixel 8, and the data starts with the first two bits equal to zero so the box starts at column 10.
50 80073FFFFFFFFFFFF0 First line of box 800720000000000010 Second line of box 0000FF2F Repeat second line 47 times 80073FFFFFFFFFFFF0 Last line of box FFFF 0x0D Terminator TLS PC LinkTM Programmer’s Guide
Appendix C: ASCII Control Chart ASCII Control Chart (Continued on next page.
ASCII Control Chart, Continued 52 TLS PC LinkTM Programmer’s Guide
Appendix D: List of Commands The following table lists all of the commands found in the guide, along with their description. Refer to the page number listed to the right for detailed information on each command.
Description Command Page Horizontal Alignment Offset STX o 20 Clear All Memory STX Q 20 Printhead Dot Pattern Test Label STX T 21 Send Binary Touch Cell Data STX t 22 Label Format Field Replacement STX U 24 Send ASCII Touch Cell Data STX V 25 Printer’s Firmware Version Information STX v 25 Request Memory Information STX W 25 Delete File STX x 26 Pack Memory STX z 26 Sets format attribute A 30 Sets column offset amount C 31 Terminates label formatting mode and print lab
Appendix E: Fonts TM TLS PC Link Printer Fonts The following fonts are available on the TLS PC Link printer: FONT POINT NUMBER SIZE PRINT SAMPLE BRADY 12345 1 4 2 5 3 6 BRADY 12345 4 7 BRADY 12345 5 9 BRADY 12345 6 10 BRADY 12345 7 11 BRADY 12345 8 13 BRADY 12345 9 14 BRADY 12345 10 17 BRADY 12345 11 20 BRADY 12345 12 23 BRADY 12345 13 26 BRADY 12345 14 28 BRADY 12345 15 36 BRADY 123 BRADY 12345 TLS PC LinkTM Programmer’s Guide 55
56 FONT POINT NUMBER SIZE PRINT SAMPLE 16 45 BRADY 1 17 51 BRADY 18 56 BRADY 19 72 BRAD TLS PC LinkTM Programmer’s Guide
Font Symbol Set The following characters are supported in all fonts. 0 1 2 3 4 5 6 7 8 9 A B C D E F ! “ # $ % & ‘ ( ) * + , - .
Appendix F: Barcodes Summary Font Type Length Checksum Valid ASCII Characters, decimal value a Code 39 Varies No 32,36,37,42, 43,45-57, 65-90 b Code 39 with check character Varies Yes 32,36,37,42, 43,45-57, 65-90 c Code 128 Varies Yes 32-127 58 TLS PC LinkTM Programmer’s Guide
Appendix G: Mini-DIN 6-Pin to 9-Pin Cable Pinouts Mini-DIN-6S Connector to Printer DB-9S Connector to PC RXD 1 No Connection 1 CTS 2 +5V 3 GND 4 4 TXD 5 5 RTS 6 6 2 No Connection 3 7 8 No Connection SHELL 9 SHELL