CNI RM85x User manual

RM85x Hand-
held Terminals User
Manual
H5834D0003ING
V. 01
CNI Engineering
Via Carpanelli, 24
40011 Anzola dell’Emilia (Bo) Italy
Tel. +39 051 6508911
Fax +39 051 6508912
www.cnicnc.com
Serial Communication
Protocols
DESCRIPTION
The RM85x family of hand-held terminals communicate with a remote controller over an EIA standard
RS-232 serial row at a baud rate of 57.6, 38.4, 19.2 or 9.6 Kb.
RM85x terminals can use two communication protocols: VT100 and CNI proprietary.

Publication Information
Code Date Approval Author ctg
H5834D0003ING 05-10-2007- - UD CNI D
Update List
Revision Added Deleted Modified
V. 01
CNI Engineering S.r.l.
No part of this manual may be reproduced or transmitted in any form or by any means, electronic or
mechanic, including photocopying, without the express written permission of CNI.

MANUAL ISSUED BY:
Technical Documentation Dept.
CNI Engineering S.r.l.
Via Carpanelli, 24 - 40011 Anzola dell’ Emilia (Bo) Italy
Tel. +39 051 6508911
Fax +39 051 6508912
www.cnicnc.com
Document code:
Document revision:
Document issue:
H5834D0003ING
V. 01
05-10-2007


TABLE OF CONTENTS
05-10-2007 CNI Engineering S.r.l. i
TABLE OF CONTENTS
1 Installation....................................................................................................................................... 1
2 Serial communication...................................................................................................................... 1
2.1 VT100 protocol........................................................................................................................ 1
2.2 CNI proprietary protocol .......................................................................................................... 1
2.2.1 Control characters........................................................................................................... 1
2.2.2 Packet checksum (8 bit CRC)......................................................................................... 2
2.2.3 Packet length................................................................................................................... 2
2.2.4 Node address .................................................................................................................. 2
3 VT100 protocol commands ............................................................................................................. 2
3.1 Cursor control commands ....................................................................................................... 2
3.1.1 Cursor on......................................................................................................................... 3
3.1.2 Cursor off......................................................................................................................... 3
3.1.3 Cursor home (Carriage return)........................................................................................ 3
3.1.4 Cursor down and home................................................................................................... 4
3.1.5 Cursor down with scroll ................................................................................................... 4
3.1.6 Cursor up with scroll........................................................................................................ 4
3.1.7 Cursor down without scroll .............................................................................................. 5
3.1.8 Cursor up without scroll................................................................................................... 5
3.1.9 Cursor right...................................................................................................................... 6
3.1.10 Cursor left........................................................................................................................ 6
3.1.11 Backspace....................................................................................................................... 6
3.1.12 Position cursor................................................................................................................. 7
3.1.13 Tab................................................................................................................................... 7
3.1.14 Save cursor ..................................................................................................................... 7
3.1.15 Restore cursor................................................................................................................. 8
3.2 Editor commands..................................................................................................................... 8
3.2.1 Send characters to terminal ............................................................................................ 8
3.2.2 Scroll area ..................................................................................................................... 10
3.2.3 Clear screen (Form feed) .............................................................................................. 10
3.2.4 Display fixed characters ................................................................................................ 10
3.2.5 Display blinking characters............................................................................................ 11
3.2.6 Reset character blinking................................................................................................ 11
3.2.7 Insert characters............................................................................................................ 11
3.2.8 Insert rows..................................................................................................................... 12
3.3 Character delete commands................................................................................................. 12
3.3.1 Delete n characters ....................................................................................................... 12
3.3.2 Delete to end of row ...................................................................................................... 13
3.3.3 Delete from start of row................................................................................................. 13
3.3.4 Delete row ..................................................................................................................... 13

TABLE OF CONTENTS
05-10-2007 CNI Engineering S.r.l. ii
3.3.5 Delete to end of display .................................................................................................14
3.3.6 Delete from start of display............................................................................................14
3.3.7 Delete all rows ...............................................................................................................14
3.3.8 Delete n rows.................................................................................................................15
3.4 Information request commands.............................................................................................15
3.4.1 Request firmware version..............................................................................................15
3.4.2 Request cursor position.................................................................................................16
3.4.3 Request communication parameters.............................................................................16
3.4.4 Request terminal attributes............................................................................................17
3.5 Terminal status commands....................................................................................................18
3.5.1 Reset terminal................................................................................................................18
3.5.2 Cancel escape sequence ..............................................................................................18
3.5.3 Self test..........................................................................................................................18
3.5.4 Exit VT100 protocol .......................................................................................................19
3.6 I/O commands .......................................................................................................................19
3.6.1 Switch LEDs...................................................................................................................19
3.6.2 Monitor keys...................................................................................................................20
3.6.3 Monitor knob..................................................................................................................21
3.6.4 Monitor overrides...........................................................................................................22
4 CNI proprietary protocol commands..............................................................................................23
4.1.1 Position cursor...............................................................................................................23
4.1.2 Write string.....................................................................................................................24
4.1.3 Delete rows....................................................................................................................25
4.1.4 Scroll..............................................................................................................................26
4.1.5 Read I/O command........................................................................................................27
4.1.6 Read message...............................................................................................................28
4.1.7 Read character ..............................................................................................................29
4.1.8 Read version..................................................................................................................30
4.1.9 Read type.......................................................................................................................31
4.1.10 Change parameter.........................................................................................................32
4.1.11 Read parameter.............................................................................................................33
4.1.12 Restart VT100................................................................................................................34
4.1.13 Save parameters to flash memory.................................................................................35
4.1.14 Read flash memory........................................................................................................35
4.1.15 Sample variable.............................................................................................................36
4.1.16 Sample address.............................................................................................................36
4.1.17 Read samples................................................................................................................37
A Parameters....................................................................................................................................38
B Error messages .............................................................................................................................42
C Status bits......................................................................................................................................43

Installation
05-10-2007 CNI Engineering S.r.l. iii
D Invalid command response ........................................................................................................... 43
E I/O.................................................................................................................................................. 44
E.1 The RM851 hand-held terminal............................................................................................. 44
E.1.1 Numbering of keys......................................................................................................... 44
E.1.2 Numbering of LEDs....................................................................................................... 44
E.1.3 The knob........................................................................................................................ 44
E.2 The RM850 hand held terminal............................................................................................. 45
E.2.1 Numbering of keys......................................................................................................... 45
E.2.2 Numbering of LEDs....................................................................................................... 45
E.2.3 Numbering of overrides................................................................................................. 45
F Calculating the 16 bit CRC............................................................................................................ 46
F.1 MODULE CRC16.H............................................................................................................... 46
F.2 MODULE CRC16.C............................................................................................................... 47

TABLE OF CONTENTS
05-10-2007 CNI Engineering S.r.l. iv

Installation
05-10-2007 CNI Engineering S.r.l. 1
1 Installation
Make the settings specified in the relevant User Manual – Technical Specifications and
Connections to ensure correct installation of the RM85x family of hand-held terminals.
2 Serial communication
The minimum size for a transmitted data packet size is 10 bits. These comprise
1 start bit
8 data bits
1 stop bit
Start Data Stop
0 lsb Msb 1
Packet format is as follows:
1 start bit, 8 data bits, no parity, 1 stop bit
2.1 VT100 protocol
RM85x hand-held terminals support a sub-set of commands from the standard VT100 protocol as well
as customised commands for I/O control.
VT100 protocol includes the necessary XON/XOFF communication control. The terminal has a FIFO
buffer in reception and transmission comprising 64 characters.
If the content of the reception buffer reaches more than 48 characters, the terminal sends an XOFF
character (0x13) to the master to request it to stop transmitting as quickly as possible.
Once an XOFF character has been sent and the reception buffer has dropped below 16 characters
again, the terminal sends an XON character (0x11) to tell the master that it can start transmitting
again.
In the same way the master can also send the terminal an XOFF character when so required by its
own control logic. In this case, the terminal stops transmitting as quickly as possible and waits to
receive an XON character before restarting.
For further details on VT100 protocol, visit the following site: http://vt100.net
2.2 CNI proprietary protocol
2.2.1 Control characters
RM85x hand-held terminals send the remote controller commands and data requests in packets
containing a number of characters. Each packet starts with the STX control character and ends with
the ETX control character.
Packets do not normally contain other STX or ETX characters. If STX, ETX, ESC, XON or XOFF
characters have to be transmitted, these must first be split into two characters according to the
following table.

RM85x Hand-held Terminals User Manual
2CNI Engineering S.r.l. 05-10-2007
Character to transmit Characters transmitted
STX (0x02) ESC (0x1B) 0xFF XOR STX (0xFD)
ETX (0x03) ESC (0x1B) 0xFF XOR ETX (0xFC)
ESC (0x1B) ESC (0x1B) 0xFF XOR ESC (0xE4)
XON (0x11) ESC (0x1B) 0xFF XOR XON (0xEE)
XOFF (0x13) ESC (0x1B) 0xFF XOR XOFF (0xEC)
2.2.2 Packet checksum (8 bit CRC)
Each packet also contains a checksum character (CRC), calculated as follows.
STX Datum1 … DatumN CRC ETX
CRC = 0xFF XOR Datum1 XOR … XOR DatumN
N.B.: CRC is calculated on the basis of the bytes in the packet before control characters
are added. This is because control characters must also mask the CRC.
2.2.3 Packet length
The maximum number of data characters that can be transmitted is 68. This number does not include
the control characters in the packet.
2.2.4 Node address
The second byte of each command identifies the target terminal’s node address, as configured on the
terminal’s DIP-switch. If RM85x hand-held terminals communicate over an RS232 connection, this
address must be set to 0x00 to ensure correct functioning. All the switches on the configuration DIP
must be OFF for this setting.
3 VT100 protocol commands
6 groups of VT100 protocol commands are available:
Cursor control commands
Editor commands
Character delete commands
Information request commands
Terminal status commands
I/O commands
3.1 Cursor control commands
This group of command lets you control the position and the characteristics of the cursor.
Whenever the terminal is switched on or reset, the cursor is set off and is positioned at the first column
of the first row of the display.

VT100 protocol commands
05-10-2007 CNI Engineering S.r.l. 3
3.1.1 Cursor on
This command makes the cursor blink on the display.
Sequence ESC[?25h
Byte Command Response
01 ESC (0x1b)
02 ‘[‘ (0x5b)
03 ‘?’ (0x3f)
04 ‘2’ (0x32)
05 ‘5’ (0x35)
06 ‘h’ (0x68)
3.1.2 Cursor off
This command stops the cursor blinking, leaving it invisible on the display.
Sequence ESC[?25l
Byte Command Response
01 ESC (0x1b)
02 ‘[‘ (0x5b)
03 ‘?’ (0x3f)
04 ‘2’ (0x32)
05 ‘5’ (0x35)
06 ‘l’ (0x6c)
3.1.3 Cursor home (Carriage return)
This command moves the cursor to the first column of the row on which it is currently positioned.
Sequence CR
Byte Command Response
00 CR (0x0d)

RM85x Hand-held Terminals User Manual
4CNI Engineering S.r.l. 05-10-2007
3.1.4 Cursor down and home
The VT,LF,ESC E character sequence moves the cursor to the first column of the next row after the
row on which it is currently positioned.
If the cursor is already on the last row in the scroll area, all displayed rows are moved up.
Sequence VT
Byte Command Response
00 VT (0x0b)
Sequence LF
Byte Command Response
00 LF (0x0a)
Sequence ESC E
Byte Command Response
00 ESC (0x1b)
01 ‘E’ (0x45)
3.1.5 Cursor down with scroll
This command moves the cursor to the next row after the row on which it is currently positioned,
leaving it in the same column. If the cursor is already on the last row in the scroll area, all displayed
rows are moved up.
Sequence ESC D
Byte Command Response
00 ESC (0x1b)
01 ‘D’ (0x45)
3.1.6 Cursor up with scroll
This command moves the cursor to the next row above the row on which it is currently positioned,
leaving it in the same column. If the cursor is already on the first row in the scroll area, all displayed
rows are moved down.
Sequence ESC M
Byte Command Response
00 ESC (0x1b)
01 ‘M’ (0x4d)

VT100 protocol commands
05-10-2007 CNI Engineering S.r.l. 5
3.1.7 Cursor down without scroll
This command moves the cursor down in the same column. The number of rows moved is determined
by the parameter Pn. If Pn is omitted, or if its value is set to 0 or 1, the cursor moves to the next row
after the row on which it is currently positioned. If the value of Pn is set to n, the cursor moves to the
nth row after the row on which it is currently positioned.
If n is greater than the number of rows displayed, the cursor moves to the last row of the display.
Sequence ESC [ Pn B
Example: To move the cursor to the next row after the row on which it is currently positioned (Pn=1).
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘1’ (0x31)
03 ‘B’ (0x42)
3.1.8 Cursor up without scroll
This command moves the cursor up in the same column. The number of rows moved is determined by
the parameter Pn. If Pn is omitted, or if its value is set to 0 or 1, the cursor moves to the next row
above the row on which it is currently positioned. If the value of Pn is set to n, the cursor moves to the
nth row above the row on which it is currently positioned.
If n is greater than the number of rows displayed, the cursor moves to the first row of the display.
Sequence ESC [ Pn A
Example: To move the cursor to the next row above the row on which it is currently positioned (Pn=1).
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘1’ (0x31)
03 ‘A’ (0x41)

RM85x Hand-held Terminals User Manual
6CNI Engineering S.r.l. 05-10-2007
3.1.9 Cursor right
This command moves the cursor to the right along the row on which it is currently positioned. The
number of columns moved is determined by the parameter Pn. If Pn is omitted, or if its value is set to 0
or 1, the cursor moves to the next column to the right. If the value of Pn is set to n, the cursor moves n
columns to the right.
If n is greater than the number of columns between the column in which the cursor is currently
positioned and the right display margin, the cursor moves to the right-most column of the display.
Sequence ESC [ Pn C
Example: To move the cursor 10 columns to the right (Pn=10).
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘1’ (0x31)
03 ‘0’ (0x30)
04 ‘C’ (0x43)
3.1.10 Cursor left
This command moves the cursor to the left along the row on which it is currently positioned. The
number of columns moved is determined by the parameter Pn. If Pn is omitted, or if its value is set to 0
or 1, the cursor moves to the next column to the left. If the value of Pn is set to n, the cursor moves n
columns to the left.
If n is greater than the number of columns between the column in which the cursor is currently
positioned and the left display margin, the cursor moves to the left-most column of the display.
Sequence ESC [ Pn D
Example: To move the cursor 9 columns to the left (Pn=9).
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘9’ (0x39)
03 ‘D’ (0x43)
3.1.11 Backspace
This command moves the cursor one column to the left along the row on which it is currently
positioned. If the command is used when the cursor is already on the first column of the display, the
cursor does not move.
Sequence BS
Byte Command Response
00 BS (0x08)

VT100 protocol commands
05-10-2007 CNI Engineering S.r.l. 7
3.1.12 Position cursor
This command moves the cursor to the position determined by the parameters Pn-r, and Pn-c.Pn-r
determines the row to which the cursor moves while Pn-c determines the column.
If Pn-r is omitted or if its value is set to 0 or 1, the cursor moves to the first row of the display. If Pn-c is
omitted or if its value is set to 0 or 1, the cursor moves to the first column of the display.
Display rows are numbered from 1 to 4 starting from the top, and columns are numbered 1 to 20
starting from the left.
Sequence ESC [ Pn-r ; Pn-c H
Example: To move the cursor to row 2, column 12 (Pn-r=2;Pn-c=12).
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘1’ (0x31)
03 ‘;’ (0x3b)
04 ‘1’ (0x31)
05 ‘3’ (0x33)
06 ‘H’ (0x48)
3.1.13 Tab
This command moves the cursor to the first tab position it meets to the right. The contents of the row
are not changed. The fixed tab positions are: column 9, column 17, and column 20. If the cursor is
already positioned on the last column of the display (column 20), is does not move.
Sequence HT
Byte Command Response
00 HT (0x09)
3.1.14 Save cursor
This command saves the position of the cursor (its row and column) and its attributes (off or on).
Sequence ESC 7
Byte Command Response
00 ESC (0x1b)
01 ‘7’ (0x37)

RM85x Hand-held Terminals User Manual
8CNI Engineering S.r.l. 05-10-2007
3.1.15 Restore cursor
This command restores the position of the cursor (row and column) and its attributes (off or on),
previously saved with the Save cursor command.
Sequence ESC 8
Byte Command Response
00 ESC (0x1b)
01 ‘8’ (0x38)
3.2 Editor commands
This group of commands lets you:
send characters to the terminal
set character blinking parameters
define the scroll area
N.B.: Whenever the terminal is switched on or reset, the characters are displayed fixed (not
blinking) and the scroll area is set to one display.
3.2.1 Send characters to terminal
This command sends the terminal a sequence of characters to be displayed starting from the current
cursor position. For each character received, the cursor moves one column to the right along the row
on which it is currently positioned until it reaches the last column on the display. If the cursor is already
located on the last column of the display, all characters are displayed at that position and the cursor
itself does not move.
Characters are transmitted using standard ASCII code. The terminal displays all characters apart from
those shown in the following table.
Code Description
0x05 version request command
0x07
0x08 backspace
0x09 tab
0x0a cursor down and home
0x0b cursor down and home
0x0c form feed
0x0d carriage return
0x0e
0x0f
0x11 XON
0x13 XOFF
0x18 cancel escape sequence
0x1a cancel escape sequence
0x1b start escape sequence
The characters encoded as 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe and 0xff are customisable.
These characters can be modified by changing the corresponding parameters described in Appendix
A.

VT100 protocol commands
05-10-2007 CNI Engineering S.r.l. 9
Example: To send the string “Rm-851”.
Byte Command Response
00 ‘R’ (0x52)
01 ‘m’ (0x6d)
02 ‘-’ (0x2d)
03 ‘8’ (0x38)
04 ‘5’ (0x35)
05 ‘1’ (0x31)
The figure below shows what characters are available.

RM85x Hand-held Terminals User Manual
10 CNI Engineering S.r.l. 05-10-2007
3.2.2 Scroll area
This command sets the scroll area,. i.e. the area by which the display scrolls at one time. The
parameter Pn-r1 determines the first row of the scroll area and parameter Pn-r2 determines the last
row. If Pn-r1 is set to a value greater than parameter Pn-r2, the entire display scrolls.
This command also moves the cursor to the first column of the first row of the next scroll area.
Sequence ESC [ Pn-r1 ; Pn-r2 r
Example: To set the end of the scroll area between the second and third rows.
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘2’ (0x32)
03 ‘;’ (0x3b)
04 ‘3’ (0x33)
05 ‘r’ (0x72)
3.2.3 Clear screen (Form feed)
This command displays a screen full of blank characters (0x32) and moves the cursor to the first
column of the first row.
Sequence FF
Byte Command Response
00 FF (0x0c)
3.2.4 Display fixed characters
This command sets characters to appear fixed (not blinking).
The terminal displays all characters sent after this command as fixed.
Sequence ESC [ 0 m
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘0’ (0x30)
03 ‘m’ (0x6d)

VT100 protocol commands
05-10-2007 CNI Engineering S.r.l. 11
3.2.5 Display blinking characters
This command sets characters to appear blinking.
The terminal displays all characters sent after this command as blinking.
Sequence ESC [ 5 m
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘5’ (0x35)
03 ‘m’ (0x6d)
3.2.6 Reset character blinking
This command cancels character blinking.
Sequence ESC[25m
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘2’ (0x32)
03 ‘5’ (0x35)
04 ‘m’ (0x6d)
3.2.7 Insert characters
This command inserts the number of blank characters (0x32) determined by the parameter Pn. Blank
characters are inserted starting from the current cursor position.
Characters present to the right of the cursor on the same row are moved to the right by the number of
blank characters inserted. If Pn is omitted or if its value set to 0, just one blank character is inserted.
This command does not change the position of the cursor.
Sequence ESC [ Pn @
Example: To insert 5 blank characters.
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘5’ (0x35)
03 ‘@’ (0x40)

RM85x Hand-held Terminals User Manual
12 CNI Engineering S.r.l. 05-10-2007
3.2.8 Insert rows
This command inserts the number of blank rows determined by the parameter Pn. Blank rows are
inserted starting from the row on which the cursor is currently positioned. All rows beneath the row the
cursor is on are moved down accordingly.
This command does not take the current scroll area setting into account.
If Pn is omitted or if its value is set to 0, just one blank row is inserted.
This command does not change the position of the cursor.
Sequence ESC [ Pn L
Example: To insert 1 row below the row on which the cursor is currently positioned.
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘1’ (0x31)
03 ‘L’ (0x4c)
3.3 Character delete commands
This group of command lets you delete characters, parts of rows or even a complete display.
3.3.1 Delete n characters
This command deletes the number of characters determined by the parameter Pn. Characters are
deleted rightwards starting from the current cursor position. If Pn is omitted or if its value is set to 0,
just one character is deleted. No more characters can be deleted than the number present between
the cursor position and the last character in the row.
This command does not change the position of the cursor.
Sequence ESC [ Pn P
Example: To delete 2 characters starting from the current cursor position.
Byte Command Response
00 ESC (0x1b)
01 ‘[’ (0x5b)
02 ‘2’ (0x32)
03 ‘P’ (0x50)
Table of contents