Tcpprotocol
Tcpprotocol
Tcpprotocol
General description:
IP- address:
The standard factory settings for the IP-address, netmask and gateway are the
following: IP: 192.168.0.180 mask: 255.255.255.0 gateway: no defined
Port:
The standard port for the TCP/IP connection is portnumber 3490. This portnumber
is fixed internally and cannot be changed.
1. Connect to laser socket server (TCP/IP, port nr. 3490) until you are
accepted. The server is continously trying to accept incoming clients. Up to 12
clients can be simultanously connected to the server. The next incoming accepted
client would kick out the first connected client (FIFO principle). Usually,
there is only one client connected to the laser.
2. When the server has accepted the incoming client the laser sends immediately
a specific BYTE sequence to the client to indicate which software version is
running on the laser. 6 bytes (10 bytes from version 3.3 on) are sent to the
client. The byte values depend on internal hardware, firmware and software.
Note, that the exact number of bytes initially sent by the laser can change in
newer version of the firmware. However, as TCP/IP is packet orientated, all of
these initial bytes are usually contained in the first received packet.
byte 2-5: 4 digit ASCII number indicating the version nr. of the
firmware
byte 6: 0xFF : in case of a program shutdown (if the firmware does not
run anymore due to corrupted data, programming errors, etc…
the system starts a different server program to indicate that
the firmware is no longer running. In this case the version
number will be 0000. The system must be rebooted to restart
the firmware).
3. Once accepted by the server, the client can send commands to the laser.
A command consists of a specific byte-sequence codifying the command and
necessary parameters. The laser (in case of recognizing the byte sequence as a
valid command) always sends an answer back to the client.
The byte sequence, both command and answer, depends always on the specific
command.
|STX|DATA-BYTECOUNT|CMD-WORD|DATA-DWORDS...|ETX
DATA_BYTECOUNT:
Defines the number of following bytes INCLUDING the CMD_WORD but
EXCLUDING the ETX-byte.
CMD-WORD:
(2 bytes) defines the command.
NOTE: the CMD-WORD is BYTE switched (little endian), that means that
the lower byte is sent before the upper byte !
DATA-DWORDS:
n * (4 bytes) : the DATA DWORDS contain the DATA to be sent,
typically ordered in DWORD blocks (4 byte blocks). The
interpretation of the DWORD blocks depends on the command.
Notes:
b. If the frame data are incomplete the server discards the data after a
minimum time of 10 seconds within the arrival of the next data.
e.g. if you send STX DAT-BYTECOUNT CMD_WORD only, the server is waiting
for more data up to 10 seconds. With the arrival of the next data packet
after 10 seconds, the laser will discard the command.
|STX|0x04|EXTENDED CMD-WORD|DATA-BYTECOUNT-WORD|DATA-BYTES....|ETX
STX: 0x02 (indicates start of a command frame)
EXTENDED CMD-WORD:
(2 bytes) defines the command. In an EXTENDED CMD-WORD the upper
byte is always different from 0x00.
NOTE: the EXTENDED CMD-WORD is BYTE switched (little endian), that
means that the lower byte is sent before the upper byte !
DATA_BYTECOUNT-WORD:
(2 bytes) defines the number of the DATA-BYTES.
NOTE: the DATA_BYECOUNT-WORD is BYTE switched (little endian), that
means that the lower byte is sent before the upper byte !
Note that the number of bytes in a complete frame is limited internally to 2048
including header and trailer bytes.
Examples:
CMD: 0x0070
With this command you will receive the actual status of the laser system.
sequence:
|0x02|0x02|0x70 0x00|0x03|
STATUS DATA BYTES: 48 bytes containing the status. The 48 bytes come in blocks
of 4 bytes that form a DWORD (execept the name-Bytes). All DWORDS are sent in
little endian format (LSByte comes first, MSByte last, also called byte
switched).
13 – 16: (byte-switched)
Bit2: when set, system is waiting for a 'alarm reset' signal (DSP
cards only).
Bit3: when set, system is waiting for an input signal (DSP cards
only)
Bit4: when set, system is waiting for an external motorized axis to
reach a new position.
Bit6...Bit7: reserved
21 – 24: copies (byte switched); the actual number of print copies. This number
is set within the Start Print command and defines the number of prints that the
laser should do until leaving the printing mode. Typically, this value is set to
ZERO, meaning infinitely printing.
25 – 28: (byte-switched)
0x0000: no alarms
0x0C0E: wrong messageport (no file found for the external
message selection)
0x0848: alarms active; some alarms are active (interlock,
shutter,….)
0xFFFF: initialization of the firmware has failed due to some
hardware failure.
WORD1: alarm code (byte switched); codifies the last active alarm. If all
alarms are cleared (no longer active), it codifies the last alarm,
that was active. To check the alarm status of the system, you have
to check the alarm WORD. If the alarm WORD is ZERO, the system is
ready for printing. If any alarm is active (alarm WORD not ZERO),
the system will not be ready for printing and you can get
information of the last active alarm.
(see list of alarmcodes later in this document)
29 – 32: printtime (byte switched); gives the printing time of the last printed
message in milliseconds.
41 – 44: alarm-mask (byte switched). Each bit codes an alarm according to the
following list:
0x00000001 Interlock
0x00000002 OEM-shutter
0x00000004 Overtemperature
0x00000008 Shutter
0x00000010 Laser not ready
0x00000020 X-scanner failure
0x00000040 Y-scanner failure
0x00000080 power failure(D5000 series and FIBER-laser (MO))
0x00000100 Z-scanner failure
0x00000200 Laser not armed
0x00000400 XY outofrange
0x00000800 Q-switch (D-5000 B-series)
0x00001000 triggersignal
0x00002000 file not allowed (wrong version)
0x00004000 overspeed
0x00008000 harddisk full
0x00010000 barcode creation failure
0x00020000 barcode licence failure
0x00040000 barcode library failure
0x00080000 invalid file
0x00100000 database failure
0x00200000 max.-distance alarm
0x00400000 min.-distance alarm
0x00800000 client-timeout (tcpip)
0x01000000 invalid font
0x02000000 belt stopped
0x04000000 empty message
0x08000000 initialization error
0x10000000 memory error
0x20000000 warmup in progress
0x40000000 OEM alarm active
0x80000000 extended alarm active (extended alarm mask of the extended status
codes the extended alarms)
45 – 48: signalstate (byte switched): codes the state of the inputs of the
system when it was triggered for printing (for internal purpose only)
CMD: 0x0170
With this command you will receive the actual status of the laser system.
sequence:
1 – 32: same content as in the Status command, except that all DWORDS according
the above documentation are not byte-switched, i.e. the most significant Byte is
sent first (big endian).
33 – 36: alarm-mask (MSB comes first). See Status command.
37 – 40: signalstate (MSB comes first). See Status command.
41 – 56: name; the actual filename + extension of the message (up to 16 bytes).
57 – 72: eventhandler; the actual filename + extension of the eventhandler-file
(up to 16 bytes).
77 : not used
78 : not used
79-80 : Bit0-Bit9: defines the used tracking distance in dynamic
applications in permille of the available scanfield.
CMD: 0x0090
1. DATA_DWORD: field number of the counter (BYTE switched)
2. DATA-DWORD: high DWORD of the counter value (BYTE switched)
3. DATA-DWORD: low DWORD of the counter value (BYTE switched)
|0x02|0x0E|0x90 0x00|0x03 0x00 0x00 0x00|0x00 0x00 0x00 0x00| 0x07 0x00 0x00
0x00|0x03|
STX|n data-bytes|CMD-word|Fieldnumber-DWORD|ETX
If the sent fieldnumber is invalid (values from 0 - 15) the laser answers with a
Fieldnumber-DWORD value of |0xFF 0xFF 0x00 0x00|.
CMD: 0x0092
sequence:
|STX| DATA-BYTECOUNT|CMD-word|FIELDNUMBER-DWORD|ETX
|0x02|0x0E|0x92 0x00|0x03 0x00 0x00 0x00|0x07 0x00 0x00 0x00| 0x00 0x00 0x00
0x00| 0x03|
CMD: 0x0093
1. DATA_DWORD: field number of the counter (BYTE switched)
2. DATA-DWORD: repeats of the counter (BYTE switched)
3. DATA-DWORD: number of prints of the counter value (BYTE switched)
|0x02|0x0E|0x93 0x00|0x02 0x00 0x00 0x00|0x08 0x00 0x00 0x00| 0x03 0x00 0x00
0x00|0x03|
STX|n data-bytes|CMD-word|Fieldnumber-DWORD|ETX
If the sent fieldnumber is invalid (allowed values from 0 - 15) the laser
answers with a Fieldnumber-DWORD value of |0xFF 0xFF 0x00 0x00|.
Start of printing:
CMD: 0x002D
This command switches the laser into the printing mode and the laser will (if no
alarm occurs) stay in the printing loop until the STOP signal (see later) is
sent. When the laser is in the printing mode it waits, according to the
configuration settings of the system, for photocell or PLC input signal to
activate printing.
sequence:
0xFFFFFFFF: Only applies when the filename is empty and the batch
mode is not active ! In this case, the mode is set to
the default mode and the actual loaded file will not be
reloaded. Thus, the system just switches into the
printing mode without reloading any file.
This option is available from Version 5.6.6 on. It
allows to use the start command without reloading of the
actual selected file.
Note: from firmware 5.0.8 on the filename can be up to 12 bytes long and the
extension can be sent, too (thus up 16 bytes can be sent as the filename). This
is especially important if you want to print xml files. When no extension is
given, the file is assumed to be a msf-file.
If the filename length is not a multiple of 4 you must add ALWAYS a termination
NULL character !
0x02 | 0x16 | 0x2D 0x00 |0x00 0x00 0x00 0x00| 0x00 0x00 0x00 0x00| 0x00 0x00
0x00 0x00| 0x74 0x65 0x73 0x74 0x00 0x00 0x00 0x00| 0x03
0x02 | 0x06 | 0x2D 0x00| DWORD| 0x03|, where DWORD (byte switched !) indicates
the following:
0xx00000C0C: Not OK, file is not valid or not existent. The laser will
not be switched into the printing mode.
0x00000848: Not OK, the file is a valid file, but there are some alarms
active (e.g. shutter closed, interlock open, …).
Stop of printing:
CMD: 0x002E
This command stops the printing mode immediately and interrupts a possible
marking process.
sequence:
|02|02|2E|00|03
|02|02|2E|00|03
Start/stop printsession:
CMD: 0x0080
A 'printsession' prepares the laser for the printing mode. It usually enables the laser for printing,
opens an optional shutter, moves the scanner to the optional “keepwarm” position and sets the
diode current for YAG systems to the minimum powerlevel. If the laser has the autopointer option
activated, this call activates the red pointer.
This call should usually be used before a 'Start' command.
When a printsession is ended the laser controller will be disabled as well as the red pointer.
sequence:
|0x02|0x16|0x80 0x00|DWORD0|DWORD1|DWORD2|DWORD3|DWORD4|0x03|
|02|02|80|00|03
CMD: 0x0057
sequence:
8-bytes filename: without extension and filled up with ZEROs. (see the Note)
0x02 | 0x0A | 0x57 0x00 |0x74 0x65 0x73 0x74 0x00 0x00 0x00 0x00| 0x03
Note: from firmware 5.0.8 on the filename can be up to 12 bytes long and the
extension can be sent, too (thus up 16 bytes can be sent as the filename). This
is especially important if you want to print xml files. When no extension is
given, the file is assumed to be a msf-file.
If the filename length is not a multiple of 4 you must add ALWAYS a termination
NULL character !
Sending a usermessage:
CMD: 0x0141
a) sending
|STX|0x04|0x41 0x01|DATA-BYTECOUNT-WORD|Option-BYTE|FIELDNUMBER-BYTE|ASCII
STRING|ETX|
b) requesting
|STX|0x04|0x41 0x01|DATA-BYTECOUNT-WORD|Option-BYTE|FIELDNUMBER-BYTE|INDEX-WORD|
ETX|
Note that the DATA-BYTECOUNT must be set to 4 !!!
Option-BYTE: 1 byte;
a) Setting a usermessage:
|STX|04|41|01|XXXX|NUMBER-BYTE|BYTE0|BYTE1|….|ETX
|STX|04|41|01|04|00|1. FIELDNUMBER-BYTE|INDEX-WORD|FIFO_ELEMENTS-WORD|
ASCII-STRING|03|
|STX|04|41|01|00|00|03
The dump file “umdump.tmp” is created in the RAM-disk of the laser and can
be retrieved later with the copy command. Once retrieved with the copy
command it will be automatically be removed from the RAM-disk.
Note: a dump file will only be created when the system is not in printing
mode or when there is an alarm active !!! In printing-mode the command is
ignored and a NACK message is sent back.
In case of missing or wrong data the laser responds with a NACK message.
|STX|04|15|00|00|00|03
Note: You can set/request various usermessages at once (within one command) in
the following way.
|STX|04|41|01|XXXX|Option-byte==0x00|1. FIELDNUMBER-BYTE|ASCII-STRING|
0x00|2.FIELDNUMBER-BYTE|ASCII-STRING|0x00|……..|n.FIELDNUMBER-BYTE|ASCII-
STRING|03| where
|STX|04|41|01|XXXX|NUMBER-BYTE|BYTE0|BYTE1|….|ETX where
|STX|04|41|01|XXXX|1. FIELDNUMBER-BYTE|ASCII-STRING|0x00|2.FIELDNUMBER-
BYTE|ASCII-STRING|0x00|……..|n.FIELDNUMBER-BYTE|ASCII-STRING|03| where
Note: Frames are always limited to a length of 2048 including leading and
trailing bytes. Thus, be careful when you send or request multiple usermessage
fields within a single command !
Example:
The text can also be sent as an UTF8 string. The command sequence is the same as
the 0x0141 command.
CMD: 0x0143
|STX|0x04|0x43 0x01|DATA-BYTECOUNT-WORD|Option-BYTE|FIELDNUMBER-BYTE|UTF8
STRING|ETX|
Option-BYTE: 1 byte;
|STX|04|43|01|01|00|NUMBER-BYTE|ETX
NUMBER-BYTE: gives the number of usermessages that were sent with this
command (default: 0x01)
You can enable buffered usermessages for field 0 – 15 (0-35 from version 5.4.9
on). For this purpose you have to enable the buffersize with this command.
Allowed buffersizes range from 0 – 255 (0 – 1000 from version 5.4.9 on). A
buffersize of 0 disables the buffer and the usermessages are used as usual.
Typical buffersizes are 20 – 40.
Once enabled, the fields 0 – 15 (0-35) are used as buffers (FIFO). Each
Usermessage command puts a value into the buffer (FIFO) until the buffer is
full. If the buffer is full, the Usermessage command returns 0 as NUMBER-BYTE,
so you may have to wait until sending more usermessages. Do not send multiple
usermessages within one command for this purpose, if you are not sure that they
fit into the buffer, because otherwise you will not know which element did not
fit into the buffer.
The laser will print from its internal buffer in a FIFO order. Each entry is
printed exactly one-time. The laser does not check if two entries have the same
value or not! Each entry that is printed is removed after printing. If the
buffer is empty and the laser is triggered to print, a “EMPTMESSAGE” alarm is
raised and the laser stops printing. The buffer must have at least one element
to proceed printing. If the laser was not set to autostart-mode the laser needs
a StartPrint command to proceed printing, else a sending of a Usermessage will
fill the empty buffer and printing proceeds.
CMD: 0x0063
sequence:
|02|0A|63|00|DWORD1|DWORD2|03
CMD: 0x0063
sequence:
|02|XX|63|00|DWORD1|DWORD2|DWORD3|03
DWORD3: (optional)
enable (DWORD1=0): number of consecutive fields to be used for
buffering. The default value of fields is 36 (field 0 – 35). If this
value is set to 0, no change of the number of fields is done, if the
buffer has been enabled once (i.e. it will remain at 36 fields).
Changing the number of fields to be used for buffering is available
from firmware 5.5.0 on.
|02|XX|63|00|DWORD1|DWORD2|DWORD3|03
Note: The number of fields reserved for buffered usermessages has increased
during the evolution of the control-program from 4 (version 3.6.2) to 16 (5.3.4)
The format of the pixel-data can be defined in the settings of the bitmap
object. Two formats are allowed:
1-bit per pixel: one byte in the sequence holds 8 pixel data. A set bit means
black color and an unset bit means white color.
8-bit per pixel: one byte holds the greyscale value of 1 pixel.
The pixeldata of an OEM-bitmap are filled from the bottom left of the bitmap to
the upper right, scanning the bitmap from left to right.
No padding,leading or trailing bytes/bits are in the datastring sequence. If the
datastring is longer than the size of the bitmap the remnant bytes/bits are
ignored.
For the '1-bit per pixel' format the order of the bits should be from MSB to
LSB.
If the datastring does not fill the OEM-bitmap, the OEM-bitmap will not change.
CMD: 0x0144
|STX|0x04|0x44 0x01|DATA-BYTECOUNT-WORD|SubCmd-BYTE|FIELD-BYTE|FRAME-BYTE|DATA
STRING|ETX|
Thus, if you need to send less than 2000 data you should set the SubCmd to 0x03.
If you need to send more than 2000 data, you would have to pack them into
frames. Within the first frame you set the subcmd to 0x01. The next frames would
have a subcmd of 0x04 and the last frame would have a subcmd of 0x02.
Note: when the FIFO buffer is enabled, then a new entry will only be written
when bit1 is set !!!
FIELD-BYTE: 1 byte; defines the fieldnumber of the datastring.
|STX|04|44|01|DATA-BYTECOUNT-WORD|FIELD-BYTE|INFO-BYTE|ETX
FIELD-BYTE: gives the fieldnumber of the DATASTRING that was sent with
this command.
INFO-BYTE: 1 byte; a bitmask
0x02: data were set at the index that is the next index to be
printed.
0x04: data were not added because the FIFO buffer is full.
FIELD-BYTE: the fieldnumber of the DATASTRING that was sent with this
command.
FRAME-BYTE: the next framenumber of the DATASTRING in case that more than
2000 data are get. If the framenumber is equal to the requested
framenumber then no more data are within the datastring.
CMD: 0x0064
sequence:
|02|XX|64|00|DWORD1|DWORD2|DWORD3|03
DWORD3: (optional)
defines the field (0,1,2,3,4,5) in case of requesting
(DWORD1=0x00000001) or in case of resetting the FIFO of a field
(DWORD1=0x00000002)
|02|XX|63|00|DWORD1|DWORD2|DWORD3|03
CMD: 0x0038
sequence:
|02|02|38|00|03
|02|1E|38|00|DWORD1|DWORD2|DWORD3|DWORD4|DWORD5|DWORD6|DWORD7|03
CMD: 0x0039
sequence:
|02|1E|39|00|DWORD1|DWORD2|DWORD3|DWORD4|DWORD5|DWORD6|DWORD7|03
|02|06|39|00|ERROR-DWORD|03
NOTE: the interpretation of the year is different when setting or getting the
signal.
Requesting messages inside the laser: (from firmware 4.0.4 on)
CMD: 0x0126
|STX|04|26|01|DATA-BYTECOUNT-WORD|DATA|ETX
DATA: the ASCII names of the requested filetypes and frame separated by
0x0A.
Request sequential numbers/user messages of the actual message: (from firmware 4.0.4 on)
CMD: 0x019D
0x10: request the comment of the n-th usermessage in the actual message
ID-BYTE:
1 byte: number or field to be requested.
For the Objecttype-byte beeing 0x00, 0x04, 0x08 , 0x10 this byte defines the index of the
object within the message to be requested.
Example: (Objecttype byte = 0x00)
Second byte:
0x00 : we request the first sequential number of the actual message.
0x01: we request the second sequential number of the actual message.
n: we request the (n + 1)-th sequential number of the actual message.
The index of the sequential numbers in a message are due to the creation of the message.
That means, that the first sequential number that we have created in the message will have
the index 0, the second one will have the index 1 and so on....
If we request an internal global number or a usermessage, this byte defines the fieldnumber
of the requested internal global number/usermessage.
|STX|04|9D|01|DATA-BYTECOUNT-WORD|ID-WORD|DATA|ETX
Set sequential numbers of the actual message (no global internal counter !) (from firmware 4.0.4 on):
CMD: 0x019E
|STX|0x04|0x9E 0x01|Data-bytecount-WORD|ID-WORD|DATA|ETX|
DATA-BYTECOUNT-WORD: (byte switched) counts the following bytes except
ETX.
Note: when the sequential number object is of “local” type, each time the
message is loaded for printing (e.g. with the startprint command 0x2D) the value
of the counter is reset to the initial value.
|STX|0x02|0x56 0x00|ETX|
Answer:
Note: this command simulates a hardware trigger of the PLC/Photocell input. You
can use it as a software trigger instead of the PLC/Photocell input. The laser
must be set previously into the print modus with the PrintStart command (0x2D,
typically with 0 copies).
|STX|n data-bytes|CMD-word|ETX
|0x02|0x02|0xF0 0x00|0x03|
|STX|n data-bytes|CMD-word|ETX
|0x02|0x02|0xF0 0x00|0x03|
After sending the answer to the client, the laser closes the socket connection
to the client.
To upload a message (msf or xml file) to the laser you should know that only
files with extensions should be sent to the laser. Files without extension are
identified as executables and internally treated different. To avoid overwriting
of important system files, do no send any files without extensions to the laser,
as the integrity of the laser’s filesystem may not be guaranteed.
CMD: 0x0061
FILENAME…: up to 40 bytes specifying the filename under which the data should be
saved inside the laser. The filename should be composed of ASCII characters and
must include an extension ! If the filename length is not a multiple of 4 you
must add a termination NULL character (the byte '\0') !
Answer:
|STX|0x02|0x61 0x00|ETX|
Then you have to send the content of file in frames 2048 databytes to the laser.
No STX and no ETX must be packed into the data. The data frame just contains the
sequential binary data of the file.
Each time the laser has received 2048 bytes it will answer with a
Framecommand:
|STX|0x06|0x81 0x00|FRAME-DWORD|ETX
Where FRAME-DWORD is the byte switched received block number. The first frame
received has the block number “1”, the second frame the block number “2” ,etc..
If an error occures the laser will not respond and you should stop sending
frames and send the final command to obtain the error code.
The last frame is the only frame that may have less than 2048 bytes.
After having sent all frames to the laser and after having received the frame
command for each sent frame from the laser you have to send a final command
to the laser to obtain the error code of the copy command:
Command:
|STX|0x06|0x81 0x00| 0x00 0x00 0x00 0x00|ETX
Answer:
|STX|0x06|0x81 0x00| ERROR_CODE_DWORD|ETX
0: no error
8: file could not be opened for writing into the RAMdisk
16: not temporal file could be created on the harddisk
32: temporal harddisk file could not be renamed to the destination filename
1: no memory available to accept frames,no memory available in RAMdisk or an
internal socket error has occurred during reception of a frame.
2: timeout during reception of a frame (waiting for more than 4 seconds)
CMD: 0x0061
If the filename length is not a multiple of 4 you must add a termination NULL
character (the byte '\0') !
Answer:
|STX|0x06|0x61 0x00|FILE_SIZE_DWORD|ETX|
From now on, you have to request frame by frame of maximum 2048 bytes from the
laser. The first frame has the FRAME-DWORD ”0”, the next “1”, etc…
Framecommand:
|STX|0x06|0x81 0x00|FRAME-DWORD|ETX
Answer:
The laser sends frames of 2048 with the sequential data bytes of the file.
Only the last frame may have less then 2048 bytes.
After having received all <FILE_SIZE_DWORDS> bytes you have to send a final
framecommand to end the command sequence.
The final framecommand:
Delete a file:
Files are deleted always in the RAMdisk as well as in the harddisk. There is no
specific command to delete selectively files only in RAM or harddisk.
CMD: 0x0037
|STX|XX|0x37 0x00|FILENAME-bytes….|ETX|
If the filename length is not a multiple of 4 you must add a termination NULL
character (the byte '\0') !
Answer:
|STX|0x06|0x37 0x00|error-DWORD|ETX|
Error-DWORD: 0x00000000 file was deleted
0x00000001 file not found
Using this command blocks the laser for 100 milliseconds, thus, this command is
just for test purposes and should not be used during marking.
CMD: 0x0072
Answer:
(SM121)
Bit0: photocell
Bit4: interlock
Bit5: PLC start mark
Bit23 – Bit31: external bits at customer connector
(SM120)
Bit8: photocell
Bit13: PLC start mark
Bit14: interlock
Bit16 – Bit21: external bits at customer connector
(SM140)
Bit0: photocell
Bit1: interlock
(SM108)
Bit0: PLC start mark
Bit1: interlock
Bit15: photocell
(SM170/270 DSPCARD)
DWORD4: encoder pulses; usually a value between 0 and 65535, counting always in
positive direction
(SM170/270 DSPCARD)
(SM170/270 DSPCARD)
internal use
Values:
0x000000000 or 0x00000001 (SM121, SM140)
0x000000000 or 0x00000080 (SM120)
0x000000000 or 0x00008000 (SM108)
0x000000000 or 0x00000001 (SM121)
0x000000000 or 0x00000001 (SM117)
(SM170/270 DSPCARD)
internal use
CMD: 0x0076
Answer:
VALUE-DWORD: the scaling factor to be set. The scaling factor is given in [permille] . A
numerical value of 1000 means a scaling factor of 1.000, a value of 500
means a scaling factor of 0.500. Note that the scaling factor applies to the
specified member and the marking result depends on the member that you
change. E.g. a scaling value of 500 applied to the pixel time decreases the
time per pixel of a bitmap (decreases the time of marking), while, applied
to the layer speed, it decreases marking speed (thus increasing the
marking time !).
If the command is a “get” command (SET-DWORD==0x00000001), the
value of VALUE-DWORD is ignored.
With this command you can shift the complete message in x and y in the scanfield. You can specifiy the units that you
wish to use and if the offset should be absolute or relative to a previous offset. You can also decide if the offset should
be automatically resetted after the next print, or if it should remain. The Offset is always applied to the next print and if
you send this command during an actual print, it will be applied in the next print.
CMD: 0x0059
0X00000000:
Ideal coordinates; the scanfield has coordinates ranging from
[0 – 100 000]. For a 100mm x 100mm lens , ideal coordinates
map to 1 micron.
0X00000001:
Coordinates are given in microns.
0x00000002:
Coordinates are given in 1/10 mm.
Answer:
|STX|0x0a|0x59 0x00|DWORD0| DWORD1| ETX|
DWORD0: new absolute X offset value (using the same units as set by the command)
DWORD1: new absolute Y offset value (using the same units as set by the command)
Set a Z-defocus or Z-position value:
With this command you can apply a z-defocus shift to the laser beam, if the system is equipped with a dynamic z-axis.
The sent value can be considered as an absolute value or a relative shift to any previous sent value. To get the actual
absolute z-defocus value, you can simply set a relative shift of 0.
For firmware versions > 5.6.4 (version number > 88) you can also set/get a
global Z-position.
CMD: 0x0066
DWORD0:
absolute (value = 0) or relative offset (value= 1) of the z-defocus
absolute (value = 2) or relative offset (value= 3) of the z-position
0X00000000:
Ideal coordinates; the scanfield has coordinates ranging from
[0 – 100 000]. For a 100mm x 100mm lens , ideal coordinates
map to 1 micron.
0X00000001:
Coordinates are given in microns.
0x00000002:
Coordinates are given in 1/10 mm.
Answer:
DWORD0: new absolute z defocus/position value (using the same units as set by
the command)
Shift and rotate a loaded message:
With this command you can shift the actual loaded message in x and y and rotate it.
CMD: 0x0165
The 'l' and 'o' options are valid only for firmware versions >= 5.3.2 from 15/02/2014 on. If 'l' or 'o'
options are omitted the whole document is shifted/rotated.
The optional <layer name> or <object name> must be utf8-coded strings. If you use only ASCII
charactes for object-names or layer-names, the utf8-coding is the same as ASCII coding. Only one of
the options l=<layer-name> or o=<object-name> is allowed ! If the l=<layer-name> or o=>object-
name> option is not the last token in the TRANSFORMATION-STRING, then it must be separated
from the following token by a SPACE character. Layernames or objectnames must not contain
SPACE characters.
Examples:
shifting in x by +5.5 mm and in y by -3mm would result in:
x=5.5y=-3
shifting in x by +3.8mm and in y by -5.2mm and rotation of 45 degrees around (-70 mm, -50 mm):
x=3.8y=-5.2p=45x0=-70y0=50
Answer:
CMD: 0x0030
|STX|XX|0x30 0x00|SUBCOMMAND-DWORD|FILENAME-bytes….|ETX|
If the filename length is not a multiple of 4 you must add a termination NULL
character (the byte '\0') !
Answer:
Note: If the filename is empty or an invalid filename (not existing file), the eventhandler will be deactivated.
The command itself does not give any feedback if the handler was loaded correctly.
The eventhandler file must reside inside the RAM- or harddisk of the laser. The laser first tries to load the file from the
RAMdisk and in case that this was not successful it tries to load the file from the harddisk.
Launch a protocol command event or get the available protocol command events
CMD: 0x0130
CMD-BYTE:
0x08
Launches the event defined by the DATA bytes (an utf8 string).
Several events can be launched at once if their strings are
separated by a ‘\0’ byte.
0x09
Requests the actually available protocol event-strings. DATA bytes
are ignored.
Answer:
CMD-BYTE:
0x08
One DATA byte is received indicating the number of events being
launched. The laser tests if the sent strings correspond to any
protocol event of the actual eventhandler and sets the DATA byte.
0X09
The DATA bytes are the utf8 strings of the actual protocol events of
the actual eventhandler, separated by a ‘\0’ character.
CMD: 0x0021
VARIABLE-DWORD:
Optional parameter to be set when SUBCOMMAND is 0x8,0x10 or 0x20.
0: printdistance will be set/get
1: internal encoder velocity will be set/get
VALUE-DWORD:
Optional parameter when SUBCOMMAND is 0x10.
The value of the variable when it is set (subcommand = 0x10).
The value must be given in microns.
Answer:
|STX| 0x02|0x15 0x00|ETX| some error in sent command (wrong variable or subcommand)
Turn on/off the red diode pointer (firmware > 5.0.7 required)
CMD: 0x0060
0x00000020 :
Turns on the red pointer with the enclosing rectangle coordinates sent with the
command in DWORD2 – DWORD5. The optional DWORD2 – DWORD5 should
be sent with the command and define the rectangle that the pointer should mark.
0x00000030:
Turns on the red pointer making a cross at the position defined by the configuration
(focal pointer position).
Answer:
|STX|0x06|0x60 0x00|0x15 0x00 0x00 0x00| ETX| command not accepted (busy)
CMD: 0x0060
0x00000000 :
Turns the laser off.
Answer:
|STX|0x06|0x60 0x00|0x15 0x00 0x00 0x00| ETX| command not accepted (busy)
CMD: 0x003A
SUBCOMMAND-DWORD:
0x00000000 : enable standard mode (disabled message table and batchjob)
0x00000001 : enable external messagetable
0x00000004 : enable batch job mode
0x00000002 : request actual mode
Answer:
SUBCOMMAND-DWORD:
0x00000000 : standard mode enabled
0x00000001 : external message table enabled
0x00000004 : batch job mode enabled
Actualize the message table(batch job and/or external message table, version >=5.2.2 required)
Command used to force the laser to read the actual messagetable file
("table.cnf" in laser's harddisk). The messagetable file is an ASCII file with
the entries in the following format:
where <pos> stands for the position (0 - 255) , <repeat prints> stands for the
number of prints of the file in case of the batch job mode, and <name> stands
for the file to be printed (filename with extension (msf or xml)).
The fields must be separated by a single space !
0: 1 moert.xml
5: 1 test.msf
7: 1 testfile.xml
CMD: 0x0079
Answer:
Note: this command does not change the mode (standard, external messagetable or batchjob !)
Store the sent usermessages/global counters in the harddisk (version >=5.2.5 required)
Command used to force the laser to save all actual usermessage fields or global
counters in the harddisk.
Answer:
Command used to get frames with the filenames of file in the RAMdisk with the
supplied extension.
Answer:
Note: to get the first 25 filenames set the frame byte to 0x00, then increment the frame-byte by one and get the next 25
filenames until less than 25 filenames are received within the FILENAMES.
Command used to create a svg-file in the laser's RAMDISK with the actual message
data drawn. (firmware >= 5.2.7 07/02/2013)
DWORD5: optional for version > 5.6.3; you can filter the svg output with this
parameter
0: no filter is applied (same as when FILTER is omitted)
1: the svg output is filtered by the layername defined by DWORD6-
DWORD12
2: the svg output is filtered according the layer’s signalmasks
and the actual signalstate of the laser. Only objcts of layers whose
signalmask settings are such that the layer will be printed are
output into the svg file.
Byte20-Byte48: optional for version > 5.7.3; may define the layername when
DWORD5 is set to 1.
If less than 28 bytes are used then you have to add a termination
character 0x00.
Only objects of the layer defined by the layername will be output
into the svg file.
Answer:
CMD: 0x0042
DWORD1:
0x7FFFFFFF : this will reset the d_counter, s_counter, t_counter to zero
In all other cases the DWORD1 will determine the new value of the d_counter.
Answer:
|STX|0x0E|0x42 0x00| DWORD1 | DWORD2 | DWORD3 |ETX| in case that the sent
DWORD1 was 0x7FFFFFFF. The DWORD1 in the answer is the d_counter before
it was changed with this command. The DWORD2 in the answer is the
s_counter before it was changed with this command. The DWORD3 in the
answer is the t_counter before it was changed with this command.
Get/set the internal barcode license
CMD: 0x0073
DWORD2 – DWORD 9:
the 8-bytes of the supplied license key. Each byte is coded in one DWORD. Thus,
each DWORD has its upper 3-bytes set to 0x00 and lowest byte is set to the
corresponding byte of the license key.
The lower byte is sent first (byte-switched).
DWORD2...DWORD7:
The 6 bytes of the MAC-address of the laser, each byte coded
within a single DWORD (byte-switched).
DWORD 8: should be ignored
Note: the 6-byte MAC address is the code that you have to submit to obtain
a barcode license code.
USB-drive command
CMD: 0x0187
SUBCMD_BYTE:
0x00 : get USB drive status;
DRIVE-BYTE is ignored and no action on the USB-drive is performed.
0x01: store configuration
The sysvars.cnf and the oemvars.cnf are stored in the USB-drive according the
DRIVE-BYTE. The files are store in the ./config directory of the USB-drive. If the
directory does not exist it will be created.
0x02: store messages
All 'msf', 'xml' and 'db' files are stored in the USB-drive according the DRIVE-
BYTE. The files are store in the ./messages directory of the USB-drive. If the
directory does not exist it will be created.
0x03: store fonts
All 'mfs', 'mft', 'unx' and 'unf' files are stored in the USB-drive according the
DRIVE-BYTE. The files are store in the ./fonts directory of the USB-drive. If the
directory does not exist it will be created.
0x04: store truetype fonts
All 'ttf', 'otf', and 'ttc' files are stored in the USB-drive according the DRIVE-BYTE.
The files are store in the ./fonts directory of the USB-drive. If the directory does not
exist it will be created.
0x05: store backup
All files of the laser's harddisk are stored in the USB-drive according the DRIVE-
BYTE. The files are store in the ./backup directory of the USB-drive. If the
directory does not exist it will be created.
0x06: load configuration
The files sysvars.cnf and the oemvars.cnf present in the ./config directory of the
USB-drive according the DRIVE-BYTE are copied to the laser's harddisk.
0x07: load messages
All 'msf', 'xml' and 'db files present in the ./messages directory of the USB-drive
according the DRIVE-BYTE are copied to the laser's harddisk.
0x08: load fonts
All 'mfs', 'mft', 'unx' and 'unf' files present in the ./messages directory of the USB-
drive according the DRIVE-BYTE are copied to the laser's harddisk.
0x09: load truetype fonts
All 'ttf', 'otf', and 'ttc' files present in the ./fonts directory of the USB-drive according
the DRIVE-BYTE are copied to the laser's harddisk.
0x0a: load backup
All files present in the ./backup directory of the USB-drive according the DRIVE-
BYTE are copied to the laser's harddisk.
DRIVE_BYTE:
0xXX: Indicates the USB-drive to read/write (0,1,2). Usually the value is 0x00 as
long as only one USB-drive is connected to the laser (there is only one external
USB-connector available, but internally two more USB-pens could be connected)
Answer:
|STX|0x04|0x87 0x01|Data-bytecount-WORD|BYTE1|BYTE2|BYTE3|BYTE4|BYTE5....|ETX|
All USB-drive commands are queued inside the laser. So you have to send another
USB-drive command with the SUBCMD = 0x00 (status) to see if the USB-process is
still busy or not. Otherwise, turning off the system or removing the USB-pen may
result in a corrupted harddrive or USB-pen.
Command used to get some core parameters of the scanning board, like the CPU
coretemperature, board temperature, humidity, etc...(parameters depend on the
used scanning board).
CMD: 0x009B
|STX|0x02|0x9b 0x00|ETX|
Answer:
Command used to get some system information like available harddisk space.
CMD: 0x009A
|STX|0x02|0x9a 0x00|ETX|
Answer:
Command used to set the signalstate via software instead of using the hardware
IO signalstate. Each time the laser starts to print the signalstate is latched
and can be used to select specific layers to be printable or not printable. The
layers has to be configured correspondingly for this purpose (see GUI help).
With this command you can force the laser to use the sent ‘signalstate’ as its
internal signalstate to determine which layers are printable/not printable.
The hardware signalstate is a 32 bit register with the following meaning:
Thus, with some external IO signals one can control which layer is to be
printed, when the layer’s settings have been adjusted accordingly.
When you send a ‘software-signalstate’ the 32-bit value that is sent will act as
the new signalstate and the hardware signalstate will be disabled.
From version 5.7.1 on, the software-signalstate can use bit0-bit30 although not
all bits correspond to a real IO-signal. Bit31 is reserved for disabling the
signalstate, meaning that when this bit is set to ‘1’ all layers are marked
independently of their signalstate settings.
CMD: 0x009C
|STX|0x0a|0x9c 0x00|DWORD1|DWORD2|ETX|
Answer:
|STX|0x0a|0x9c 0x00|DWORD1|DWORD2|ETX|
CMD: 0x0189
Answer:
SEND BYTE: When set to 1 then the Datastring bytes are sent out via the
RS232 communication port to the internal laser controller. The internal
controller may respond later and update some internal variables that may
be requested with subsequent calls of this command with the CMD byte set
to a value that is not ‘’0x00’ and not ‘0x81’ and the SEND byte set to
‘0’ or to ‘1’ if you want to do another request.
Datastring: Defines an ASCII string that is sent out via RS232. This
string is only used with ‘set’ commands. The ‘request’
commands described in this documentation do not require and
datastring to be sent.
CMD BYTE:
0x00: requests the used internal serial port number that
communicates with the laser controller. The SEND byte should be 0.
Sent datastring should be empty.
For all other CMD bytes the received datastring bytes are as follows:
Notes: Some parameters are not explained in detail here as their usage is out
the scope of this document. The tokens 13,14,15 represent the last values that
have been seen by the controller board. These values are not updated
automatically. If you want to have an actualized value you need to set the CMD
byte to the appropiate value and set the SEND byte to ‘1’, such that the main
contoller requests the parameter internally from the laser controller. You
should then wait at least for about 200 ms until you issue the next command with
a SEND byte set to ‘0’ for reading back the actualized values.
If the SEND byte is set to ‘0’ (no request for updating some variable), then you
can use any command byte except the ‘0x00’ and ‘0x81’ to retrieve the datastring
tokens as decribed above.
MOPA fiber laser command
Command used to get some information from the MOPA fiber laser.
CMD: 0x0188
Answer:
SEND BYTE: When set to 1 then the Datastring bytes are sent out via the
RS232 communication port to the internal laser controller. The internal
controller may respond later and update some internal variables that may
be requested with subsequent calls and the SEND byte set to ‘0’ or to ‘1’
if you want to do another request.
CMD BYTE:
0x00: requests the used internal serial port number that
communicates with the laser controller. The SEND byte should be 0.
Efficiency data: there are 5 values regarding the efficiency that can be
requested. All data are given in seconds.
1. The time interval within which the other values should be sampled.
2. The working time within this interval (actual consumed time).
3. The time that the system was in printing mode within the interval.
4. The time that the system was in alarm mode within the interval.
5. the time that the system was printing within this interval.
When the working time reaches the interval all entries, except the interval,
will be reset to zero and a new cycle starts automatically.
Maintenance data: there are 6 values regarding the maintenance that can be
requested. All data are given in seconds.
All intervals can be set with this command and all consumed times can be reset.
Maintenance data are sampled and stored only when the MAINTENANCE parameter of
the systemvariables is enabled.
With this command you will be informed if maintenance is enabled or not, but you
cannot enable/disable it with this command.
CMD: 0x0089
|STX|XX|0x89 0x09|DWORD0|DWORD1|DWORD2|DWORD3|ETX|
DWORD2: (optional)
Defines which time interval should be set or reset. In case of
efficiency data this parameter will be ignored as there is all
efficiency data share the same interval.
In case of maintenance data this parameter can have a value from 0
to 2.
DWORD3: (optional)
defines the new time interval [in seconds] in case that it will be
set.
Answer:
When too less DWORDs have been sent (depends on the command), the system answers
with returning just one DWORD with a value of 0x00000015 (NACK).
When the received DWORD0 was not set to 0 or 1 or the laser does not support the
request, the laser answers with sending just
|STX|02|0x89 0x00||ETX|
The lasersystem , if present in your network, will respond to the sender with the following data:
“xxx.xxx.xxx.xxx-mmm.mmm.mmm.mmm-ggg.ggg.ggg.ggg-XXXXXX”