Command 51 - MECTEC Printer
Command 51 - MECTEC Printer
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:
1
Principles of operation – command 41 variable data :
• 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 :
Or
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.
Ex (Label-ID no)
0-99999999
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
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)
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”
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.
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:
Printer Answers:
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:
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:
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:
6
Printable control characters :
#041C1E5Q1H780,1^DShampo;3 in 1; 34 cases; Long life; 2010??]
Printer Answers:
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.
• 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
The following table may be of use/interest. It contains the possible 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”.
9
By activating the “Special” control character mode – the control characters are
switched according to the following:
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 !
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>
3. If Accept, send the 1B command (important: before a single PRINT has been
issued):
<STX>01BE1??<CR> or <STX>01BE1Q1??<CR>
4. With the photocell connected to PRINT the printing process can now
commence.
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
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
13
Status Description Type
999 OK Status
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.
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 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:
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:
Printer answers:
[0A41D6]
Label is printed
We now have to watch the Cycle Completed output – or monitor the status
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)
DONE!
16
The checksum calculation (substituting the “??” in the command):
Example.1:
<STX> 0 0C 0 D3 <CR>
Will in Hex-code be sent as: 02H 30H 30H 43H 30H 44H 33H 0DH
To the printer the checksum is sent as the characters "D" and "3" (44H 33H)
Example 2 :
<STX> 0 1B E0 Q1 9A <CR>
Will be sent as: 02H 30H 31H 42H 45H 30H 51H 31H 39H 41H 0DH
To the printer the checksum is sent as the characters "9" and "A" (39H 41H)
17