0% found this document useful (0 votes)
1K views17 pages

Command 51 - MECTEC Printer

This document provides instructions for sending variable data to Mectec printers using Command 41. Command 41 allows labeling systems to easily send new variable data to a printer from a remote system in a single data string. The summary includes: - Command 41 uses a predefined label layout stored on the printer and sends variable data fields to populate that layout. Up to 10 sets of variable data can be queued. - The data string specifies the printer ID, label layout ID, optional print quantity, and includes variable data fields separated by delimiters. - The printer responds with codes to accept the data, reject it due to an error, or provide a status code if rejected. This allows verification that the variable data was correctly

Uploaded by

guisouza170895
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views17 pages

Command 51 - MECTEC Printer

This document provides instructions for sending variable data to Mectec printers using Command 41. Command 41 allows labeling systems to easily send new variable data to a printer from a remote system in a single data string. The summary includes: - Command 41 uses a predefined label layout stored on the printer and sends variable data fields to populate that layout. Up to 10 sets of variable data can be queued. - The data string specifies the printer ID, label layout ID, optional print quantity, and includes variable data fields separated by delimiters. - The printer responds with codes to accept the data, reject it due to an error, or provide a status code if rejected. This allows verification that the variable data was correctly

Uploaded by

guisouza170895
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

EF

Domino Product Group


P&A Products

Subject: Command 41 User Guide Date: 23 Jan 12

SENDING VARIABLE DATA TO MECTEC PRINTER


Introduction:

This document describes how to send variable label and print labels – directly from any
application or system.

To do this you use a command to the printer called command 41, which gives you the
opportunity of easy – and in one single data string / message – send new variable data to the
printer/machine – from a remote system – like PC, PLC, Unix or AS/400 mainframe.

Facts:

Connect to: Domino PCU III/IV Printer Controller

Available ports: 2 x RS232

Networking: Connection to TCP/IP Ethernet Network Optional (Cable or Wi-Fi)


RS485 optional. Up 31 printers can be connected in RS485 Multi
drop network. (2-wire, half duplex)

Com modes: Half duplex (default) or Simplex

Handshake: Hardware, RTS/CTS (recommended – can be disabled)


RTS/CTS must be used when running Simplex

Baud rate: 2 400 -- 115 200 Baud (Default setting is 9 600)

Data bits : 8 (1 stop bit, no parity)

Data: Receive buffer is 64K. Up to 65 792 bytes can be sent/ received in


one transmission

Code page: Transmission / all characters must be transmitted according


to Code page 850. – Also referred to as DOS-OEM character
set. (Windows ANSI character set is NOT correct and
transmitting characters according to that will result in incorrect
data)

1
Principles of operation – command 41 variable data :

• Label layout(s) are made in M –design, design software


• The layout(s) are downloaded from M-Design to the Printer controller (PCU)
• Up to approx 50 different layouts can be stored in the PCU
• The layouts are given a storage number – which can be anything from 1 to 99999999
(up to nine digits)

• You should always try to get as few layouts as possible ! - Better to add more variable
fields – and keep number of layouts down. – Easier to maintain !

• With command 41 you choose which label-ID/layout you want work with
• You send the variable data string – corresponding to the ones specified on the layout
(Important! - The number of “dynamic strings” on the label layout – must be exactly
the same as the number of data strings included in the command!)
• Data not matching the label (too few or too many strings) will be rejected

• Both text and graphics can be variable (for barcodes it is easier to link in a dynamic text
field to the barcode, which will then update for each printout, even thou the barcode
itself is not dynamic)
• If a RFID device is present, the TAG data can be sent in the same command as the
variable information for the label
• If a servo drive is used for height adjustment on pallet applicators for example, the height
can be sent in the same command as the variable information for the label

• There is a possibility of clearing the data buffer for all previous print jobs/data
• Data can be sent “in advance” for labels to be printed – up to ten (10) sets of data /
Command 41 strings can be queued for printing

• You can choose to work with printable (like [ ] # ; ^ ) or non printable (like <STX>,
<CR>, <SOH>) control characters – as headers / separators and terminators in the
command (– see page 12 for more details ) (Non printable is the Default setting)

• Correctly received data in printer buffer – will automatically activate the Data Ready
relay output on the controller I/O Board (unless the label is automatically printed and
there is no queue in the printer)

2
Syntax for sending variable data to machine using cmd 41 :

Non printable control characters (default) :


<STX>041CxExQxHa,bTft<ETB>D1<LF>2<LF>3??<CR>

Or

Printable control characters (activated for desired com-port) :


#041CxExQxHa,bTft^D1;2;3??]

Cx (Clearing of data buffer)


0 = Do not clear (this should be used if queue handling is necessary)
1 = Clear the queue – then place the label in the queue

Even if queue handling is necessary - We would recommend to use the Clear Buffer (C1)
when sending the first label information down for a new product and then no clear (C0) for
the following.

If possible use C1 to avoid sequential errors!

Ex (Label-ID no)
0-99999999

Qx (Quantity to Print, optional parameter. If left out = Q0)


0-999 (0 = Download only, do not print directly. Print is then made with I/O instead)

Ha,b (Height value, optional parameter for applying on different heights / length)
a: 0 – 65535 a value used to describe height/length
b: 0 or 1

0= do not set cycle completed


1= set cycle completed after successful application (recommended)

NOTE: The H parameter is only available from PCUIVB, firmware version 6.XX or later.

Tftttttt (TAG data, optional parameter for units equipped with RFID device)

f One ASCII digit describing the data format for tttttt


0 = Decimal (tttttt is sent as decimal)
1 = Hexadecimal (tttttt is sent as hexadecimal)

tttttt = The number presented in an ASCII string. Depending of f the presentation is


decimal or hexadecimal.

Decimal = a number between 0 and 79228162514264337593543950336


Hexadecimal = 0 – 24 ASCII bytes (0-9 and A-F) that describes the number

<ETB> or “^” (Block separator)

3
D (Start of Data)

<LF> or “;” (Variable data string separator. One between each variable data. Six (6)
strings of variable data = 5 x <LF>)

The above syntax/example shows the command including the variable strings of data –
where the variables are “1” “2” and “3”

?? Substitute for checksum.


To ease up sending commands with variable information the printer allows that the 2
character checksum is substituted with two question marks.
Please look on last page in this document for how to calculate correct checksum.

<CR> or “]” as end character for command.

Answer from machine on command 41:

Non printable control characters:


1) <SOH>0A41D6<CR>
Or
2) <SOH>0Dsss??<CR>
Or
3) <SOH>0E75<CR>

Printable control characters:


1) [0A41D6]
Or
2) [0Dsss??]
Or
3) [0E75]

1) A = Accept
String / Data accepted. If Q>=1 – it will also print immediately (“D6” is the
check sum)

2) D = Reject
Command not successful due to any of the five options specified below
Data will be rejected
No further action

3) E = Error in command
Command did not follow the syntax – or the checksum was invalid

sss = Current status – see the status list for details (Only on “D” answers !)

4
The following D-Status messages can occur :

23: Too many dynamic data strings. More data strings in the command
– than on the layout.
16: Too few dynamic data strings – data missing compared to layout
12: Label-ID / Layout missing / not present in memory
951: Buffer full. The attempt to store more than labels in buffer is rejected
997: Machine reset in progress. Try again in five seconds.

Example of data string for label:

Sample 1:

• Uses machine/printer-ID 0
• Do not clear buffer / Put in queue (C = 0)
• Requests label layout 3 (E = 3)
• Enters the variable data “34” “23 Jan 07” “0374” “11” “16.38” and “605”
• Request a Print of one Copy (Q = 1)

You Send:

Non printable control characters :


<STX>041C0E3Q1<ETB>D34<LF>23 Jan
07<LF>0374<LF>11<LF>16.38<LF>605??<CR>

Printable control characters:


#041C0E3Q1^D34;23 Jan 07;0374;11;16.38;605??]

Printer Answers:

Non printable control characters:


<SOH>0A41D6<CR>

Printable control characters:


[0A41D6]

i.e. Printer no 0 accepts command no 41.

Sample 2: (with TAG data for a unit with RFID device installed)

• Uses machine/printer-ID 0
• Clear buffer / any previous data (C = 1)
• Requests label layout 2 (E = 2)
• Program TAG with decimal value 3322950 (T = 03322950)
• Enters the variable data “Sweden” “Stockholm” “0374” “15” “16.38” and “605”
5
You Send:

Non printable control characters:


<STX>041C1E2T03322950<ETB>DSweden<LF>Stockholm<LF>0374<LF>15<LF>1
6.38<LF>605??<CR>

Printable control characters:


#041C1E2T03322950^DSweden;Stockholm;0374;15;16.38;605??]

In this sample the Q parameter is not present, which means that the “print” must be triggered by a
plc signal (or photocell) OR it can be activated with a separate command.

Printer Answers:

Non printable control characters:


<SOH>0A41D6<CR>

Printable control characters:


[0A41D6]

i.e. Printer no 0 accepts command no 41.

Sample 3: (with Height value for a pallet labeller with servo for height adjustment)

• Uses machine/printer-ID 0
• Clear buffer / any previous data (C = 1)
• Requests label layout 5 (E = 5)
• Place label 780mm above conveyer (H780,1), and give Cycle completed when finished
• Enters the variable data “Shampo” “3 in 1” “34 cases” “Long life” and “2010”
• Request a Print of one Copy (Q = 1)

(The second label is generated by the system automatically if it is a one stop pallet labeller
for labels on adjacent sides. For a two/three stop pallet labeller the second/third print is
preferable generated with a Reprint signal on an input)

You Send:

Non printable control characters:


<STX>041C1E5Q1H780,1<ETB>DShampo<LF>3 in 1<LF>34 cases <LF>Long
life<LF>2010??<CR>

6
Printable control characters :
#041C1E5Q1H780,1^DShampo;3 in 1; 34 cases; Long life; 2010??]

Printer Answers:

Non printable control characters:


<SOH>0A41D6<CR>

Printable control characters:


[0A41D6]

i.e. Printer no 0 accepts command no 41.

Command for PRINTING labels:

Printing a label can be done in different ways :

1) Included in the command / variable data string – as described above. When printer receives
valid string of data – it automatically prints the label

2) Hardware I/O. When printer controller receives I/O Input from PLC “Print” – The label is printed.

Considering print commands vs. Hardware I/O:

• IF a print signal is given by hardware I/O to the machine – when there is no label data
available / buffer is empty – a blank label will be produced.
This can however be avoided if the “print” signal is running through the “Data ready” relay.

• For the “Start Apply” – Normally Hardware I/O is preferred. I/O is given by PLC –
when PLC is sure the product is present in correct position in front of labeller. (The
“automatic” apply mode can cause the piston to move out – when the coil is not in the
correct position)

7
Handle queue at Reset
From PCUIV firmware version 5.16 or higher, it is possible to set the PCU to
either clear the queue when the reset button is used on the front panel or not.

This is done with setting Printer settings / Label configuration / Handle Bitmap
labels on Reset.

With the setting “Keep Unchanged” the queue is kept as it is even if the Reset
button is pressed (normally recommended).

8
USEFUL INFORMATION

ASCII conversion table

The following table may be of use/interest. It contains the possible control characters.

ASCII Hex value Decimal value


<STX> 02 002
<LF> 0A 010
<CR> 0D 013
<ETB> 17 023
<SOH> 01 001
<ETX> 03 003
# 23 035
^ 5E 094
; 3B 059
] 5D 093
[ 5B 091

Alternate control characters:

Some mainframe systems (like IBM 3270 and 5250 environment) have problems
in handling non-printable characters or characters above Hex 127.

Also in many PLC systems – it can be difficult to handle what you normally call
“non printable characters”.

To solve this – and make it easy – you can set the controller (individually – for
each com-port) – to “Special Characters”.

- You then switch from “Std / Non Printable” to “Special / Printable”


character mode – for that specific port (1 – 3)

- NOTE – when using Ethernet connection – this is defined as “Port


number 3” in M -Setup

9
By activating the “Special” control character mode – the control characters are
switched according to the following:

<STX> substituted by # (Hex 23)


<ETB> ^ (Hex 5E)
<LF> ; (Hex 3B)
<CR> ] (Hex 5D)
<SOH> [ (Hex 5B)

Simplex mode:

For applications and/or control systems that can not handle answers/feed-back
from the machine – the controller can be set to simplex mode.

Using simplex means that all available - and above specified – commands still
works/can be used – but that you get never get any response or answer
from the machine.

This would mean that data is more or less sent out into the “open air” – not
knowing if it’s accepted or not – or even if the machine is switched on….!
(There is however the Relay Output “Data Ready” with which you from a PLC
can monitor that data HAS been received)

Considering the above – simplex mode is only used when it’s absolutely
impossible for the master system to receive any data / feed-back !

Batch labelling using commands 41 and 1B:

Command 41 can be used to set up batch labelling; however there is a


complication when triggering prints from a source such as a photocell – during
normal operation only a single PRINT can be made of each label, if any copies of
this label is desired a REPRINT command should be issued.

Hence, if the photocell is connected to the PRINT input on the ACC board the
result will be that only a single label will be printed, after this the label queue will
be empty, and blank labels will be “printed”.

If the photocell is connected to REPRINT instead the newly sent label will never
be fetched from the queue (as a PRINT is required for this), and the previously
printed label (if any) will continue to print.

To overcome this problem command 1B could be used, which will lock the
label to the print memory and making infinite PRINTS possible (until a new label
is sent).

10
1. Send the command 41 string, without a Qq parameter:

<STX>041C1E1<ETB>D...??<CR>

2. Wait for the printer to have replied to the command (A, D or E) –


important: if you continue without, the 1B command will be missed!

3. If Accept, send the 1B command (important: before a single PRINT has been
issued):

<STX>01BE1??<CR> or <STX>01BE1Q1??<CR>

Depending on if you want the command to issue a print or not.

4. With the photocell connected to PRINT the printing process can now
commence.

Using Command 1B in simplex mode:

If the communications port is set to Simplex (se previous page), both commands
can be sent as one string, without waiting for the answer in between:

<STX>041C1E1<ETB>D...??<CR><STX>01BE1??<CR>

11
Overview of Printer Status Codes

Refers to both Printer / Controller and PC Software / DLL

Status Description Type


PRINTER / CONTROLLER CODES :
LABEL related status codes
01 Illegal X-value for string. Warning
(X-value is 0 or is exceeding the current label length)
(Printer will try to use x-value – but string maybe
missing on label)
02 Illegal Y-value for string. Warning
(Y-values exceeds current print width)
(Printer will try to use y-value – but string maybe
missing on label)
11 Try to use storage number for layout that is more than Error
8 digits – or trying to store too many labels in printer
12 Label-ID / Layout missing / not present in memory Error
16 Too few dynamic data strings in command – compared Error
to layout
(on command 41)
(All data is rejected)
23 Too many dynamic data strings in command – Error
compared to layout (on command 41)
(All data is rejected)
Or Mismatch between text label and layout when
downloading from M-Design. – More strings on text
label than in layout

TG300 related status codes


100 Label not found / missing
101 Selected label does not match the TG300 configuration
108 Timeout during download
109 No contact with host network PC

Status codes related to internal errors


600 No contact with cpu3 Error
700 No contact with cpu2 Error

General status messages for printer and applicator :


801 Print head up Error

12
Status Description Type
802 Print head overheated Error
803 Label low Warning
804 Film low Warning
805 No labels Error
806 No ribbon Error

807 5 volt to print head is missing Error


808 24 volt to print head is missing Error
809 36 volt to print head is missing Error
810 Applicator error Error
811 Label control error Error
812 Barcode not readable Error
813
814 The print head is down (film print) Status
815 The print head is up (film print) Status
816 No power to printer Error
817 Door control Error
818 Emergency control error Error
819
820
821 Door control Error Error
822 No Air Pressure Error

950 Print command (1A) rejected because there are no Error


dynamic label data in queue
951 Label / data queue full – new data rejected (data for 10 Error
labels already in queue)
952 Bitmap empty Error
989 PCU in “offline” mode Status
990 Label calculation in progress Status
991 Label printed Status
992 Cylinder out Error
993 Get label in PC Status
994 Application in progress Status
995
996
997 Reset in progress Warning
998 Printing in progress Status

13
Status Description Type
999 OK Status

Notes about Status TYPES :

Status: Current status. Normal operation is possible. No actions has to be taken

Warning: Warning for some kind of problem.


Some kind of action has to be taken – sooner or later – to clear the warning.
The printer can still receive new data – and also print the label

Error: An Error classified status needs some kind of immediate action to be taken.
Either the printer hardware / media must be fixed – or data sent has to be
corrected / retransmitted.

Handle queue at Reset


From PCUIV firmware version 5.16 or higher, it is possible to set the PCU to
either clear the queue when the reset button is used on the front panel or not.

This is done with setting Printer settings / Label configuration / Handle Bitmap
labels on Reset.

With the setting “Keep Unchanged” the queue is kept as it is even if the Reset
button is pressed (normally recommended).

14
Controller print button:

The controller has the button “Print” on the front panel.

The function of the print-button / manual operation can be configured (on the
controller – or from “M -Setup) – to work in the following different modes:

0) If new label information is present – print new label – else print copy of old
label (default setting)
1) Always print new label from buffer. If no new label is present – print blank
label
2) Always print copy of old / latest printed label
3) Disabled – not possible to produce any new print or any copy at all

COMMENTS:

Running Duplex or Simplex communication:

It is strongly recommended to run duplex / bi-directional communication with the


machine and application.

- This because it allows you to :

1) Continuously monitor the status of the machine – running, printing, error and so on
2) Assure that any command or data sent reaches the machine – and is accepted
3) Avoid unnecessary waiting for action to send commands – due to machine in Error
mode or not powered on
4) Secure your application

IF you decide to / must use Simplex mode – we recommend you to start up with the
machine set for Duplex. In this way you can monitor the answers to the data you send out.
(If the application that sends the data is not able to listen to any answer – you can use a
stand-alone PC, a Y-cable, and standard terminal software to listen to data communication /
response!

15
Sample data for complete cycle – using Alternate Control Char:

First we send the Data string:

#041C1E1Q1^D750 IND PUNTED BURGUNDY;05 Oct 06;15588;FR GR;1020


upp;534-9278;05 Oct 99;15:32;AFT;AD 34;201 Pack;497
Kg;41032;06225;1234567890;1224??]

Printer answers:

[0A41D6]

Label is printed

We can now either send an apply command – or set apply A input

We now have to watch the Cycle Completed output – or monitor the status

#000??] to send Status Request

If it is a 2 stop Adjacent Side Pallet labelling application – you can, for the second label, choose
between
a) Send the identical dynamic string of data again
b) set the I/O for Reprint Input on the machine (this is what we recommend)

When it’s completed – the pallet can be moved on!

DONE!

16
The checksum calculation (substituting the “??” in the command):

Example.1:

Command 0C with ID = 0 and NNN = 0

Command syntax: <STX> ID CMD NNN chksum <CR>

<STX> 0 0C 0 D3 <CR>

Will in Hex-code be sent as: 02H 30H 30H 43H 30H 44H 33H 0DH

Checksum calculation: 30H


+30H
+43H
+30H
D3H

Modulo 256 => D3H AND FFH = D3H

To the printer the checksum is sent as the characters "D" and "3" (44H 33H)

Example 2 :

Command 1B with ID = 0, eee = 0 and qqq = 1

Command syntax: <STX> ID CMD Eeee Qeee chksum <CR>

<STX> 0 1B E0 Q1 9A <CR>

Will be sent as: 02H 30H 31H 42H 45H 30H 51H 31H 39H 41H 0DH

Checksum calculation: 30H


+31H
+42H
+45H
+30H
+51H
+31H
19AH

Modulo 256 => 19AH AND FFH = 9AH

To the printer the checksum is sent as the characters "9" and "A" (39H 41H)

17

You might also like